CPLofPLFL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.1, Creation date: 2014-01-08, Last change: 2025-09-14

returns a polybool contour from PL and each edge of FL

Description

This function generates 4 points plus a NaN for each facet of FL.
if 3rd parameter is true it converts a surface into a CPL.

See Also: CPLofPLEL

Example Illustration

 missing image of CPLofPLFL(PL,FL,bound)

Syntax

CPL=CPLofPLFL(PL,FL,[bound])

Input Parameter

PL: Point list
FL: Facet list
bound: if true; the boundaries are

Output Parameter

CPL: Contour point list

Examples

Create a CPL from a planar tesselated surface
[PL,FL]=PLFLofCPLdelaunay(CPLsample(11));
CPLofPLFL(PL,FL)
CPLofPLFL(PL,FL,true)




Copyright 2014-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, CPLofPLFL, generates a contour point list (CPL) from a given point list (PL) and facet list (FL). It is part of the SolidGeometry library and was introduced to handle planar tessellated surfaces.

Input Parameters

Output

Algorithm Steps

  1. Initialize the bound variable to false. If a third argument is provided and is not empty, set bound to the value of this argument.
  2. If bound is false:
    • Determine the number of facets, n, from the size of FL.
    • Initialize a zero matrix PLT with dimensions n*5 by 2 to store the contour points.
    • Iterate over each facet in FL:
      • For each facet, append its points from PL to PLT, followed by the first point of the facet and a NaN NaN row to separate facets.
    • Assign PLT (excluding the last row) to CPL.
  3. If bound is true:
    • Use the freeBoundary function to find the edges and new points list (EL and NPL) of the triangulation defined by FL and PL.
    • Call CPLofPLEL with NPL and EL to generate CPL.
  4. If no output is requested (nargout==0):
    • Create a new figure and set the view to top-down (0,90).
    • Plot the facets using VLFLplot in red and add lighting with VLFLplotlight.
    • Plot the contour points CPL in blue with markers.
Algorithm explaination created using ChatGPT on 2025-08-19 06:43. (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