CPLremconvexcorner

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

remove single convex corners from the contour

Description

In case of swept volumes often there aris corners from the cutting out squres on a circluar path

See Also: CPLsweep , CPLsweepTL , CPLunionTL , CPLsubtractTL

Example Illustration

 missing image of CPLremconvexcorner(CPL)

Syntax

CPLN=CPLremconvexcorner(CPL)

Input Parameter

CPL: Contour

Output Parameter

CPLN: contour with removed corners

Examples


CPLremconvexcorner(PLstar(10))




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, CPLremconvexcorner, is designed to remove single convex corners from a contour represented as a Closed Polygon List (CPL). The function is part of the SolidGeometry library and was introduced to handle issues arising from corners created when cutting squares on a circular path.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize CPLN as a copy of the input CPL.
  2. Determine the number of separate contours in CPL using separateNaN.
  3. Iterate over each contour segment:
  4. If no output is requested, plot the original and modified contours for visual comparison.

Example Usage

The function can be called with a contour generated by PLstar(10) to demonstrate its effect on a star-shaped polygon.

Algorithm explaination created using ChatGPT on 2025-08-19 06:52. (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