transf is a geometric transformation.
p is a list of characteristic parameters of this transformation. For example an angle for rotation,
3 coefficients for expansion , three coordinates for movement.
obj is a standard object.
The coordinates of the object id are changed from their previous positions:
poi = transf(poi).
Default transformations are from the previous position.
ini: successive transformations will be from a copy of the original points and are not cumulative in this case:
poi = transf(copie).
max: only transforms the points referenced in the facets (excluding anchors).
validate: the copy is replaced by the transformed points:
copy = poi = transf(poi).
rotx(PI/4)vol(1); rotates volume 1 of angle PI/4 around x axis.
rotx(PI/4)vol(1);roty(PI/3)vol(1): rotates volume 1 of angle PI/4 around x axis
then rotate the result of PI / 3 about the y axis.
rotx(PI/4)vol(1)ini;roty(PI/3)vol(1): Doing the same thing, but from a copy of the original points.
rotx(PI/4)vol(1)ini;roty(PI/3)vol(1)validate: Doing the same thing, but transforming the original copy points.
To validate the copy points can be also: validate(1)poi vol(id).
See an example in using the function
set_PAR() du fichier corps_simple.func.
Method by the matrix
transf id a linear transformation: tran, dila, dilx, dily, dilz, hom,
rota, axis, rotx, roty, rotz.
p is a list of characteristic parameters of this transformation.
obj is a standard object.
Only the matrix of object id is modified. Faster but does not allow no linear transformations or only on certain points.
This transformation will be sent to all the followers of the object id.
ini: Parameter (initially zero) processing base that will be added to the current settings
(allows to define standard objects, to modify them and then animate).
Note that this ini option does not have the same meaning in the direct method.
The boxes and ball are not affected by these changes, however
attach generate [box ball] vol(id)
et attach displ [box ball] vol(id) take them into account.
Any object can be changed by one of the transformations:
alea: reproductible random.
alex: x random.
aley: y random.
alez: z random.
tran: displacement (translation).
dilx: x dilatation.
dily: y dilatation.
dilz: z dilatation.
rand: no reproductible random
rotx: x rotation.
roty: y rotation.
rotz: z rotations.
sphere: spherical deformation
symx: symmetry x.
symy: symmetry y.
symz: symmetry z.
s is a multiplier of the mouse.
Realizes transf(s*(mouse normalized between -0.5 and 0.5))
Realizes transf(s*(mouse normalized between (x1,y1) and (x2,y2)))
Displays frame (x1,y1,x2,y2) and addresses only the points inside this frameet.
Transformation applied to some vertices
In this case the options allow to vary the parameters p between p1 and p2
as a function of the index of the vertex s ist lin s.
Expands the vertices 1-12 of volume number 1 in a pendular manner between 0.5 and 2.0.
Moves the volume number 1 by (200,100,0)
sphere vol(3) poi(0,100) radius(100)
Applies the tool sphere center (0,100,0) and radius 100 atvolume number 3.
transf object(id) abs
Processes only meaningful points on anchored volumes.
When parameter of the transformation T2 of volume id2 varies between p21 and p22,
the parameter of the transformation T1 of volume id1 varies between p11 and p12.
The volume 1 rotates between -PI/2 and PI/2 around axis y when the volume 2
rotates between -PI and PI around axis z.
Volume 1 is translated between (-200,0,0) and (200,0,0) when volume 2
rotates between -PI and PI around axis y.
Attach of associated transformations
The attach command encapsulates associated transformations, see an example in the fonction
func_TRA_ROTZ_ROTZ() of file demo1_attach.func:
With yes attach active, volume a will rotate z in interval [a1,a2]
when volume rotates z in interval [b1,b2].
method is to simulate a virtual laser scanning real volume by rotating a radius in a horizontal plane and intersecting vertically moving these volumes.
The simulation has no reason to limit the movement of the beam, it can be from any source and target another point located on the axis
and in the plane perpendicular to the axis passing through the source.
For example, the target point can explore concavities of the object scanned.
The set of sources is not necessarily a cylinder but may be generalized box
(generated by parametric curves around to better volume).
Similarly, the set of points of view is not necessarily an axis but may be a curve
(eg all secy CG of the box).
Command envelope vol allows to control by program such a virtual laser.