Wish: mirror(copy=true)

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Wish: mirror(copy=true)

Scalpel78
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?
Reply | Threaded
Open this post in threaded view
|

Re: Wish: mirror(copy=true)

Greg Frost
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 <[hidden email]> 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
> [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
Reply | Threaded
Open this post in threaded view
|

Re: Wish: mirror(copy=true)

Peter Falke
+1

2014-12-21 13:03 GMT+01:00 Greg Frost <[hidden email]>:
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 <[hidden email]> 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
> [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



--
[hidden email]

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!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Wish: mirror(copy=true)

Scalpel78
In reply to this post by Greg Frost
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!
Reply | Threaded
Open this post in threaded view
|

Re: Wish: mirror(copy=true)

MichaelAtOz
Administrator
You will find that Gregs approach can be used for a lot of what, on initial view, seem to be shortcomings of the language.
Admin - email* me if you need anything, or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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.
Reply | Threaded
Open this post in threaded view
|

Re: Wish: mirror(copy=true)

Scalpel78
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.