Syntax
CVL=CVLzreplace(CVLz,z,[CVLi])
Input Parameter
CVLz : | | Stack of CVLz |
z : | | desired z to be replaced |
CVLi : | | CPL or CVLz to be inserted |
Output Parameter
Examples
CVLzofSGslices(SGbox,3); CVLz=ans
CVLzreplace(CVLz,0)
CVLzreplace(CVLz,0,VLaddz(PLcircle(3),0))
CVLzreplace(CVLz,0,PLcircle(3))
Copyright 2020-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, CVLzreplace
, is designed to delete or replace a contour in a CVL stack. It is part of the SolidGeometry library and was introduced in version 5.0. The function takes in a stack of contours, a specific height, and optionally a contour to insert.
Input Parameters
- CVLz: A stack of contours (CVLz) that represents closed polygon lists.
- z: The desired height at which a contour is to be replaced or removed.
- CVLi: (Optional) A contour or stack of contours to be inserted at the specified height.
Output
- CVL: The resulting stack of contours after the specified operation.
Algorithm Steps
- Retrieve the optional parameter
CVLi
using getfuncparams
. If not provided, it defaults to an empty array.
- If
CVLi
is a 2D array, add the specified height z
to it using VLaddz
.
- Separate the contours at the specified height
z
using CVLseparatez
, which returns the separated contours and their indices.
- Check if
CVLi
is not empty:
- If not empty, replace the contours at the specified height with
CVLi
.
- If empty, remove the contours at the specified height.
- Concatenate the resulting contours to form the new stack
CVL
.
- If no output is requested, plot the original, inserted, and resulting contours using
CVLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:10. (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