Syntax
[CPLF,CPLX]=CPLfindsmalldist(CPL,[z])
Input Parameter
CPL : | | Closed Contour |
z : | | minimalcontour thickness; default is 0.5mm |
Output Parameter
CPLF : | | Lost Contours; if empty, the contour has no problems |
CPLX : | | Remaining Contour; |
Examples
CPLfindsmalldist(PLstar(10,'','','','',.5),2);
CPLfindsmalldist(PLstar(10,'','','','',.5),1);
CPLfindsmalldist(PLgearDIN(.1,80));
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, CPLfindsmalldist
, is designed to identify areas of a closed polygon list (CPL) that have a small wall distance to the opposite contour. It is part of the SolidGeometry library.
Input Parameters
- CPL: A closed contour represented as a list of points.
- z: The minimal contour thickness, with a default value of 0.5 mm. This parameter is optional and can be specified by the user.
Output Results
- CPLF: The lost contours, which are areas of the CPL that have a small wall distance. If this is empty, the contour has no problems.
- CPLX: The remaining contour after removing the lost contours.
Algorithm Steps
- The function begins by determining the value of
z
using the getfuncparams
function. If z
is not provided, it defaults to 0.5 mm. The value of z
is then halved.
- The function applies a buffer operation on the CPL using the
CPLbuffer
function. It first shrinks the CPL by -z
and then expands it back by z
. This results in a modified contour, CPLR
.
- The function calculates the lost contours,
CPLF
, by performing a boolean subtraction between the original CPL and the modified contour CPLR
using the CPLbool
function.
- The remaining contour,
CPLX
, is determined by subtracting a buffered version of CPLF
(with a small buffer of 0.001) from the original CPL.
- If no output arguments are specified, the function plots the results using the
CPSplot
function. The lost contours are plotted in red, and the remaining contours are plotted in green.
Algorithm explaination created using ChatGPT on 2025-08-19 00:49. (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