by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 1.7, Creation date: 2014-11-23, Last change: 2025-09-14
[SG1,varargout]=SGtransP(SG,p)
SG: | Solid geometry (.VL/.FL) or a cell list of SG | |
p: | Point as column vector (1x3) |
[G,p) - moves a solid geometry (or a list) relative using a translation vector
% (by Tim Lueth, SG-Lib, 2014-NOV-23 as class: SPATIAL RELATIONS)
%
% The fnctn simply uses VLtransP for the transformation. The fnctn supports
% different calling structures
% 1. N=SGtransP (A,p)
% 2. Nlist=SGtransP ({A,B,C},p)
% 3. [NA,NB,NC]=SGtransP ({A,B,C},p) (Status of: 2025-08-18)
%
% Introduced first in SolidGeometry 1.7
%
% See also: SGtrans, SGtrans0, SGtrans1, SGtransR, SGtransrelSG, SGtransrelT,
% SGtransT
%
% [SG1,varargout]=SGtransP(SG,p)
% === INPUT PARAMETERS ===
% SG: Solid geometry (.VL/.FL) or a cell list of SG
% p: Point as column vector (1x3)
% === OUTPUT RESULTS ======
% [G1,varargout]=SGtransP(SG,p)
%
% if isempty(SG)]: First output solid geometry
% [G1,varargout]=SGtransP(SG,p)
%
% if isempty(SG)]: optional more output arguments
%
% EXAMPLE: Show the movement in Z
% A=SGbox([30,20,10])]: | First output solid geometry | |
[G,p) - moves a solid geometry (or a list) relative using a translation vector
% (by Tim Lueth, SG-Lib, 2014-NOV-23 as class: SPATIAL RELATIONS)
%
% The fnctn simply uses VLtransP for the transformation. The fnctn supports
% different calling structures
% 1. N=SGtransP (A,p)
% 2. Nlist=SGtransP ({A,B,C},p)
% 3. [NA,NB,NC]=SGtransP ({A,B,C},p) (Status of: 2025-08-18)
%
% Introduced first in SolidGeometry 1.7
%
% See also: SGtrans, SGtrans0, SGtrans1, SGtransR, SGtransrelSG, SGtransrelT,
% SGtransT
%
% [SG1,varargout]=SGtransP(SG,p)
% === INPUT PARAMETERS ===
% SG: Solid geometry (.VL/.FL) or a cell list of SG
% p: Point as column vector (1x3)
% === OUTPUT RESULTS ======
% [G1,varargout]=SGtransP(SG,p)
%
% if isempty(SG)]: First output solid geometry
% [G1,varargout]=SGtransP(SG,p)
%
% if isempty(SG)]: optional more output arguments
%
% EXAMPLE: Show the movement in Z
% A=SGbox([30,20,10])]: | optional more output arguments |
Show the movement in Z
A=SGbox([30,20,10]);
A=SGtransP (A,[0 ;0 ;30]); SGplot (A); show; pause (1);
B=SGbox([20,20,10]);
[A,B]=SGtransP ({A,B},[30 ;0 ;5]); SGplot ({A,B},'b'); show
L=SGtransP ({A,B},[30 ;0 ;5]), SGplot (L,'b'); show