SGofCPLzcontour

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 4.7, Creation date: 2019-06-26, Last change: 2025-09-14

extrudes a CPL into a Solid Geometry modifying the CPL along z using a contour shape


Use carefully: The 'SGofCPLzcontour' function has not yet been extensively tested


See Also: PLchamfer , SGof2CPLsz , SGofCPLz , SGofCPLz

Example Illustration

 missing image of SGofCPLzcontour(CPL,z,ph,ed,shp);

Syntax

[SG,SFLW,SFLA,SFLB]=SGofCPLzcontour([CPL,z,ph,ed,shp]);

Input Parameter

CPL: Contour to extrude
z: height for extrusion
ph: scale of reduction ; default is 0.3 = 30%
ed: round corners; default is false
shp: such as 'circ', bezier' ,'mattheck'; see PLchamfer for strings

Output Parameter

SG: Final Solid Geometry
SFLW: Surface facets of the wall
SFLA: Surface facets of the floor
SFLB: Surface facets of the ceiling

Examples


SGofCPLzcontour(CPLsample(10))
SGofCPLzcontour(CPLsample(9))
SGofCPLzcontour(CPLsample(10)*100,500,1)




Copyright 2019-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, SGofCPLzcontour, is designed to extrude a Contour Polyline (CPL) into a solid geometry by modifying the CPL along the z-axis using a contour shape. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve input parameters using getfuncparams, with default values for each parameter if not provided.
  2. Correct the CPL to ensure it is counter-clockwise using CPLisccwcorrected.
  3. Convert the CPL to a polyline using PLofCPL.
  4. If the scale of reduction ph is less than or equal to 0, call SGofCPLz to perform a simple extrusion.
  5. If ph is greater than 0, create a chamfered profile using PLchamfer and iterate over the profile points to construct the extruded shape.
  6. For each segment of the profile, buffer the CPL to create inner contours and use SGof2CPLsz to generate the solid geometry between these contours.
  7. Translate each segment to its correct position along the z-axis using SGtransP.
  8. Combine the vertices and facets of each segment to form the complete solid geometry.
  9. If no output arguments are specified, plot the resulting solid geometry with different colors for the floor, wall, and ceiling facets.

Example Usage

Examples of how to call the function with different parameters:

Algorithm explaination created using ChatGPT on 2025-08-18 18:54. (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