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
- CPL: The contour to be extruded. It is the base shape that will be extended along the z-axis.
- z: The height for extrusion. It determines how far the CPL will be extended along the z-axis.
- ph: The scale of reduction, with a default value of 0.3 (30%). It controls the tapering or scaling of the contour as it is extruded.
- ed: A boolean indicating whether to round corners, with a default value of false. It affects the edge treatment of the extruded shape.
- shp: The shape type for the contour, such as 'circ', 'bezier', or 'mattheck'. It defines the profile of the contour along the z-axis.
Output Results
- SG: The final solid geometry resulting from the extrusion.
- SFLW: Surface facets of the wall of the extruded shape.
- SFLA: Surface facets of the floor of the extruded shape.
- SFLB: Surface facets of the ceiling of the extruded shape.
Algorithm Steps
- Retrieve input parameters using
getfuncparams
, with default values for each parameter if not provided.
- Correct the CPL to ensure it is counter-clockwise using
CPLisccwcorrected
.
- Convert the CPL to a polyline using
PLofCPL
.
- If the scale of reduction
ph
is less than or equal to 0, call SGofCPLz
to perform a simple extrusion.
- If
ph
is greater than 0, create a chamfered profile using PLchamfer
and iterate over the profile points to construct the extruded shape.
- For each segment of the profile, buffer the CPL to create inner contours and use
SGof2CPLsz
to generate the solid geometry between these contours.
- Translate each segment to its correct position along the z-axis using
SGtransP
.
- Combine the vertices and facets of each segment to form the complete solid geometry.
- 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:
SGofCPLzcontour(CPLsample(10))
SGofCPLzcontour(CPLsample(9))
SGofCPLzcontour(CPLsample(10)*100,500,1)
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