SGsweepTproj

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.8, Creation date: 2019-09-10, Last change: 2025-09-14

sweeps the outer contour of a solid to create a swept solid



See Also: CPLsweep , CPLofSGhull

Example Illustration

 missing image of SGsweepTproj(SG,wt,T,b)

Syntax

SGS=SGsweepTproj(SG,[wt,T,b])

Input Parameter

SG: Solid Geometry
wt: angle interval [wmin wmax]
T: sweeping z-axis or HT Matrix or Frame char
b: buffer to increase swept volume

Output Parameter

SGS: Swept Solid Geometry

Examples


SGsweepTproj(SGservosample(1),'',[1 0 0],2)
SGsweepTproj(SGservosample(1),'',[0 1 0],2)
SGsweepTproj(SGservosample(1),'',[0 0 1],2) % default




Copyright 2019-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, SGsweepTproj, is designed to sweep the outer contour of a solid to create a swept solid. Below is a detailed explanation of the algorithm and its parameters:

Input Parameters

Algorithm Steps

  1. Retrieve the parameters wt, T, b, and pc using getfuncparams. The default center point pc is calculated using centerVL(SG.VL).
  2. If T is a character, it is assumed to be a frame name. The function SGTget retrieves the transformation matrix for this frame. If the frame is not defined, an error is thrown.
  3. If T is a 3-element vector, it is converted to a transformation matrix using TofPez(pc,T).
  4. Transform the solid geometry SG using the inverse of T with SGtransT, resulting in SGI.
  5. Calculate the bounding box and other parameters of SGI using sofBB.
  6. Generate the contour polygon list (CPL) of the solid's hull using CPLofSGhull.
  7. Remove straight lines with minimal angle using CPLremstraightAmin with a threshold of 1e-3.
  8. Apply a buffer to the CPL using CPLbuffer with the buffer value b.
  9. Sweep the CPL over the angle interval wt using CPLsweep.
  10. Remove straight lines again using CPLremstraightAmin.
  11. Create the swept solid geometry SGS from the CPL using SGofCPLz, extending it by ss(3) + 2*b.
  12. Translate SGS using SGtransP to adjust its position based on the bounding box and buffer.
  13. Transform SGS back using SGtransT with the original transformation T.
  14. If no output is requested, plot the original and swept solids using SGfigure, SGplotalpha, and tplot.

Output

Algorithm explaination created using ChatGPT on 2025-08-19 07:59. (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