Syntax
SG=SGofCPLzchamfer([CPL,z,ph,ed]);
Input Parameter
CPL : | | Closed Polygon line |
z : | | Height z |
ph : | | phase default is 0.3 |
ed : | | curved edges; default is true |
Output Parameter
Examples
SGofCPLchamfer([CPLsample(21);NaN NaN;PLcircle(5)],10)
SGofCPLzchamfer(CPLsample(12),10)
Copyright 2017-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, SGofCPLzchamfer, generates a solid with chamfered edges based on a closed polygon line (CPL) and other parameters. Below is a detailed explanation of the algorithm and its parameters:
Input Parameters
- CPL: A closed polygon line that defines the base shape of the solid. If not provided, a default circle is used.
- z: The height of the solid. Default is 10 mm.
- ph: The phase or chamfer depth. Default is 0.3 mm.
- ed: A boolean indicating whether the edges should be curved. Default is true.
Algorithm Steps
- Initialize default values for CPL, z, ph, and ed if they are not provided as input arguments.
- If ph is zero, call the function SGofCPLz to create a solid without chamfering and return.
- If CPL is a scalar, convert it to a circle using PLcircle.
- Ensure the CPL is correctly oriented using CPLofPL.
- If ph is greater than zero, proceed with chamfering:
- Determine regions in CPL using PSregions.
- If multiple regions exist, iterate over each region, create a chamfered solid for each, and store them in a cell array.
- For a single region, calculate the outer contour with chamfer using CPLoutercontour and CPLgrow.
- Create three parts of the solid using SGof2CPLsz: A (top chamfer), B (middle section), and C (bottom chamfer).
- Align parts B and C on top of A using SGtransrelSG.
- Concatenate vertex and face lists from parts A, B, and C using VLFLcat2.
- Shorten the vertex and face lists to remove duplicates using VLFLshort2.
- If no output is requested, plot the solid using SGfigure and SGplotalpha.
Output
The function returns a solid (SG) with chamfered edges based on the input CPL and parameters.
Algorithm explaination created using ChatGPT on 2025-08-18 18:52. (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