by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.2, Creation date: 2022-05-07, Last change: 2025-09-15
CPLN=CPLremovethinwall([CPL,wall])
CPL: | CPL conotur | |
wall: | minimal wall thickness; default is 1.2 |
CPLN: | New Contour without thin walls |
CPL=CPLunion(PLsquare(40,40), PLsquare([30,50])+[36 0]);
CPL=CPLsubtract(CPLbuffer(CPLconvexhull(CPL),2),CPL);
CPLremovethinwall(CPL,0.5); % Wall remains
CPLremovethinwall(CPL,1); % Wall removed
CPLremovebuffer(CPLsample(21),3)
CPLremovebuffer(CPLsample(21),4)
CPLdullededges(CPLsample(21),3/2)
CPLdullededges(CPLsample(21),4/2)
This function, CPLremovethinwall, is designed to remove thin walls from a closed polygon list (CPL) to prevent them from breaking after printing or during use. It is part of the SolidGeometry library.
CPL and wall parameters from the input arguments using the getfuncparams function. If not provided, default values are used.CPLremovebuffer function with the CPL and wall as arguments. This function modifies the contour to eliminate walls thinner than the specified thickness.nargout==0), visualize the original and modified contours using the SGfigure and CPSplot functions. The original contour is plotted in red, and the modified contour is plotted in green.The function can be used in various scenarios to ensure that the resulting design does not have thin walls. For instance:
CPLremovebuffer and CPLdullededges to achieve desired design modifications.This function is particularly useful in automatic design processes where maintaining a minimum wall thickness is crucial for the structural integrity of the printed or manufactured object.
Algorithm explaination created using ChatGPT on 2025-08-19 07:35. (Please note: No guarantee for the correctness of this explanation)