Syntax
[OVEL,UVEL,AEL]=lsegment(p1,p2,t)
Input Parameter
p1 : | | Starting point of an edge |
p2 : | | End point of an edge |
t : | | list of points: [p=p1+t*(p2-p1) , direction] |
Output Parameter
OVEL : | | Edge list of an outer contour |
UVEL : | | Edge list of an inner contour |
AEL : | | Complete contour line |
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 algorithm is designed to compute all supporting points of a line segment, including the start and end points, based on a given list of parameterized points. The function is named lsegment
and is part of the SG-Library, specifically categorized under auxiliary procedures.
Input Parameters
- p1: The starting point of the line segment.
- p2: The ending point of the line segment.
- t: A list of parameterized points, where each point is defined as
p = p1 + t * (p2 - p1)
and includes a direction component.
Output Results
- AVEL: The complete contour line, which includes all supporting points of the line segment.
Algorithm Steps
- Remove duplicate rows from
t
using unique(t, 'rows')
.
- Determine the number of points
nt
in t
.
- If the last point in
t
has an infinite parameter, remove it and decrement nt
.
- If
nt
is zero, initialize t
with default points [0 0; 1 0]
and set nt
to 2.
- Ensure the last point in
t
has a parameter of 1. If not, append [1 0]
to t
and increment nt
.
- Ensure the first point in
t
has a parameter of 0. If not, prepend [0 0]
to t
and increment nt
.
- Initialize an empty array
AVEL
to store the contour line points.
- Iterate over the points in
t
in steps of 2:
- If the current index
i
is less than or equal to nt-1
, compute the supporting points for the segment between t(i)
and t(i+1)
and append them to AVEL
.
- If the current index
i
is less than or equal to nt-2
, compute the supporting points for the segment between t(i+1)
and t(i+2)
and append them to AVEL
.
Algorithm explaination created using ChatGPT on 2025-08-18 23:17. (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