CPLdistancewall

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

returns the minimal wall thickness between 2 CPLs or a region



See Also: VLnearestNeighbor

Example Illustration

 missing image of CPLdistancewall(CPLo,CPLi)

Syntax

[wmin,wmax]=CPLdistancewall([CPLo,CPLi])

Input Parameter

CPLo: Outer CPL
CPLi: Innver CPL

Output Parameter

wmin: maximal wall thickness
wmax: maximal wall thickness

Examples


CPL=CPLsample(3)*3; w=2; CPL=CPLsubtract(CPL,CPLbuffer(CPL,-w)); SGofCPLz(CPL,50); SG=ans;
CPLdistancewall(CPL)




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 calculates the minimal and maximal wall thickness between two closed polygon lists (CPLs), which represent the outer and inner contours of a region.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the outer CPL (CPLo) and inner CPL (CPLi) from the input parameters. If CPLi is not provided, determine it using the function CPLselectinout.
  2. Sample both CPLo and CPLi equidistantly using PLofCPLequidistant with np points.
  3. Calculate the nearest neighbor distances between the sampled points of CPLi and CPLo using VLnearestNeighbor.
  4. Determine the minimal (wmin) and maximal (wmax) distances from the calculated nearest neighbor distances.
  5. If no output arguments are specified, plot the results:
    • Display the detected wall thickness range.
    • Plot the outer and inner CPLs using different colors.
    • Highlight points on the CPLs where the wall thickness is minimal and maximal.
Algorithm explaination created using ChatGPT on 2025-08-19 08:01. (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