discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Wish: mirror(copy=true)

S
Scalpel78
Sun, Dec 21, 2014 11:47 AM

Hi,
the mirror() command is basically a method that moves and transforms an
object. I wish there was a way to also say that the initial object should
remain in place, while creating a mirrored copy.

Perhaps the mirror() command could have an optional copy=true parameter ?

mirror([0,1,0], copy=true)
union() {
cube([10,30,2]);
translate([5, 25, 0]) cylinder(h=10, d=6);
}

Wouldn't that be useful?

--
View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, the mirror() command is basically a method that moves and transforms an object. I wish there was a way to also say that the initial object should remain in place, while creating a mirrored copy. Perhaps the mirror() command could have an optional copy=true parameter ? mirror([0,1,0], copy=true) union() { cube([10,30,2]); translate([5, 25, 0]) cylinder(h=10, d=6); } Wouldn't that be useful? -- View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681.html Sent from the OpenSCAD mailing list archive at Nabble.com.
GF
Greg Frost
Sun, Dec 21, 2014 12:03 PM

Can't you just make a module that does that? Something like:

module copy_mirror(vec=[0,1,0])
{
children();
mirror(vec) children();
}

Sent from my iPhone

On 21 Dec 2014, at 10:17 pm, Scalpel78 frode@lillerud.no wrote:

Hi,
the mirror() command is basically a method that moves and transforms an
object. I wish there was a way to also say that the initial object should
remain in place, while creating a mirrored copy.

Perhaps the mirror() command could have an optional copy=true parameter ?

mirror([0,1,0], copy=true)
union() {
cube([10,30,2]);
translate([5, 25, 0]) cylinder(h=10, d=6);
}

Wouldn't that be useful?

--
View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

Can't you just make a module that does that? Something like: module copy_mirror(vec=[0,1,0]) { children(); mirror(vec) children(); } Sent from my iPhone > On 21 Dec 2014, at 10:17 pm, Scalpel78 <frode@lillerud.no> wrote: > > Hi, > the mirror() command is basically a method that moves and transforms an > object. I wish there was a way to also say that the initial object should > remain in place, while creating a mirrored copy. > > Perhaps the mirror() command could have an optional copy=true parameter ? > > mirror([0,1,0], copy=true) > union() { > cube([10,30,2]); > translate([5, 25, 0]) cylinder(h=10, d=6); > } > > Wouldn't that be useful? > > > > -- > View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
PF
Peter Falke
Sun, Dec 21, 2014 12:14 PM

+1

2014-12-21 13:03 GMT+01:00 Greg Frost gregorybartonfrost@gmail.com:

Can't you just make a module that does that? Something like:

module copy_mirror(vec=[0,1,0])
{
children();
mirror(vec) children();
}

Sent from my iPhone

On 21 Dec 2014, at 10:17 pm, Scalpel78 frode@lillerud.no wrote:

Hi,
the mirror() command is basically a method that moves and transforms an
object. I wish there was a way to also say that the initial object should
remain in place, while creating a mirrored copy.

Perhaps the mirror() command could have an optional copy=true parameter ?

mirror([0,1,0], copy=true)
union() {
cube([10,30,2]);
translate([5, 25, 0]) cylinder(h=10, d=6);
}

Wouldn't that be useful?

--
View this message in context:

Sent from the OpenSCAD mailing list archive at Nabble.com.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

+1 2014-12-21 13:03 GMT+01:00 Greg Frost <gregorybartonfrost@gmail.com>: > Can't you just make a module that does that? Something like: > > module copy_mirror(vec=[0,1,0]) > { > children(); > mirror(vec) children(); > } > > Sent from my iPhone > > > On 21 Dec 2014, at 10:17 pm, Scalpel78 <frode@lillerud.no> wrote: > > > > Hi, > > the mirror() command is basically a method that moves and transforms an > > object. I wish there was a way to also say that the initial object should > > remain in place, while creating a mirrored copy. > > > > Perhaps the mirror() command could have an optional copy=true parameter ? > > > > mirror([0,1,0], copy=true) > > union() { > > cube([10,30,2]); > > translate([5, 25, 0]) cylinder(h=10, d=6); > > } > > > > Wouldn't that be useful? > > > > > > > > -- > > View this message in context: > http://forum.openscad.org/Wish-mirror-copy-true-tp10681.html > > Sent from the OpenSCAD mailing list archive at Nabble.com. > > > > _______________________________________________ > > OpenSCAD mailing list > > Discuss@lists.openscad.org > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
S
Scalpel78
Sun, Dec 21, 2014 12:27 PM

Greg Frost wrote

Can't you just make a module that does that? Something like:

module copy_mirror(vec=[0,1,0])
{
children();
mirror(vec) children();
}

Absolutely, good idea! Thanks!

--
View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10687.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Greg Frost wrote > Can't you just make a module that does that? Something like: > > module copy_mirror(vec=[0,1,0]) > { > children(); > mirror(vec) children(); > } Absolutely, good idea! Thanks! -- View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10687.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Sun, Dec 21, 2014 9:00 PM

You will find that Gregs approach can be used for a lot of what, on initial
view, seem to be shortcomings of the language.


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. This work is published globally via the internet. :) 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/

View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10694.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You will find that Gregs approach can be used for a lot of what, on initial view, seem to be shortcomings of the language. ----- 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. This work is published globally via the internet. :) 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/ -- View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10694.html Sent from the OpenSCAD mailing list archive at Nabble.com.
S
Scalpel78
Mon, Dec 22, 2014 8:46 AM

Thanks again, this is becoming one of my new favorite modules.

Michael, yes I need to adjust to how you can use modules and the children
keyword for making useful methods.

--
View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10697.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks again, this is becoming one of my new favorite modules. Michael, yes I need to adjust to how you can use modules and the children keyword for making useful methods. -- View this message in context: http://forum.openscad.org/Wish-mirror-copy-true-tp10681p10697.html Sent from the OpenSCAD mailing list archive at Nabble.com.