[T,UVL,UFL]=TofVLUL(VL,UL,i)
VL : | Vertex list | |
UL : | Union list | |
i : | Size index of union (1st, 2nd, etc) |
T : | HT Matrix, centred | |
UVL : | Union vertex list | |
UFL : | Union facet list |
Stamp the date on the 2nd larges union of an object
[TVL,TFL]=VLFLtext('MMXII-V-II');
UL=ULgenerate(VL,FL,800)
T=TofVLUL(VL,UL,2);
[VL,FL]= VLFLcat(VL,FL,VLtransT(VLtrans0(TVL),T),TFL);
This algorithm is designed to compute the homogeneous transformation (HT) matrix for the origin of a union area in a 3D space. It is part of the SolidGeometry library and is used to attach an object to a plane automatically.
FLofUL(UL, i)
to obtain the facet list UFL
and the normal vector ez
for the specified union.VLshort(VL, UFL)
to extract the relevant vertices for the union, resulting in UVL
.T
using TofVL(UVL)
, which calculates the HT matrix based on the eigenvectors of the vertex list.T
(the z-axis) is aligned with the negative of ez
. If so, invert the rotation part of T
to correct the orientation.T
is upright using Tupright(T)
, which adjusts the orientation to a standard upright position.This algorithm is useful for aligning objects in 3D space by computing a transformation matrix that positions and orients the object correctly relative to a specified union area.
Algorithm explaination created using ChatGPT on 2025-08-19 07:46. (Please note: No guarantee for the correctness of this explanation)