Syntax
[T,X,n]=TPL(PL)
Input Parameter
PL : | | Point list or vertex list |
Output Parameter
T : | | Transformation for Backtransformation |
X : | | Vertex list of transformed vertices |
n : | | length of vertex list |
Examples
UL=ULgenerate (VL,FL); % Generate a union/patch list
PFL=FLofUL(UL,nr); % Take all facets of patch 1
PVL=VL(PFL,:); % Make a list of vertices
[T,XL]=TPL(PVL); % NOW TRANSFORM
[GPL,ng]=VLGraham(XL); % Calculate Graham
Y=(T*[GPL ones(size(GPL,1),1)]')'; GPL=Y(:,1:3) % Tranform back
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, TPL, is designed to compute the homogeneous transformation matrix for the center of a patch defined by a list of vertices. It is part of the SolidGeometry library.
Input Parameters
- PL: A point list or vertex list. It is expected to be an Nx3 matrix where N is the number of vertices.
Output Results
- T: The transformation matrix for backtransformation.
- X: The vertex list of transformed vertices.
- n: The number of vertices in the list.
Algorithm Steps
- Check if the input PL has more than 3 columns. If so, transpose it to convert it into a vertex list (VL).
- Calculate the number of vertices,
n
, and the central point cp
of the vertex list by averaging the coordinates.
- Subtract the central point from all vertex points to center the vertex list around the origin.
- Compute a weight vector
w
using the modulated arctangent of the vertex coordinates.
- Find unique values in
w
and their indices using the unique
function.
- Select two points,
p1
and p2
, from the vertex list using the indices from the unique operation.
- Compute the transformation matrix
T
using the function Tof3P
with the origin and the two selected points. Set the translation part of T
to the central point cp
.
- Transform the original point list
PL
using the inverse of T
to get the transformed vertex list X
.
- If no output is requested, plot the original and transformed vertex lists using
SGfigure
and VLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 08:02. (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