Nabble has removed Mailing-list integration.
Posts created here DO NOT GET SENT TO THE MAILING LIST.
Mailing-list emails DO NOT GET POSTED TO THE FORUM.
So basically the Forum is now out of date, we are looking into migrating the history.

For now you should send emails, people will see them, discuss@lists.openscad.org.

Modelling question: How to specific a reference point when rotating

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

Modelling question: How to specific a reference point when rotating

Laszlo KREKACS
Hi!

Do somebody know, how can I specify a reference point in the modelling space,
so the point around the object should turn and not always the origo.

The lack of my knowledge here makes really frustrating, as I need to
turn two times
the object, and I cant turn around the origo the second time.

I solved by trial-and-error positioning after, but I could get rid of
it, if I were know the feature
beforehand.

Best regards,
 Laszlo

Reply | Threaded
Open this post in threaded view
|

Re: Modelling question: How to specific a reference point when rotating

kintel
Administrator

On Jan 30, 2010, at 17:43 , Laszlo KREKACS wrote:

> Hi!
>
> Do somebody know, how can I specify a reference point in the  
> modelling space,
> so the point around the object should turn and not always the origo.
>
The rotate() module always rotates an object around its origin.
To rotate around another point, make this point the origin, perform  
the rotation and translate the object back:

midpoint = [5,10];
translate(midpoint) rotate([0,0,45]) translate(-midpoint)  
square(size=[10,20]);

If your object comes from dxf you can specify the origin, but you  
still need to move it back:

origin = [100,100];
translate(origin) rotate([0,0,45]) import_dxf(file="origin.dxf",  
origin=origin);

You can extract the origin from the dxf by using the dxf_cross()  
module to read out the position of a manually drawn cross in the dxf  
file. This is demoed in the example009.

~/= Marius

--
We are Elektropeople for a better living.