TofcrossedSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-17, Last change: 2025-09-15

finds a surface point using ez of T and creates a frame



See Also: crosspointVLFL , SGTcopyasopponent

Example Illustration

 missing image of TofcrossedSG(SG,T,sd);

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

Output Results

Algorithm Steps

  1. Retrieve input parameters SG, T, and sd using getfuncparams.
  2. Store the original transformation matrix T in Torg.
  3. 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.
  4. If no cross point is found, plot the solid and raise an error indicating that the direction vector does not intersect any surface.
  5. Update the translation part of T with the found cross point cp.
  6. Calculate the distance d between the first two walls if multiple intersections are found; otherwise, use the distance from aa.
  7. Compute the normal of the intersected face using VLFLnormf and calculate the angle a between this normal and the direction vector of T.
  8. If the angle a is greater than 90 degrees, rotate the orientation part of T by 180 degrees around the y-axis.
  9. 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