CPLremovebuffer

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.2, Creation date: 2022-03-15, Last change: 2025-09-15

just removes thin walls from CPLS (same as CPLdullededges)

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: CPLbuffer , CPLremovearea , CPLdullededges

Example Illustration

 missing image of CPLremovebuffer(CPL,wall)

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

Output

Algorithm Steps

  1. The function begins by determining the wall thickness using the getfuncparams function. If the wall parameter is not provided, it defaults to 1.2.
  2. The variable d is calculated as half of the wall thickness.
  3. 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.
  4. After buffering, the function calls CPLremstraightAmin on the resulting contour to further refine the shape by removing straight segments that are too small.
  5. 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:

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