TRofCPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.7, Creation date: 2019-07-24, Last change: 2025-09-14

just returns a 2D triangulation

Description

same as delaunay triangulation
[PL,EL]=PLELofCPL(CPL); TR2=delaunayTriangulation(PL,EL);


See Also: , VLFLofCPL

Example Illustration

 missing image of TRofCPL(CPL)

Syntax

TR2=TRofCPL(CPL)

Input Parameter

CPL: CLosed Polygon list

Output Parameter

TR2: 2D Triangulation

Examples


TRofCPL(CPLsample(16))




Copyright 2019-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, TRofCPL, is designed to perform a 2D triangulation of a closed polygon list (CPL). It is part of the SG-Library and was introduced in SolidGeometry 4.7 by Tim Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by calling PLELofCPL(CPL), which processes the closed polygon list (CPL) to generate two outputs:
    • PL: A list of points that define the vertices of the polygon.
    • EL: A list of edges that connect the points in the polygon.
  2. Next, the function uses the delaunayTriangulation function with the points list (PL) and edges list (EL) to create a 2D triangulation object, TR2.
  3. If no output is requested (i.e., nargout==0), the function proceeds to visualize the triangulation:
    • It opens a new figure using SGfigure and sets the view to a top-down perspective with view(0,90).
    • The function plots the triangulation using VLFLplot, displaying the points and connectivity list of the triangulation.
    • It identifies the interior triangles using isInterior(TR2) and plots them in green.
    • Annotations are added to the plot to distinguish between the triangulation (red), interior triangles (green), and the original closed polygon (blue).
    • The original closed polygon is plotted in blue with a line width of 4 using CPLplot.

Example Usage

The function can be called with a sample closed polygon list, such as TRofCPL(CPLsample(16)), to perform and visualize the triangulation.

Algorithm explaination created using ChatGPT on 2025-08-18 23:41. (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