Syntax
NCVL=CVLinsertT(CVL,T)
Input Parameter
Output Parameter
NCVL : | | NCVL matrix with crosing points with the xy plane |
Examples
CVLinsertT(VLsample(8),TofP([2 4 5]))
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
Algorithm (Workflow)
This function, CVLinsertT
, is designed to insert crossing points of a Contour Vertex List (CVL) with a transformation matrix (T) into the original CVL. The function is part of the SolidGeometry library and was introduced to handle cases where a CVL is intersected by planes defined by the T matrix.
Input Parameters
- CVL: A matrix representing the Contour Vertex List.
- T: A transformation matrix used to define planes for intersection.
Output
- NCVL: A matrix containing the original CVL with additional crossing points where the CVL intersects the xy plane.
Algorithm Steps
- Transform the CVL using the inverse of the T matrix with the function
VLtransT
.
- Separate the transformed CVL into segments using
separateNaN
.
- Calculate the difference between each point and its subsequent point using
circshift
and store it in DVL
.
- Initialize an empty matrix
NCVL
to store the new CVL with crossing points.
- Iterate over each point in the transformed CVL:
- Add the current point to
NCVL
.
- Check for sign changes in the x, y, and z coordinates between consecutive points to detect crossings:
- If a crossing is detected, calculate the intersection point using linear interpolation and add it to
NCVL
.
- Transform the updated
NCVL
back using the T matrix.
- Round the values in
NCVL
using rounddiv
to handle numerical precision issues.
- Remove successive identical points from
NCVL
using VLremsuccident
.
- If no output is requested, plot the original and modified CVL using
SGfigure
and CVLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:16. (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