The following code is derived from some code that I was given recently
(you can ignore the numerical values).
polyhedron(
points = [
[1, 2, 1], // [0]
[2, 3, 2], // [1]
[3, 4, 3], // [2]
[4, 5, 4], // [3]
[5, 6, 5], // [4]
[6, 7, 6], // [5]
[7, 8, 7], // [6]
[8, 9, 8] // [7]
],
triangles = [
[0, 3, 4], // This-side trapezoid, bottom
[3, 7, 4], // This-side trapezoid, top
[1, 5, 2], // Back-side trapezoid, bottom
[2, 5, 6], // Back-side trapezoid, top
[0, 1, 2], // Inner rectangle, bottom
[0, 2, 3], // Inner rectangle, top
[4, 6, 5], // Outer rectangle, bottom
[4, 7, 6], // Outer rectangle, top
[7, 2, 6], // Upper rectangle, bottom
[7, 3, 2], // Upper rectangle, top
[0, 5, 1], // Lower rectangle, bottom
[0, 4, 5] // Lower rectangle, top
]
);
I keep getting the error message
WARNING: variable triangles not specified as parameter, in file OpenSCAD
2019, line 1
but when I inspect the code, "triangles" is there. Is this a bug or am
I misunderstanding the error message?
Thanks!
Jon
It means there is no such parameter to polyhedron. It got changed to faces
a long time ago.
On Sun, 19 Apr 2020 at 14:53, jon jon@jonbondy.com wrote:
The following code is derived from some code that I was given recently
(you can ignore the numerical values).
polyhedron(
points = [
[1, 2, 1], // [0]
[2, 3, 2], // [1]
[3, 4, 3], // [2]
[4, 5, 4], // [3]
[5, 6, 5], // [4]
[6, 7, 6], // [5]
[7, 8, 7], // [6]
[8, 9, 8] // [7]
],
triangles = [
[0, 3, 4], // This-side trapezoid, bottom
[3, 7, 4], // This-side trapezoid, top
[1, 5, 2], // Back-side trapezoid, bottom
[2, 5, 6], // Back-side trapezoid, top
[0, 1, 2], // Inner rectangle, bottom
[0, 2, 3], // Inner rectangle, top
[4, 6, 5], // Outer rectangle, bottom
[4, 7, 6], // Outer rectangle, top
[7, 2, 6], // Upper rectangle, bottom
[7, 3, 2], // Upper rectangle, top
[0, 5, 1], // Lower rectangle, bottom
[0, 4, 5] // Lower rectangle, top
]
);
I keep getting the error message
WARNING: variable triangles not specified as parameter, in file OpenSCAD
2019, line 1
but when I inspect the code, "triangles" is there. Is this a bug or am I
misunderstanding the error message?
Thanks!
Jon
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Is the last "," in "points" supposed to be there? I'm no openSCAD syntax
guru, but in 'C' like languages that often means add the next thing to
the current declaration.
On 4/19/20 6:52 AM, jon wrote:
The following code is derived from some code that I was given recently
(you can ignore the numerical values).
polyhedron(
points = [
[1, 2, 1], // [0]
[2, 3, 2], // [1]
[3, 4, 3], // [2]
[4, 5, 4], // [3]
[5, 6, 5], // [4]
[6, 7, 6], // [5]
[7, 8, 7], // [6]
[8, 9, 8] // [7]
],
triangles = [
[0, 3, 4], // This-side trapezoid, bottom
[3, 7, 4], // This-side trapezoid, top
[1, 5, 2], // Back-side trapezoid, bottom
[2, 5, 6], // Back-side trapezoid, top
[0, 1, 2], // Inner rectangle, bottom
[0, 2, 3], // Inner rectangle, top
[4, 6, 5], // Outer rectangle, bottom
[4, 7, 6], // Outer rectangle, top
[7, 2, 6], // Upper rectangle, bottom
[7, 3, 2], // Upper rectangle, top
[0, 5, 1], // Lower rectangle, bottom
[0, 4, 5] // Lower rectangle, top
]
);
I keep getting the error message
WARNING: variable triangles not specified as parameter, in file
OpenSCAD 2019, line 1
but when I inspect the code, "triangles" is there. Is this a bug or
am I misunderstanding the error message?
Thanks!
Jon
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 19.04.20 15:52, jon wrote:
but when I inspect the code, "triangles" is there. Is this a
bug or am I misunderstanding the error message?
It's a bug and misleading warning. It should instead say that
using "triangles" is deprecated. As nophead already mentioned,
the correct parameter is "faces".
ciao,
Torsten.
I would be happy to change "triangles" to "faces" ... except that this
documentation says I should change it to "path". There is no mention of
"faces" at all.
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#polygon
Changing it to "path" fails with a similarly misleading error message.
Changing it to "faces" works, but I never would have gotten there by
reading alone.
Thanks, everyone!
Jon
On 4/19/2020 10:35 AM, Torsten Paul wrote:
On 19.04.20 15:52, jon wrote:
but when I inspect the code, "triangles" is there. Is this a
bug or am I misunderstanding the error message?
It's a bug and misleading warning. It should instead say that
using "triangles" is deprecated. As nophead already mentioned,
the correct parameter is "faces".
ciao,
Torsten.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Try instead reading the manual for polyhedron:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron
Why do you think the message is misleading? It's telling you that "path" is
not specified (in the definition of the polyhedron module) as a parameter.
But you have passed it anyway. if you invoke
polyhedron(bogus_parameter=8)
you'll get the same message. I suppose you could argue for a more clearly
worded message.
--
Sent from: http://forum.openscad.org/
It is really nice that correct documentation for polyhedron() is
available somewhere. It is not helpful that it is wrong in the place
where I go by reflex (using the URLs provided in the Cheat Sheet, which
I dearly love). Should the Cheat Sheet be pointing in a different
direction? There must be an historical reason why there are multiple
sets of documentation, which are inconsistent.
As to the message, I will so argue! <grin>
The phrase "variable X not specified as parameter" could mean "X could
not be found in the list of valid parameters for this function" OR it
could mean "you failed to specify parameter X when calling this function".
How about "X is not a valid parameter for function Y"? That is clear
:)
Jon
On 4/19/2020 10:52 AM, adrianv wrote:
Try instead reading the manual for polyhedron:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron
Why do you think the message is misleading? It's telling you that "path" is
not specified (in the definition of the polyhedron module) as a parameter.
But you have passed it anyway. if you invoke
polyhedron(bogus_parameter=8)
you'll get the same message. I suppose you could argue for a more clearly
worded message.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 19.04.20 17:01, jon wrote:
It is really nice that correct documentation for polyhedron()
is available somewhere. It is not helpful that it is wrong
in the place where I go by reflex (using the URLs provided in
the Cheat Sheet, which I dearly love).
Where is it wrong? I checked the cheatsheet and it seems ok. If
there are links mismatched, please let me know and I'm happy to
fix those (or you can just edit directly on github).
From the description it sounds you were searching for polyhedron
(the 3D built-in) but clicked polygon (the 2D one).
ciao,
Torsten.
If I search for "OpenSCAD" in Google, I get here:
I then click on Documentation. I then click on Code Cheat Sheet (CCS)
in the left column. An image of the CCS appears on the right, and I
click it (not sure why we couldn't go directly to the CCS, especially as
the image no longer matches the actual CCS). I then click on either of
the 2D Polygon links and end up here:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#polygon
The above talks about "paths" rather than "faces", which appears to be
incorrect.
I was just informed that I should instead be looking here:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#polyhedron
This one talks about "faces" rather than "paths", which is great, but I
do not want polyhedron() (3D); I want polygon (2D). The documentation
for the latter appears to be incorrect in the first URL.
Hope this helps.
Jon
On 4/19/2020 11:11 AM, Torsten Paul wrote:
On 19.04.20 17:01, jon wrote:
It is really nice that correct documentation for polyhedron()
is available somewhere. It is not helpful that it is wrong
in the place where I go by reflex (using the URLs provided in
the Cheat Sheet, which I dearly love).
Where is it wrong? I checked the cheatsheet and it seems ok. If
there are links mismatched, please let me know and I'm happy to
fix those (or you can just edit directly on github).
From the description it sounds you were searching for polyhedron
(the 3D built-in) but clicked polygon (the 2D one).
ciao,
Torsten.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 19.04.20 17:30, jon wrote:
Hope this helps.
Nope, it's even more confusing now.
Quoting the initial message code:
polyhedron(
points = [
triangles = [
]
);
This clearly is the 3D primitive using the old name "triangles"
instead of the new one "faces".
ciao,
Torsten.