Syntax
CPLN=CPLremovebuffer(CPL,[wall])
Input Parameter
CPL : | | CPL conotur |
wall : | | minimal wall thickness |
Output Parameter
CPLN : | | New Contour without CPLwall |
Examples
CPLremovebuffer(CPLsample(21),3)
CPLremovebuffer(CPLsample(21),4)
CPLdullededges(CPLsample(21),3/2)
CPLdullededges(CPLsample(21),4/2)
Copyright 2022-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, CPLremovebuffer
, is designed to remove thin walls from closed polygon lists (CPLs) to prevent them from breaking after printing or during use. It is part of the SolidGeometry library.
Input Parameters
- CPL: The contour of the closed polygon list that needs processing.
- wall: The minimal wall thickness, which is optional. If not provided, a default value of 1.2 is used.
Output
- CPLN: The new contour without thin walls.
Algorithm Steps
- The function begins by determining the wall thickness using the
getfuncparams
function. If the wall
parameter is not provided, it defaults to 1.2.
- The variable
d
is calculated as half of the wall thickness.
- The function then calls
CPLbuffer
twice: first with a negative buffer of -d
and then with a positive buffer of d
. This effectively removes thin walls by buffering inwards and then outwards.
- After buffering, the function calls
CPLremstraightAmin
on the resulting contour to further refine the shape by removing straight segments that are too small.
- If no output argument is specified, the function plots the original and modified contours using
SGfigure
and CPSplot
. The original contour is plotted in red, and the modified contour is plotted in green.
Example Usage
Examples of how to use the function include:
CPLremovebuffer(CPLsample(21),3)
CPLremovebuffer(CPLsample(21),4)
CPLdullededges(CPLsample(21),3/2)
CPLdullededges(CPLsample(21),4/2)
Algorithm explaination created using ChatGPT on 2025-08-19 00:34. (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