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