by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 4.1, Creation date: 2017-08-22, Last change: 2025-09-14
SGN=SGtransrelT(SG,[T0,T,dv])
SG: | Solid Geometry | |
T0: | Reference Frame Matrix such as rotation axis or string for SGTget | |
T: | Relative Transformation Frame such as relative rotation; Frame to become the center | |
dv: | 'r' revolution or 'prismatic' if T is size(1) or size([1 3]) |
SGN: | Spatial transformed solid |
SGtorquefuse;SG=ans; % SG with two Frames 'B' at [0 0 -3] and 'F' at [0 0 3]
SGtransrelT(SG,'',SGTget(SG,'F')) % Move the origin of SG to Frame 'F'
SGtransrelT(SG,'',SGTget(SG,'B')) % Move the origin of SG to Frame 'B'
SGtransrelT(SG,'',inv(SGTget(SG,'F'))) % F will be moved to the origin
SGtransrelT(SG,'',inv(SGTget(SG,'B'))) % B will be moved to the origin