Syntax
CVL=CVLzofSGsliceauto(SG,[dz])
Input Parameter
SG : | | Solid Geometry |
dz : | | minimal z change; default is soBB(SG)/50 |
Output Parameter
CVL : | | Closed Vertex List of all z values |
Examples
SGreadSTL; A=ans; SGrotateservo(A); B=ans
CVLzofSGsliceauto(B);
Copyright 2018-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, CVLzofSGsliceauto
, is designed to process a Solid Geometry (SG) object and return a Closed Vertex List (CVL) of all z values that have a significant distance between them. The function is part of the SG-Library and was introduced in SolidGeometry version 4.4.
Input Parameters
- SG: This is the Solid Geometry object that the function will process. It represents the 3D model or shape that is being analyzed.
- dz: This is an optional parameter that specifies the minimal change in the z-direction that is considered significant. If not provided, the default value is calculated as the bounding box size of the SG object divided by 50.
Output Results
- CVL: The function returns a Closed Vertex List, which is a list of all z values that have a significant distance between them, based on the provided or default
dz
value.
Function Workflow
- The function begins by calling
CPLofSGsliceauto
with the provided SG object and any additional arguments. This function processes the SG object to determine the slices based on the z values.
- The result from
CPLofSGsliceauto
is a tuple, and the second element of this tuple is assigned to CVL
.
- If no output is requested (i.e.,
nargout==0
), the function proceeds to visualize the SG object and the resulting CVL:
- It calls
SGfigure
to create a new figure window.
- It sets the view angle to (-30, 30) for better visualization.
- It plots the SG object using
SGplot
and adjusts the lighting with setplotlight
.
- Finally, it plots the CVL using
CVLplot
with a specific style ('.-').
Example Usage
An example of how to use this function is provided in the comments:
SGreadSTL; A=ans; SGrotateservo(A); B=ans
CVLzofSGsliceauto(B);
This example reads an STL file, rotates the resulting SG object, and then calls CVLzofSGsliceauto
to process it.
Algorithm explaination created using ChatGPT on 2025-08-18 23:39. (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