CVLofconvexHull

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CVL/Closed Vertex Lists
Introduced first in SolidGeometry 4.1, Creation date: 2017-08-11, Last change: 2025-09-14

returns the three cutting contours through the convex hull of a solid

Description

Thus function helps to create cutting contours for a solid using an optional cutting frame coordinate system

See Also: CVLofSGcutplanes

Example Illustration

 missing image of CVLofconvexHull(SG,T)

Syntax

[CVLX,CVLY,CVLZ,T]=CVLofconvexHull(SG,[T])

Input Parameter

SG: Solid geoemtry
T: cutting coordinate system; default is eye(4) at center of solid

Output Parameter

CVLX: cutting contour x=0 (green)
CVLY: cutting contour y=0 (blue)
CVLZ: cutting contour z=0 (red)
T: used T matrix; if input parameter T was empty

Examples


CVLofconvexHull(SGsample(29))
CVLofconvexHull(SGsample(30))
CVLofconvexHull(SGsample(29),TofP([0 22 5]))
CVLofconvexHull(SGsample(29),TofR(rot(pi/20,pi/20,pi/20),[0 22 5]))




Copyright 2017-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, CVLofconvexHull, computes the cutting contours through the convex hull of a solid geometry. It is designed to create cutting contours using an optional cutting frame coordinate system.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize the transformation matrix T to the identity matrix eye(4).
  2. If a second argument is provided and is not empty, set T to this argument. Otherwise, calculate the center point cp of the solid geometry using centerVL(VLofSG(SGofBB(SG))).
  3. If cp is not empty, update the translation part of T with cp.
  4. Calculate the inverse of T as iT.
  5. Transform the solid geometry SG using iT and compute its convex hull SG3.
  6. For each axis (z, y, x), compute the cutting contour using the following steps:
    • For the z-axis, use the identity matrix eye(4).
    • For the y-axis, rotate by -pi/2 around the x-axis using TofR(rot(-pi/2,0,0)).
    • For the x-axis, rotate by +pi/2 around the y-axis using TofR(rot(0,+pi/2,0)).
  7. Transform the resulting contour back using T and remove straight lines using CVLremstraight.
  8. If no output arguments are specified, plot the solid geometry and the cutting contours using SGplot and CVLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 08:17. (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