CPLfit

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

fits a contour or a point list into a polygon

Description

will be renamed

See Also: , CPLfitinCPLrot , CPLfitinCPLscale

Example Illustration

 missing image of CPLfit(CPLA,CPLB,buff,points)

Syntax

[CPLN,mb,f]=CPLfit(CPLA,CPLB,[buff,points])

Input Parameter

CPLA: Outside shape of a contour
CPLB: Contour to fit in or Point list for circles
buff: buffer for contour or buffer or point list
points: if true CPLB is used as point list for circles

Output Parameter

CPLN: Contour or Point list that fits
mb: relative shift
f: scaling factor

Examples


CPLfit(CPLsample(3),PLsquare(1000)) % fit in
CPLfit(CPLsample(3),PLsquare(1000),1) % fit in with a border
CPLfit(CPLsample(3),PLsquare(1000),1,true) % fit in for drilling holes




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

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