Syntax
[n,d]=VLFLcheckselfintersection(VL,FL,[csep])
Input Parameter
VL : | | Vertex list or SG |
FL : | | Facet List |
csep : | | separate solids before check {true,false}; default is false |
Output Parameter
n : | | number of facets |
d : | | facets list |
Examples
VLFLcheckselfintersection(SGsample(36))
VLofVLFLselfIntersection(SGsample(17),'',true)
VLofVLFLselfIntersection(SGsample(17),'',false)
Copyright 2018-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, VLFLcheckselfintersection
, is designed to check for self-intersecting facets in a 3D model represented by vertex and facet lists. It is part of the SolidGeometry library.
Input Parameters
- VL: Vertex List or Solid Geometry (SG) object. This is a list of vertices that define the 3D model.
- FL: Facet List. This is a list of facets (triangles) that define the surfaces of the 3D model.
- csep: A boolean parameter that indicates whether to separate solids before checking for intersections. The default value is
false
.
Output Results
- n: The number of self-intersecting facets found in the model.
- d: A list of the self-intersecting facets.
Algorithm Steps
- Initialize
csep
to false
. If a third argument is provided and is not empty, set csep
to that value.
- If
VL
is a Solid Geometry (SG) object, convert it to vertex and facet lists using VLFLofSG
.
- Call
VLofVLFLselfIntersection
with VL
, FL
, and csep
to find self-intersecting facets.
- Determine the number of self-intersecting facets,
n
, by counting the elements in d
. If d
is a cell array, use numel(d{:})
; otherwise, use numel(d)
.
- If no output arguments are specified, visualize the model:
- Create a new figure with
SGfigure
and set the view angle.
- Plot the model using
VLFLplot
with white color and set the plot light.
- If
d
is a cell, plot the self-intersecting facets using VLFLplot(VL,FL(d{:},:))
; otherwise, use VLFLplot(VL,FL(d,:))
.
- Print the number of self-intersecting facets to the console.
- Adjust the lighting with
camlightTL
.
Algorithm explaination created using ChatGPT on 2025-08-19 07:36. (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