Syntax
[CVLA,CVLB]=CVLzcut(CVL,[z])
Input Parameter
CVL : | | Original CVLz |
z : | | [z1] for z1..top or [z1 z2] for z1..z2 |
Output Parameter
CVLA : | | Upper Part or niddle part |
CVLB : | | Lower Part and Upper part |
Examples
CVLzcut(CVLzsample(2),[0 15])
Copyright 2021-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, CVLzcut
, is designed to cut a 3D closed polygon list (CVL) at specified z-levels. It is part of the SolidGeometry library and was introduced in version 5.1. The function takes a CVL and a z-level or range of z-levels as input and outputs two parts of the CVL based on the specified z-levels.
Input Parameters
- CVL: The original closed polygon list, which is a matrix where each row represents a point in 3D space, with the third column representing the z-coordinate.
- z: A vector specifying the z-levels for cutting. It can be a single value [z1] to cut from z1 to the top, or a range [z1 z2] to cut between z1 and z2.
Output Results
- CVLA: The upper or middle part of the CVL, depending on the specified z-levels.
- CVLB: The lower part and upper part of the CVL, depending on the specified z-levels.
Algorithm Steps
- Retrieve the z-levels from the input parameters using
getfuncparams
, with default values [0, inf].
- Extract unique z-levels from the CVL using
unique
and remove NaN values with woNaN
.
- Determine which z-levels fall within the specified range [z1, z2] using logical indexing.
- Separate the z-levels into two groups: those within the range (zb) and those outside the range (za).
- Create
CVLA
by selecting rows from CVL where the z-coordinate is in zb
.
- Create
CVLB
by selecting rows from CVL where the z-coordinate is in za
.
- If the second z-level is not infinity, swap
CVLA
and CVLB
using flipvar
.
- If no output arguments are specified, plot the results using
SGfigure
, CVLzplotasCPS
, and CVLzplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:33. (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