CVLzreplace

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CVLz/Slices
Introduced first in SolidGeometry 4.9.1, Creation date: 2020-08-25, Last change: 2025-09-14

deletes or replaces a contour in a CVL stack

Description

slow help function that removes a contour of a defined height

See Also: CVLzaddauxpoints , CVLzofSGsliceauto , CVLzofSGslices , CVLzplotasCPS , CVLzplotui , CVLzremovearea , CVLzseparate , CVLzsweep

Example Illustration

 missing image of CVLzreplace(CVLz,z,CVLi)

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

CVL: Resulting CVLz

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

Output

Algorithm Steps

  1. Retrieve the optional parameter CVLi using getfuncparams. If not provided, it defaults to an empty array.
  2. If CVLi is a 2D array, add the specified height z to it using VLaddz.
  3. Separate the contours at the specified height z using CVLseparatez, which returns the separated contours and their indices.
  4. Check if CVLi is not empty:
  5. Concatenate the resulting contours to form the new stack CVL.
  6. 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