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
- SG: The solid geometry for which the cutting contours are to be calculated.
- T (optional): The cutting coordinate system. If not provided, the default is the identity matrix
eye(4)
centered at the solid's center.
Output Results
- CVLX: The cutting contour where x=0, represented in green.
- CVLY: The cutting contour where y=0, represented in blue.
- CVLZ: The cutting contour where z=0, represented in red.
- T: The transformation matrix used. If the input parameter
T
was empty, this will be the calculated matrix.
Algorithm Steps
- Initialize the transformation matrix
T
to the identity matrix eye(4)
.
- 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)))
.
- If
cp
is not empty, update the translation part of T
with cp
.
- Calculate the inverse of
T
as iT
.
- Transform the solid geometry
SG
using iT
and compute its convex hull SG3
.
- 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))
.
- Transform the resulting contour back using
T
and remove straight lines using CVLremstraight
.
- 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