csgofPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.0, Creation date: 2017-07-26, Last change: 2025-09-14

returns MATLAB's Constructed Solid Geometry (CSG) dg matrix for a list of polygons

Description

TIP: Currently I do not see an advantage to use csg Constructed Solid Geometry (CSG) instead of boundary Representation (BREP) which is the foundation of the SG-Lib. Nevertheless, an interface should exist.

Matlab supports for 2D geometries the method Constructed Solid Geometries (CSG) Decompositon already before 2006a. This function converts a Point List into a csg or gd (Geometric Description Matrix).
It is possible either to convert a PL into the 2D csg format for one polygon or
It is possible to convert a cell list of Polygon plus a string formular into a geoemetric matrix.
Currently the first polygon is "A", the second "B" and so on.
The Formula is a string of Type "A+B" or "A-B" "A*B" or "A" or "B".

See Also:

Example Illustration

 missing image of csgofPL(PL,sf)

Syntax

[csg,bt]=csgofPL(PL,[sf])

Input Parameter

PL: CPL of cell list of CPLs
sf: Formula wrt. to A polygon sequence 'A' 'B' 'C' etc.

Output Parameter

csg: or dg (Geometry description matrix)
bt:

Examples


csgofPL(PLstar(10)); % returns matlab's CSG polygon list format
csgofPL({PLstar(10)},'A') % returns the geometry list of 1st Polygon
csgofPL({PLcircle(4);PLcircle(2)+2},'A')
csgofPL({PLcircle(4);PLcircle(2)+2},'B')
csgofPL({PLcircle(4);PLcircle(2)+2},'A+B')
csgofPL({PLcircle(4);PLcircle(2)+2},'A-B')




Copyright 2017-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

Last html export of this page out of FM database by TL: 2025-09-21