This silly code:
ssl = [[1],[1,2]];
cycls = ssl;
function ev(a) = a;
function bh(a) = a;
a=[for(si=ssl)[for(sij=si, bh=[bh(sij)]) each sij, cycls[bh][ev(sij)+1] -
cycls[bh][ev(sij)] ] ] ;
generates the following console messages with version 2018.01.16:
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
Compiling design (CSG Products generation)...
Geometries in cache: 0
Geometry cache size in bytes: 0
CGAL Polyhedrons in cache: 0
The last snapshot version 2019.01.10.ci1115 makes the same warnings adding
the line number of the last line.
I can't see what is wrong!
Seems to be a chicken & egg problem, in the code below you assigned things to "a" before defining it. But if you move the definition of "a" above the functions, then "a" is calling "ev" and "bh" before they are defined. So I think it's busted either way. Now as to why it only complained about "sij" and "bh" and not "a" or "ev" (I get the same warnings regardless of where "a" is defined) I can't say.
On Jan 28, 2019, at 9:46 AM, Ronaldo Persiano rcmpersiano@gmail.com wrote:
This silly code:
ssl = [[1],[1,2]];
cycls = ssl;
function ev(a) = a;
function bh(a) = a;
a=[for(si=ssl)[for(sij=si, bh=[bh(sij)]) each sij, cycls[bh][ev(sij)+1] - cycls[bh][ev(sij)] ] ] ;
generates the following console messages with version 2018.01.16:
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
Compiling design (CSG Products generation)...
Geometries in cache: 0
Geometry cache size in bytes: 0
CGAL Polyhedrons in cache: 0
The last snapshot version 2019.01.10.ci1115 makes the same warnings adding the line number of the last line.
I can't see what is wrong!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I think the issue is your comma separated expressions "each sij,
cycls[bh][ev(sij)+1] - cycls[bh][ev(sij)]" in the list comprehension don't
make sense. They need to be wrapped in square brackets.
On Mon, Jan 28, 2019 at 12:02 PM William Ferry woferry@mac.com wrote:
Seems to be a chicken & egg problem, in the code below you assigned things
to "a" before defining it. But if you move the definition of "a" above the
functions, then "a" is calling "ev" and "bh" before they are defined. So I
think it's busted either way. Now as to why it only complained about "sij"
and "bh" and not "a" or "ev" (I get the same warnings regardless of where
"a" is defined) I can't say.
On Jan 28, 2019, at 9:46 AM, Ronaldo Persiano rcmpersiano@gmail.com
wrote:
This silly code:
ssl = [[1],[1,2]];
cycls = ssl;
function ev(a) = a;
function bh(a) = a;
a=[for(si=ssl)[for(sij=si, bh=[bh(sij)]) each sij, cycls[bh][ev(sij)+1]
generates the following console messages with version 2018.01.16:
Compiling design (CSG Tree generation)...
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
WARNING: Ignoring unknown variable 'sij'.
WARNING: Ignoring unknown variable 'bh'.
Compiling design (CSG Products generation)...
Geometries in cache: 0
Geometry cache size in bytes: 0
CGAL Polyhedrons in cache: 0
The last snapshot version 2019.01.10.ci1115 makes the same warnings
adding the line number of the last line.
I can't see what is wrong!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
William Ferry woferry@mac.com wrote:
Seems to be a chicken & egg problem, in the code below you assigned things
to "a" before defining it. But if you move the definition of "a" above the
functions, then "a" is calling "ev" and "bh" before they are defined. So I
think it's busted either way. Now as to why it only complained about "sij"
and "bh" and not "a" or "ev" (I get the same warnings regardless of where
"a" is defined) I can't say.
The place of the definitions of ev() and bh() are irrelevant to OpenSCAD. I
usually write my main codes before the definitions of functions and modules
in a top down order.
I got what I wanted with the code:
a=[for(si=ssl)[for(sij=si, bh=[bh(sij)]) append(cycls[bh][ev(sij)+1] -
cycls[bh][ev(sij)], sij)] ] ;
function append(e,l) = [each l, e];
what is very different from what the previous code was trying to express.
But why the previous code generates the warning is a mystery.
Hans L thehans@gmail.com wrote:
I think the issue is your comma separated expressions "each sij,
cycls[bh][ev(sij)+1] - cycls[bh][ev(sij)]" in the list comprehension
don't make sense. They need to be wrapped in square brackets.
I guess you are write but then the message should be a syntax error message
and not a warning about something else.
Ronaldo
echo(a);
a=[for(i=[0:3]) each i, 1];
will output [0, 1, 2, 3, 1]
while
echo(a);
a=[for(i=[0:3]) each i, i];
will give you a warning because the second reference to i is out of scope as
the inner for loop ends at the comma.
--
Sent from: http://forum.openscad.org/
Right, Parkinbot. Crystal clear. That was my mistake.
Can MeshMixer fix the problem? Or are you just not wanting there to be
problem in the first place?
KT
On Mon, Jan 28, 2019 at 10:11 PM Ronaldo Persiano rcmpersiano@gmail.com
wrote:
Right, Parkinbot. Crystal clear. That was my mistake.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org