closedCPL

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

closes all contours in CPL(2D) and CVL(3D) without any other change beside removal of all consecutive identical point before


Use carefully: The 'closedCPL' function has not yet been extensively tested

Description

new speed optimized function of 2025 to replace CPLofPL in future
It removes all consecutive identical points and adds the first as last again
concept same as VLremsuccident
ii=vecnormr(CPLi-circshift(CPLi,-1))>lim; OCPLi=CPLi(ii,:);


See Also: PLofCPL , CPLofPL , openedCPL , openedCVL , closedCVL

Example Illustration

 missing image of closedCPL(CPL,lim)

Syntax

NCPL=closedCPL(CPL,[lim])

Input Parameter

CPL: Contour 2D or 3D with NaN embedded contours
lim: default is 1e-12 for removal of succeding points

Output Parameter

NCPL: New contours 2D/3D with all closed contours without any consecutive identical point

Examples


closedCPL(PLofCPL(CPLsample(47))) % 2D case
closedCPL(VLaddz(CPLsample(47))) % 3D case
closedCPL(VLaddz(openedCPL(CPLsample(47)))) % 3D case with opening before




Copyright 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

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