Syntax
[T,d,aa]=TofcrossedSG([SG,T,sd]);
Input Parameter
SG : | | Solid to be crossed |
T : | | Starting frame |
sd : | | optional start distance from T |
Output Parameter
T : | | Frame HT matrix |
d : | | distance to 1st wall |
aa : | | full list [facet index; distance] as of crosspointVLFL |
Examples
TofcrossedSG(SGbox,TofPez([0 0 20],[0 0 -1]),0)
TofcrossedSG(SGbox,TofPez([0 0 20],[0 0 -1]),20)
Copyright 2020-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
Algorithm (Workflow)
This function, TofcrossedSG
, is designed to find a surface point on a solid using the direction vector of a transformation matrix T
and create a frame. It is part of the SG-Library and was introduced in SolidGeometry 5.0.
Input Parameters
- SG: The solid geometry to be crossed. It contains vertex list (VL) and face list (FL).
- T: The starting frame represented as a 4x4 homogeneous transformation matrix. If not provided, it defaults to the identity matrix.
- sd: An optional start distance from the origin of
T
along its z-axis. Defaults to 0 if not specified.
Output Results
- T: The updated frame HT matrix after finding the surface point.
- d: The distance to the first wall encountered.
- aa: A full list containing facet index and distance as returned by
crosspointVLFL
.
Algorithm Steps
- Retrieve input parameters
SG
, T
, and sd
using getfuncparams
.
- Store the original transformation matrix
T
in Torg
.
- Call
crosspointVLFL
to find the cross point cp
on the solid's surface using the vertex list, face list, and the direction vector from T
.
- If no cross point is found, plot the solid and raise an error indicating that the direction vector does not intersect any surface.
- Update the translation part of
T
with the found cross point cp
.
- Calculate the distance
d
between the first two walls if multiple intersections are found; otherwise, use the distance from aa
.
- Compute the normal of the intersected face using
VLFLnormf
and calculate the angle a
between this normal and the direction vector of T
.
- If the angle
a
is greater than 90 degrees, rotate the orientation part of T
by 180 degrees around the y-axis.
- If no output is requested, print the wall thickness and plot the original and updated frames.
Algorithm explaination created using ChatGPT on 2025-08-19 08:28. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21