intersectcontour

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analyzing function
Introduced first in SolidGeometry 1.0, Creation date: 2012-07-29, Last change: 2025-09-14

returns from 3 points and a intersection matrix a Vertex list and Edge list

Description

The Vertex list has a 4th column explaining whether a point comes from inside or outside
The Facet list has e 3rd column explaining how many walls have been before this line

Example Illustration

 missing image of intersectcontour(TL,p1,p2,p3)

Syntax

[AVL,AEL]=intersectcontour(TL,p1,p2,p3)

Input Parameter

TL: Intersection matrix of a triangle p1p2p3
p1: Point 1
p2: Point 2
p3: Point 3

Output Parameter

AVL: Vertex list of the crossing points of the triangel
AEL: Edge list of the crossing points of the triangel




Copyright 2012-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, intersectcontour, is designed to compute the intersection points and edges of a triangle defined by three points (p1, p2, p3) and an intersection matrix (TL). The function returns a vertex list (AVL) and an edge list (AEL) of the crossing points of the triangle.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize an empty list AVL to store the vertices.
  2. Compute the intersection points between the edges of the triangle and the structure defined by TL using the helper function lsegment:
    • For edge p1-p2, use columns 2 and 8 of TL.
    • For edge p2-p3, use columns 3 and 9 of TL.
    • For edge p3-p1, use columns 4 and 10 of TL.
  3. Concatenate the results of each lsegment call to AVL.
  4. Reorder AVL to ensure the first row is the last vertex, followed by the rest.
  5. Compute SAVL by combining pairs of rows from AVL and summing their fourth columns.
  6. Update AVL with SAVL.
  7. Determine the number of vertices n and create an edge list AEL connecting consecutive vertices, closing the loop by connecting the last vertex to the first.
  8. Append the fourth column of AVL to AEL to indicate the number of walls before each line.
  9. Initialize a fourth column in AEL with zeros and update it to accumulate the number of walls.
  10. Reorder the fourth column of AEL to ensure continuity.
  11. Return the final AVL and AEL.
Algorithm explaination created using ChatGPT on 2025-08-19 01:33. (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