SGtransrelSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 3.1, Creation date: 2016-12-07, Last change: 2025-09-14

changes position of a solid relative to another solid

Description

The function allows the successive linking of spatial arrangements!
This function replaces a set of other functions and does support the transformation frames structure
There are also: SGincenter, SGunder, SGontop, SGinfront, SGbehind, SGleft, SGright, SGaligntop, SGalignbottom, SGalignfront, SGalignback, SGalignleft, SGalignright
This function supports also relative spatial arrangement relative to frames
This function allow the supports the relative arrangement to Feature Surfaces
========== Supported relative spatial relations: ====================================
- "under", "ontop", "left", "right", "behind", "infront",
all with optional second displacement parameter such as ..,'ontop',3,..
- "alignunder", "aligntop", "alignleft", "alignright", "alignbehind", "aligninfront",
all with optional second displacement parameter such as ..,'alignleft',3,..
- "center", "centerx", "centery", "centerz",
all with optional second parameter such as ..,'centerx',3,..

========== Supported frame name operations: ==========================================
- "matchT" with following cell {,,}
for matching frames of solid a and B
- "alignT" with following cell {,,}
- for matching frame axis y of solid A and B
- "alignTx", "alignTy", "alignTz" with following cell {,,}
- for matching frame axis x, y, z of solid A and B

========== Supported individual operations: =========================================
- "transx", "transy", "transz",
all with second parameter such as ..,'transz',3,..
- "rotx", "roty", "rotz",
all with second angle parameter such as ..,'rotz',pi/2,..
- "magnify" with second parameter of magnification size

========== Supported boolean operations: ============================================
- "cat",
- "plus", "minus", "overlap",

========== Supported absolut positioning: ===========================================
- rotx, roty, rotz



========== Supported postprocessing: ===============================================
- "col, color"
- "grow"
- "breakv", "radialv"
- "cut, cutz"

- 'debug'
- 'info'



===========ALPHABETIC LIST ===========================================================
bottom,under,down,below ontopT ontop,up,top left right infront behind trans,transP,vary,varyof transx transy transz transud translr transfb centerx centery centerz incenter,center alignright alignleft alignbehind,alignback aligninfront,alignfront aligntop alignbottom, alignunder varySG axisalign magnify,mag shrink cut,cutz adjustsx transT removeT,remT matchT alignTy,alignT, alignt alignTx alignTz attached,touch cat plus,add supp,supplement minus,removed sub crossed,overlap,intersect color,col grow breakv radialv rotz rotx roty help,info,? debug


See Also: SGTsetorigin , SGtransT , SGtrans1 , SGtransP , SGtransR , SGtransrelT

Example Illustration

 missing image of SGtransrelSG(SGA,SGB,rel,gap)

Syntax

[SG,T]=SGtransrelSG(SGA,SGB,[rel,gap])

Input Parameter

SGA: Transformed Solid Geometry
SGB: Final spatial transformation matix
rel: spatial relations
gap: gap, Optional parameter after an relation command

Output Parameter

SG: Transformed Vertices and Frames
T: Transformation used to transform solid SGA

Examples

Align relative to geometry and relative to frames
SGtransrelSG(SGA,SGB,'top','alignright',-5,alignback)
SGtransrelSG(B,A,'alignT',{'B','B'})

A=SGbox; SGtransrelSG(A,A,'rotx',pi/2,'minus','?')




Copyright 2016-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21