discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Mirror operator

J
jim_klessig
Wed, Mar 15, 2017 12:21 AM

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.

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.
JL
Jean-Paul Louis
Wed, Mar 15, 2017 12:40 AM

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 jim.klessig@gmail.com 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 <jim.klessig@gmail.com> 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
RP
Ronaldo Persiano
Wed, Mar 15, 2017 1:01 AM

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_original

2017-03-14 21:21 GMT-03:00 jim_klessig jim.klessig@gmail.com:

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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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_original 2017-03-14 21:21 GMT-03:00 jim_klessig <jim.klessig@gmail.com>: > 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jim_klessig
Wed, Mar 15, 2017 1:01 AM

Ok, thanks.That does not agree with what the example seems to indicate, and does make it a fairly useless operator imo.

Sent from my U.S. Cellular® Smartphone
-------- Original message --------From: "louijp [via OpenSCAD]" ml-node+s1091067n20901h34@n5.nabble.com Date: 3/14/17  5:41 PM  (GMT-08:00) To: jim_klessig jim.klessig@gmail.com Subject: 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]


OpenSCAD mailing list

[hidden email]

http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

	If you reply to this email, your message will be added to the discussion below:
	http://forum.openscad.org/Mirror-operator-tp20900p20901.html


	
	To unsubscribe from Mirror operator, click here.

	NAML

--
View this message in context: http://forum.openscad.org/Mirror-operator-tp20900p20903.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Ok, thanks.That does not agree with what the example seems to indicate, and does make it a fairly useless operator imo. Sent from my U.S. Cellular® Smartphone -------- Original message --------From: "louijp [via OpenSCAD]" <ml-node+s1091067n20901h34@n5.nabble.com> Date: 3/14/17 5:41 PM (GMT-08:00) To: jim_klessig <jim.klessig@gmail.com> Subject: 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 If you reply to this email, your message will be added to the discussion below: http://forum.openscad.org/Mirror-operator-tp20900p20901.html To unsubscribe from Mirror operator, click here. NAML -- View this message in context: http://forum.openscad.org/Mirror-operator-tp20900p20903.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Wed, Mar 15, 2017 1:10 AM

2017-03-14 22:01 GMT-03:00 jim_klessig jim.klessig@gmail.com:

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.

2017-03-14 22:01 GMT-03:00 jim_klessig <jim.klessig@gmail.com>: > 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.
M
MichaelAtOz
Wed, Mar 15, 2017 1:15 AM

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!

View this message in context: http://forum.openscad.org/Mirror-operator-tp20900p20907.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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! -- View this message in context: http://forum.openscad.org/Mirror-operator-tp20900p20907.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Wed, Mar 15, 2017 2:45 PM

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.

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.
NH
nop head
Wed, Mar 15, 2017 3:43 PM

and does make it a fairly useless operator imo

It 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 rudolf@parkinbot.com 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

>and does make it a fairly useless operator imo It 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 <rudolf@parkinbot.com> 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
AB
Antonio Bueno
Wed, Mar 15, 2017 4:46 PM

Hi.

2017-03-15 2:01 GMT+01:00 jim_klessig jim.klessig@gmail.com:

[...] 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 :-)

Hi. 2017-03-15 2:01 GMT+01:00 jim_klessig <jim.klessig@gmail.com>: > [...] 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 :-)
HL
Hans L
Wed, Mar 15, 2017 11:39 PM

You could always just scale to -1

scale([-1,1,1]) text("redrum");

On Wed, Mar 15, 2017 at 10:43 AM, nop head nop.head@gmail.com wrote:

and does make it a fairly useless operator imo

It 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 rudolf@parkinbot.com 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

You could always just scale to -1 scale([-1,1,1]) text("redrum"); On Wed, Mar 15, 2017 at 10:43 AM, nop head <nop.head@gmail.com> wrote: > >>and does make it a fairly useless operator imo > > It 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 <rudolf@parkinbot.com> 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 >> 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 >