Syntax
SG=SGofCPLzseparated(CPL,hl)
Input Parameter
CPL : | | CPL |
hl : | | sorted list for height in CPL |
Output Parameter
Examples
SGofCPLzseparated(CPLsample(11),[7 8 3 9])
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, SGofCPLzseparated
, is designed to create individual solid geometries for each closed contour in a given Contour Polyline (CPL) with specified heights. It ensures that no holes are created, which is necessary for certain editor functions.
Input Parameters
- CPL: The Contour Polyline, which is a set of points defining closed contours.
- hl: A sorted list of heights corresponding to each contour in the CPL.
Output
- SG: The resulting Solid Geometry, which is a combination of individual solids created for each contour.
Algorithm Steps
- Determine the number of contours,
nc
, using the separateNaN
function, which separates contours based on NaN values in the CPL.
- Determine the number of heights,
nh
, from the length of the hl
list.
- If there is only one height provided, replicate it for all contours.
- Check if the number of contours matches the number of heights. If not, raise an error.
- Initialize an empty Solid Geometry,
SG
.
- Iterate over each contour:
- Select the current contour using
selectNaN
.
- If
slot
is zero, create a solid for the contour using SGofCPLz
with the corresponding height.
- If
slot
is not zero, adjust the contour using CPLbuffer
and then create the solid.
- Color the faces of the solid using
SGcolorfaces
with a color determined by colofn
.
- Concatenate the new solid to the existing Solid Geometry using
SGcat2
.
- If no output is requested, plot the Solid Geometry using
SGfigure
and SGplotalpha
with a specified view angle and transparency.
- If output is requested, color the faces of the Solid Geometry white.
Algorithm explaination created using ChatGPT on 2025-08-18 18:53. (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