CVLzcut

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CVLz/Slices
Introduced first in SolidGeometry 5.1, Creation date: 2021-04-10, Last change: 2025-09-15

cuts out defined z levels

Description

ATTENTION: OUTPUT ORDER IS DIFFERENT TO SGcut !

See Also: CVLzflipud , CVLzplotasCPS , CVLzplotui

Example Illustration

 missing image of CVLzcut(CVL,z)

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

Output Results

Algorithm Steps

  1. Retrieve the z-levels from the input parameters using getfuncparams, with default values [0, inf].
  2. Extract unique z-levels from the CVL using unique and remove NaN values with woNaN.
  3. Determine which z-levels fall within the specified range [z1, z2] using logical indexing.
  4. Separate the z-levels into two groups: those within the range (zb) and those outside the range (za).
  5. Create CVLA by selecting rows from CVL where the z-coordinate is in zb.
  6. Create CVLB by selecting rows from CVL where the z-coordinate is in za.
  7. If the second z-level is not infinity, swap CVLA and CVLB using flipvar.
  8. 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