SGofCPLflat

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.6, Creation date: 2019-06-12, Last change: 2025-09-14

returns a SG struct of an open flat surface from a polyshape or closed polygon

Description

This function does not create a watertight solid geometry but only a surface of the shape of the polygon!
It used when a polyshape surface should be drawn in space

See Also: PLFLofCPLdelaunay

Example Illustration

 missing image of SGofCPLflat(CPL,T)

Syntax

SGofCPLflat(CPL,[T])

Input Parameter

CPL: Closed Polygon or Polyshape
T: vector, rotation matrix, or HT matrix to locate the surface in space

Examples


SGofCPLflat(PLstar(30),[0 0 10])
SGofCPLflat(PLsquare(30),rot(pi/3))
SGofCPLflat(PLsquare(30),rot(pi/3,-pi/3,-pi/3))
SGofCPLflat(CPLsample(12),rot(pi/3,-pi/3,-pi/3))




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, SGofCPLflat, generates a surface geometry (SG) structure from a closed polygon or polyshape. It is designed to create a flat surface representation of the polygon in space, rather than a solid, watertight geometry.

Input Parameters

Algorithm Steps

  1. Parameter Handling: The function begins by extracting the transformation parameter T from the variable input arguments using getfuncparams. If T is not provided, it defaults to an empty array.
  2. Polygon Conversion: If CPL is not numeric, it is converted to a closed polygon list using CPLofCPS.
  3. Polygon and Face List Generation: The function PLFLofCPLdelaunay is called to generate a point list (PL) and a face list (FL) from the closed polygon.
  4. Vertex List Creation: The vertex list (VL) is created by adding a z-coordinate to the point list using VLaddz.
  5. Surface Geometry Struct Creation: The surface geometry structure SG is initialized with the vertex list and face list.
  6. Transformation Application: If a transformation T is provided, it is applied to the surface geometry using SGtrans.
  7. Visualization: If no output is requested, the function visualizes the surface geometry using SGfigure and SGplot, setting the view and lighting for better visualization.

Example Usage

Algorithm explaination created using ChatGPT on 2025-08-19 00:52. (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