CPLremovethinwall

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

just removes thin walls from CPLS same as CPLdullededges and CPLremovebuffer

Description

Used in automatic design function to avoid thin walls that will break after printing or in use
same as CPLN=CPLbuffer(CPLbuffer(CPL,-d),d);


See Also: CPLremovebuffer , CPLdullededges , CPLremovearea

Example Illustration

 missing image of CPLremovethinwall(CPL,wall)

Syntax

CPLN=CPLremovethinwall([CPL,wall])

Input Parameter

CPL: CPL conotur
wall: minimal wall thickness; default is 1.2

Output Parameter

CPLN: New Contour without thin walls

Examples


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)




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, 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.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the CPL and wall parameters from the input arguments using the getfuncparams function. If not provided, default values are used.
  2. Remove thin walls by calling the CPLremovebuffer function with the CPL and wall as arguments. This function modifies the contour to eliminate walls thinner than the specified thickness.
  3. If no output is requested (i.e., 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.

Example Usage

The function can be used in various scenarios to ensure that the resulting design does not have thin walls. For instance:

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)

Last html export of this page out of FM database by TL: 2025-09-21