Syntax
CVLn=CVLzflipud(CVLz)
Input Parameter
Output Parameter
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
- CVLz: The original 3D closed polygon list, where each row represents a point in 3D space with x, y, and z coordinates.
Output Results
- CVLn: The modified 3D closed polygon list with flipped z-values.
Algorithm Steps
- 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.
- Compute the height
h
of the bounding box as the difference between the maximum and minimum z-values: h = bb(6) - bb(5)
.
- Initialize
CVLn
as a copy of CVLz
.
- 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.
- 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