Syntax
PL=PLchamfer2side([z,x,sh,d])
Input Parameter
z : | | z or [z_left z-right] |
x : | | x or [x_left x-right] |
sh : | | shape or {shape_left, shape_right} |
d : | | delta or [delta_left delta-right] |
Output Parameter
PL : | | Point list for SGofCPLextrude |
Examples
PLchamfer2side(10,10,{'mattheck','circ'},[0 6])
PLchamfer2side(10,10,{'mattheck','line'},[0 6])
PLchamfer2side(10,10,{'mattheck','circ2'},[0 6])
PLchamfer2side(10,10,{'mattheck','circ3'},[0 6])
PLchamfer2side(10,10,{'circ3','mattheck'},[0 6])
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, PLchamfer2side
, is designed to create a point list for a two-sided chamfered polygon. It is part of the SolidGeometry library and is used for generating closed polygon lists.
Input Parameters
- z: This can be a single value or a two-element vector [z_left, z_right]. If a single value is provided, it is duplicated to form the vector.
- x: Similar to
z
, this can be a single value or a two-element vector [x_left, x_right]. A single value is duplicated.
- sh: This is the shape parameter, which can be a string or a cell array of two strings {shape_left, shape_right}. If a single string is provided, it is used for both sides.
- d: This is the delta parameter, which can be a single value or a two-element vector [delta_left, delta_right]. A single value is duplicated.
Algorithm Steps
- Retrieve and process input parameters using
getfuncparams
to ensure they are in the correct format (vectors or cell arrays).
- Call the
PLchamfer
function twice to generate point lists for the left and right sides using the respective parameters z(1)
, x(1)
, sh{1}
and z(2)
, x(2)
, sh{2}
.
- Check the orientation of the point lists
PL1
and PL2
. If necessary, flip them using flipud
to ensure a consistent order.
- Combine the two point lists into a single list
PL
by adjusting the positions with the delta values d(1)
and d(2)
.
- Remove duplicate rows from the combined point list
PL
while maintaining the order using unique
.
- If no output is requested, plot the resulting polygon using
SGfigure
and CPLplot
.
Output
The function returns a point list PL
that can be used for further processing in the SGofCPLextrude
function.
Algorithm explaination created using ChatGPT on 2025-08-19 07:32. (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