Syntax
[PL,FL]=PLFLofCPLpoly(CPL)
Input Parameter
Output Parameter
PL : | | Point list |
FL : | | Facet list |
Examples
PL=PLcircseg(10,[],-pi/6,pi)
[VL,FL]=PLFLofCPLpoly(PL); VLFLplot (VL,FL); % Minimal points used
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, PLFLofCPLpoly
, is designed to process a list of contour points (CPL) and generate a point list (PL) and a facet list (FL) for 2D geometrical shapes. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- CPL: A list of contour points. It is a 2D array where each row represents a point with x and y coordinates.
Output Results
- PL: A list of points generated from the contour points.
- FL: A list of facets (triangles) that define the shape.
Algorithm Steps
- Check if the input
CPL
is empty. If it is, return empty PL
and FL
.
- Ensure the contour points are in clockwise order using
ispolycw
and poly2cw
. This is important for consistent facet orientation.
- Use the
poly2fv
function to convert the contour points into a facet list (FL
) and a point list (PL
).
- Check the orientation of the facets using
sizePLFL
. If any facet has a negative orientation, flip the order of the second and third points in those facets to correct the orientation.
- If no output arguments are specified, plot the generated points and facets using
VLFLplot
within a new figure window.
Example Usage
An example is provided where a circular segment is created using PLcircseg
, and then processed by PLFLofCPLpoly
to generate and plot the points and facets.
Algorithm explaination created using ChatGPT on 2025-08-19 01: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