Mirror operator

18 messages
Open this post in threaded view
|
Report Content as Inappropriate

Mirror operator

 Relatively New user here, and having trouble with the "mirror" operation. As I understand the documentation the mirror operation should create a mirrored copy of the object(s) within its scope. When I do that to a set of objects, it creates the mirrored items, but not the original (unmirrored) ones. I my understanding wrong, or am I missing something? as an example bigd=10; smalld=3; h1=20; mirror(v=[1,0,0]) translate ([-10,-12,-10]) union () {     cylinder (d1=bigd,d2=smalld, h=h1+.2 );     translate ([-1.75,0,0]) cube ([3,6,h1+.2] ); } gives me only one object, not the two, mirrored ones I was expecting.
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 The result is as expected. If you need the two objects, you need to define both. define the first one, then define the mirrored one. Jean-Paul N1JPL > On Mar 14, 2017, at 8:21 PM, jim_klessig <[hidden email]> wrote: > > Relatively New user here, and having trouble with the "mirror" operation. > As I understand the documentation the mirror operation should create a > mirrored copy of the object(s) within its scope. > > When I do that to a set of objects, it creates the mirrored items, but not > the original (unmirrored) ones. > > I my understanding wrong, or am I missing something? > > as an example > bigd=10; > smalld=3; > h1=20; > > mirror(v=[1,0,0]) translate ([-10,-12,-10]) union () { >    cylinder (d1=bigd,d2=smalld, h=h1+.2 ); >    translate ([-1.75,0,0]) cube ([3,6,h1+.2] ); > } > > > gives me only one object, not the two, mirrored ones I was expecting. > > > > > > -- > View this message in context: http://forum.openscad.org/Mirror-operator-tp20900.html> Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 In reply to this post by jim_klessig mirror() is an operator like rotate(): it transforms objetcs, doesn't create copies. See: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Tips_and_Tricks#Create_a_mirrored_object_while_retaining_the_original2017-03-14 21:21 GMT-03:00 jim_klessig :Relatively New user here, and having trouble with the "mirror" operation. As I understand the documentation the mirror operation should create a mirrored copy of the object(s) within its scope. When I do that to a set of objects, it creates the mirrored items, but not the original (unmirrored) ones. I my understanding wrong, or am I missing something? as an example bigd=10; smalld=3; h1=20; mirror(v=[1,0,0]) translate ([-10,-12,-10]) union () {     cylinder (d1=bigd,d2=smalld, h=h1+.2 );     translate ([-1.75,0,0]) cube ([3,6,h1+.2] ); } gives me only one object, not the two, mirrored ones I was expecting. -- View this message in context: http://forum.openscad.org/Mirror-operator-tp20900.html Sent from the OpenSCAD mailing list archive at Nabble.com. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 2017-03-14 22:01 GMT-03:00 jim_klessig :That does not agree with what the example seems to indicate, and does make it a fairly useless operator imo.You are perfectly right regarding the manual: the first examples are misleading and need to be corrected. But mirror() is as useful as rotate() and other operators that do not make copies. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 Administrator Examples corrected. 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!
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 In reply to this post by Ronaldo Ronaldo wrote But mirror() is as useful as rotate() besides the fact that it has really some funny implementation. Try this: mirror([0, .2, 0]) cube (10); mirror([1, .2, 0]) cube (10); mirror([1, 1, .1]) cube (10); mirror([1, 1, 1]) cube (10);
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 >and does make it a fairly useless operator imoIt creates a mirror image of an object. I don't think there is another way to do that except by using multmatrix (which can also do rotate, translate, scale, etc.) so it is useful for me. For example, to make left and right hand versions of brackets.On 15 March 2017 at 14:45, Parkinbot wrote:Ronaldo wrote > But mirror() is as useful as rotate() besides the fact that it has really some funny implementation. Try this: > mirror([0, .2, 0]) cube (10); > mirror([1, .2, 0]) cube (10); > mirror([1, 1, .1]) cube (10); > mirror([1, 1, 1]) cube (10); -- View this message in context: http://forum.openscad.org/Mirror-operator-tp20900p20921.html Sent from the OpenSCAD mailing list archive at Nabble.com. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 In reply to this post by jim_klessig Hi.2017-03-15 2:01 GMT+01:00 jim_klessig :[...] does make it a fairly useless operator imo.I've lost count of the number of times mirror() has saved me time. So it doesn't imo :-)In any case is almost trivial to get what you want. Just define you own function (mirror2?) and use it instead of mirror(). For example, I've used this many times:module mirror2(v) {  children();  mirror(v) children();}hth :-) _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 This subject comes up every few years.For a long time I thought the best way to deal with this is to add an option mirror(v,keep=fales/true).In the hope that this will it make it easier for people to learn OpenSCAD and to have shorter code. _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 On 16. mars 2017 17:24, Peter Falke wrote: > This subject comes up every few years. > For a long time I thought the best way to deal with this is to add an > option mirror(v,keep=fales/true). > In the hope that this will it make it easier for people to learn > OpenSCAD and to have shorter code. I don't think so, it would solidify confusion unless you want to do the same for translate, rotate, scale and mirror. And multmatrix too. These are all just variants of the same thing: different ways of expressing a transformation via a 4x4 homogeneous transformation matrix. They all simply transform the object to which the transformation is applied, no children left behind. Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

Open this post in threaded view
|
Report Content as Inappropriate

Re: Mirror operator

 In reply to this post by jim_klessig On 2017-03-17 00:19, jim_klessig wrote: > I would disagree that it "solidifies confusion". > > I think the confusion is inherent in the name "mirror". > Scale, rotate, and translate do not carry the same basic connotation > (that "mirror" does) of "creating a copy". > To me "reflect" would have been less confusing. Far more confusing to > this new user, was the combination of the words and the illustrations > used in the example. The words translate, rotate, scale and mirror are universal terms in the context of 3d transformations expressed as 4x4 homogeneous transformation matrices, just look up any book on transformations in computer graphics, CAD systems, or finite elements. OpenSCAD has simply adopted the established nomenclature and interpretation. Applying a new meaning to these terms would indeed cause more confusion. Carsten Arnholm _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Open this post in threaded view
|
Report Content as Inappropriate