discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

2D view, negative Z

M
MichaelAtOz
Sat, Jan 23, 2016 2:17 AM

Top view after render
http://forum.openscad.org/file/n15824/2D_-Z_top.jpg
Side view - note negative Z
http://forum.openscad.org/file/n15824/2D_-Z_Right.jpg
Angled views, make it look like it is not aligned to the axis
http://forum.openscad.org/file/n15824/2D_-Z_angle_same.jpg
http://forum.openscad.org/file/n15824/2D_-Z_angle_opposite.jpg

Is this fixable?


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/2D-view-negative-Z-tp15824.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Top view after render <http://forum.openscad.org/file/n15824/2D_-Z_top.jpg> Side view - note negative Z <http://forum.openscad.org/file/n15824/2D_-Z_Right.jpg> Angled views, make it look like it is not aligned to the axis <http://forum.openscad.org/file/n15824/2D_-Z_angle_same.jpg> <http://forum.openscad.org/file/n15824/2D_-Z_angle_opposite.jpg> Is this fixable? ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/2D-view-negative-Z-tp15824.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Sat, Jan 23, 2016 2:28 AM

I just translated it to look OK... for the wiki
http://forum.openscad.org/file/n15825/Rotate_extrude_wiki_2D_B.jpg


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/2D-view-negative-Z-tp15824p15825.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I just translated it to look OK... for the wiki <http://forum.openscad.org/file/n15825/Rotate_extrude_wiki_2D_B.jpg> ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/2D-view-negative-Z-tp15824p15825.html Sent from the OpenSCAD mailing list archive at Nabble.com.
CA
Carsten Arnholm
Sat, Jan 23, 2016 10:37 AM

On 23. jan. 2016 03:17, MichaelAtOz wrote:

This seems paradoxical, or perhaps not? The problem relates to the value
of the non-existent z coordinate in a 2d [x,y] coordinate system?

I think 2d coordinates on OpenSCAD are slightly (just slightly)
scizophrenic. 2d shapes are sometimes drawn/interpreted/used for a value
of z != 0, showing that it really has a z value as in your example.

When you rotate a 2d shape around for example the y-axis to give the
coordinates z != 0, strange things start to happen. First, it makes a
lot of sense:

rotate([0,-45]) translate([15,0])circle(5);

http://arnholm.org/tmp/openscad/circle2d_rotated.png

Now you have a 2d circle placed in 3d space where the points on the
circumference of the circle have different z-coordinates in the global
system. It is also drawn correctly with a small unit thickness in the
direction perpendicular to the transformed local 2d coordinate system.
It is the local coordinate system of the circle that is 2d, not its
placement or orientation in 3d space. The display this in OpenSCAD
appears to support this understanding.

But try this "extrude1":

module extrude1()
{
color("green")
linear_extrude(height=10)
rotate([0,-45])
translate([15,0])circle(5);
}
extrude1();

For some reason, the (unstated) projection of the rotated circle down to
the global coordinate system x-y plane is now taken as the starting
point of an extrusion in global z direction. This is where the thing is
(slightly) scizophrenic, the circle has and it hasn't values for its
z-coordinates, and the direction of its thickness/direction of extrusion
has changed.

One could perhaps argue that a more consistent behaviour would be for
the above to cause the same result as this "extrude2":

module circle3d(r=1,dx=1,ry=1)
{
rotate([0,ry]) translate([15,0])
linear_extrude(height=0.001) circle(r);
}

module extrude2()
{
color("red")
hull(){
circle3d(r=5,dx=15,ry=-45);
translate([0,0,10])
circle3d(r=5,dx=15,ry=-45);
}
}
extrude2();

That is, it is more consistent if you insist that linear_extrude
operates only in z of the global 3d coordinate system. However, it is
equally logical to expect that linear_extrude extrudes in the
perpendicular direction of its 2d input, just like the original unit
thickness drawing was hinting. After all the purpose in life of
linear_extrude is to convert from 2d shapes to 3d solids. Therefore,
accepting that transformed 2d shapes can exist in 3d space with
coordinates z!=0, you might as well have expected the first extrusion to
give a result equivalent to this:

module extrude3()
{
color("blue") rotate([0,-45])
linear_extrude(height=10)
translate([15,0]) circle(r=5);
}
extrude3();

http://arnholm.org/tmp/openscad/extrusion_confusion.png

If you understand these inconsistencies, it is manageable. However, the
behaviour of  extrude1() is really unreasonable in my mind. I think it
would have been more consistent and logical if extrude1() gave the same
result as extrude3(), i.e. the extrusion was in the direction of the
original drawn unit thickness of the transformed 2d circle, starting
from the placement of the circle in 3d space.

If you understand these inconsistencies it isn't a big problem, but I
can imagine new users being very much confused by them.

Carsten Arnholm

On 23. jan. 2016 03:17, MichaelAtOz wrote: > Top view after render > <http://forum.openscad.org/file/n15824/2D_-Z_top.jpg> > Side view - note negative Z > <http://forum.openscad.org/file/n15824/2D_-Z_Right.jpg> > Angled views, make it look like it is not aligned to the axis > <http://forum.openscad.org/file/n15824/2D_-Z_angle_same.jpg> > <http://forum.openscad.org/file/n15824/2D_-Z_angle_opposite.jpg> > > Is this fixable? This seems paradoxical, or perhaps not? The problem relates to the value of the non-existent z coordinate in a 2d [x,y] coordinate system? I think 2d coordinates on OpenSCAD are slightly (just slightly) scizophrenic. 2d shapes are sometimes drawn/interpreted/used for a value of z != 0, showing that it really has a z value as in your example. When you rotate a 2d shape around for example the y-axis to give the coordinates z != 0, strange things start to happen. First, it makes a lot of sense: rotate([0,-45]) translate([15,0])circle(5); http://arnholm.org/tmp/openscad/circle2d_rotated.png Now you have a 2d circle placed in 3d space where the points on the circumference of the circle have different z-coordinates in the global system. It is also drawn correctly with a small unit thickness in the direction perpendicular to the transformed local 2d coordinate system. It is the local coordinate system of the circle that is 2d, not its placement or orientation in 3d space. The display this in OpenSCAD appears to support this understanding. But try this "extrude1": module extrude1() { color("green") linear_extrude(height=10) rotate([0,-45]) translate([15,0])circle(5); } extrude1(); For some reason, the (unstated) projection of the rotated circle down to the global coordinate system x-y plane is now taken as the starting point of an extrusion in global z direction. This is where the thing is (slightly) scizophrenic, the circle has and it hasn't values for its z-coordinates, and the direction of its thickness/direction of extrusion has changed. One could perhaps argue that a more consistent behaviour would be for the above to cause the same result as this "extrude2": module circle3d(r=1,dx=1,ry=1) { rotate([0,ry]) translate([15,0]) linear_extrude(height=0.001) circle(r); } module extrude2() { color("red") hull(){ circle3d(r=5,dx=15,ry=-45); translate([0,0,10]) circle3d(r=5,dx=15,ry=-45); } } extrude2(); That is, it is more consistent if you insist that linear_extrude operates only in z of the global 3d coordinate system. However, it is equally logical to expect that linear_extrude extrudes in the perpendicular direction of its 2d input, just like the original unit thickness drawing was hinting. After all the purpose in life of linear_extrude is to convert from 2d shapes to 3d solids. Therefore, accepting that transformed 2d shapes can exist in 3d space with coordinates z!=0, you might as well have expected the first extrusion to give a result equivalent to this: module extrude3() { color("blue") rotate([0,-45]) linear_extrude(height=10) translate([15,0]) circle(r=5); } extrude3(); http://arnholm.org/tmp/openscad/extrusion_confusion.png If you understand these inconsistencies, it is manageable. However, the behaviour of extrude1() is really unreasonable in my mind. I think it would have been more consistent and logical if extrude1() gave the same result as extrude3(), i.e. the extrusion was in the direction of the original drawn unit thickness of the transformed 2d circle, starting from the placement of the circle in 3d space. If you understand these inconsistencies it isn't a big problem, but I can imagine new users being very much confused by them. Carsten Arnholm
NH
nop head
Sat, Jan 23, 2016 11:06 AM

square(); produces a square below the XY plane with F6, so I think there is
a bug drawing 2D objects on top of all the schizophrenia.

On 23 January 2016 at 10:37, Carsten Arnholm arnholm@arnholm.org wrote:

On 23. jan. 2016 03:17, MichaelAtOz wrote:

This seems paradoxical, or perhaps not? The problem relates to the value
of the non-existent z coordinate in a 2d [x,y] coordinate system?

I think 2d coordinates on OpenSCAD are slightly (just slightly)
scizophrenic. 2d shapes are sometimes drawn/interpreted/used for a value of
z != 0, showing that it really has a z value as in your example.

When you rotate a 2d shape around for example the y-axis to give the
coordinates z != 0, strange things start to happen. First, it makes a lot
of sense:

rotate([0,-45]) translate([15,0])circle(5);

http://arnholm.org/tmp/openscad/circle2d_rotated.png

Now you have a 2d circle placed in 3d space where the points on the
circumference of the circle have different z-coordinates in the global
system. It is also drawn correctly with a small unit thickness in the
direction perpendicular to the transformed local 2d coordinate system. It
is the local coordinate system of the circle that is 2d, not its placement
or orientation in 3d space. The display this in OpenSCAD appears to support
this understanding.

But try this "extrude1":

module extrude1()
{
color("green")
linear_extrude(height=10)
rotate([0,-45])
translate([15,0])circle(5);
}
extrude1();

For some reason, the (unstated) projection of the rotated circle down to
the global coordinate system x-y plane is now taken as the starting point
of an extrusion in global z direction. This is where the thing is
(slightly) scizophrenic, the circle has and it hasn't values for its
z-coordinates, and the direction of its thickness/direction of extrusion
has changed.

One could perhaps argue that a more consistent behaviour would be for the
above to cause the same result as this "extrude2":

module circle3d(r=1,dx=1,ry=1)
{
rotate([0,ry]) translate([15,0])
linear_extrude(height=0.001) circle(r);
}

module extrude2()
{
color("red")
hull(){
circle3d(r=5,dx=15,ry=-45);
translate([0,0,10])
circle3d(r=5,dx=15,ry=-45);
}
}
extrude2();

That is, it is more consistent if you insist that linear_extrude operates
only in z of the global 3d coordinate system. However, it is equally
logical to expect that linear_extrude extrudes in the perpendicular
direction of its 2d input, just like the original unit thickness drawing
was hinting. After all the purpose in life of linear_extrude is to convert
from 2d shapes to 3d solids. Therefore, accepting that transformed 2d
shapes can exist in 3d space with coordinates z!=0, you might as well have
expected the first extrusion to give a result equivalent to this:

module extrude3()
{
color("blue") rotate([0,-45])
linear_extrude(height=10)
translate([15,0]) circle(r=5);
}
extrude3();

http://arnholm.org/tmp/openscad/extrusion_confusion.png

If you understand these inconsistencies, it is manageable. However, the
behaviour of  extrude1() is really unreasonable in my mind. I think it
would have been more consistent and logical if extrude1() gave the same
result as extrude3(), i.e. the extrusion was in the direction of the
original drawn unit thickness of the transformed 2d circle, starting from
the placement of the circle in 3d space.

If you understand these inconsistencies it isn't a big problem, but I can
imagine new users being very much confused by them.

Carsten Arnholm


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

square(); produces a square below the XY plane with F6, so I think there is a bug drawing 2D objects on top of all the schizophrenia. On 23 January 2016 at 10:37, Carsten Arnholm <arnholm@arnholm.org> wrote: > On 23. jan. 2016 03:17, MichaelAtOz wrote: > >> Top view after render >> <http://forum.openscad.org/file/n15824/2D_-Z_top.jpg> >> Side view - note negative Z >> <http://forum.openscad.org/file/n15824/2D_-Z_Right.jpg> >> Angled views, make it look like it is not aligned to the axis >> <http://forum.openscad.org/file/n15824/2D_-Z_angle_same.jpg> >> <http://forum.openscad.org/file/n15824/2D_-Z_angle_opposite.jpg> >> >> Is this fixable? >> > > This seems paradoxical, or perhaps not? The problem relates to the value > of the non-existent z coordinate in a 2d [x,y] coordinate system? > > I think 2d coordinates on OpenSCAD are slightly (just slightly) > scizophrenic. 2d shapes are sometimes drawn/interpreted/used for a value of > z != 0, showing that it really has a z value as in your example. > > When you rotate a 2d shape around for example the y-axis to give the > coordinates z != 0, strange things start to happen. First, it makes a lot > of sense: > > rotate([0,-45]) translate([15,0])circle(5); > > http://arnholm.org/tmp/openscad/circle2d_rotated.png > > Now you have a 2d circle placed in 3d space where the points on the > circumference of the circle have different z-coordinates in the global > system. It is also drawn correctly with a small unit thickness in the > direction perpendicular to the transformed local 2d coordinate system. It > is the local coordinate system of the circle that is 2d, not its placement > or orientation in 3d space. The display this in OpenSCAD appears to support > this understanding. > > But try this "extrude1": > > module extrude1() > { > color("green") > linear_extrude(height=10) > rotate([0,-45]) > translate([15,0])circle(5); > } > extrude1(); > > For some reason, the (unstated) projection of the rotated circle down to > the global coordinate system x-y plane is now taken as the starting point > of an extrusion in global z direction. This is where the thing is > (slightly) scizophrenic, the circle has and it hasn't values for its > z-coordinates, and the direction of its thickness/direction of extrusion > has changed. > > One could perhaps argue that a more consistent behaviour would be for the > above to cause the same result as this "extrude2": > > module circle3d(r=1,dx=1,ry=1) > { > rotate([0,ry]) translate([15,0]) > linear_extrude(height=0.001) circle(r); > } > > module extrude2() > { > color("red") > hull(){ > circle3d(r=5,dx=15,ry=-45); > translate([0,0,10]) > circle3d(r=5,dx=15,ry=-45); > } > } > extrude2(); > > That is, it is more consistent if you insist that linear_extrude operates > only in z of the global 3d coordinate system. However, it is equally > logical to expect that linear_extrude extrudes in the perpendicular > direction of its 2d input, just like the original unit thickness drawing > was hinting. After all the purpose in life of linear_extrude is to convert > from 2d shapes to 3d solids. Therefore, accepting that transformed 2d > shapes can exist in 3d space with coordinates z!=0, you might as well have > expected the first extrusion to give a result equivalent to this: > > module extrude3() > { > color("blue") rotate([0,-45]) > linear_extrude(height=10) > translate([15,0]) circle(r=5); > } > extrude3(); > > http://arnholm.org/tmp/openscad/extrusion_confusion.png > > If you understand these inconsistencies, it is manageable. However, the > behaviour of extrude1() is really unreasonable in my mind. I think it > would have been more consistent and logical if extrude1() gave the same > result as extrude3(), i.e. the extrusion was in the direction of the > original drawn unit thickness of the transformed 2d circle, starting from > the placement of the circle in 3d space. > > If you understand these inconsistencies it isn't a big problem, but I can > imagine new users being very much confused by them. > > Carsten Arnholm > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
TP
Torsten Paul
Sat, Jan 23, 2016 11:18 AM

On 01/23/2016 12:06 PM, nop head wrote:

square(); produces a square below the XY plane with F6, so I think
there is a bug drawing 2D objects on top of all the schizophrenia.

On 01/23/2016 12:06 PM, nop head wrote: > square(); produces a square below the XY plane with F6, so I think > there is a bug drawing 2D objects on top of all the schizophrenia. > Yes, that one: https://github.com/openscad/openscad/issues/1202 ciao, Torsten.
MK
Marius Kintel
Sat, Jan 23, 2016 7:08 PM

On Jan 23, 2016, at 06:18 AM, Torsten Paul Torsten.Paul@gmx.de wrote:

On 01/23/2016 12:06 PM, nop head wrote:

square(); produces a square below the XY plane with F6, so I think
there is a bug drawing 2D objects on top of all the schizophrenia.

Right, let’s just change it :)

-Marius

> On Jan 23, 2016, at 06:18 AM, Torsten Paul <Torsten.Paul@gmx.de> wrote: > > On 01/23/2016 12:06 PM, nop head wrote: >> square(); produces a square below the XY plane with F6, so I think >> there is a bug drawing 2D objects on top of all the schizophrenia. >> > Yes, that one: > https://github.com/openscad/openscad/issues/1202 > Right, let’s just change it :) -Marius