CVLzflipud

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

flips z values for a CVLz

Description

THE ORIENTATION cw/ccw will not change by changing z values

See Also: CVLzsample

Example Illustration

 missing image of CVLzflipud(CVLz)

Syntax

CVLn=CVLzflipud(CVLz)

Input Parameter

CVLz: Original CVLz

Output Parameter

CVLn: CVLZ up and down

Examples


CVLzflipud(CVLzsample);




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, CVLzflipud, is designed to flip the z-values of a given 3D closed polygon list (CVLz) without altering the orientation (clockwise or counterclockwise) of the polygon.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the bounding box of the input polygon list CVLz using the function BBofVL. This function returns a vector bb where bb(5) and bb(6) represent the minimum and maximum z-values, respectively.
  2. Compute the height h of the bounding box as the difference between the maximum and minimum z-values: h = bb(6) - bb(5).
  3. Initialize CVLn as a copy of CVLz.
  4. For each point in CVLn, update the z-coordinate using the formula: CVLn(:,3) = (h - CVLz(:,3) - bb(5)) + bb(5). This effectively flips the z-values around the midpoint of the bounding box's z-range.
  5. If no output argument is specified (nargout == 0), plot the original and flipped polygons for visual comparison:
    • Use SGfigure to create a new figure window with a specified view angle.
    • In the first subplot, plot the flipped polygon CVLn using CVLzplot and label it as 'FLIPPED'.
    • In the second subplot, plot the original polygon CVLz and label it as 'ORIGINAL'.
Algorithm explaination created using ChatGPT on 2025-08-18 23:15. (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