TregisterConvexHull
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 3.4, Creation date: 2017-02-24, Last change: 2025-09-14
returns the registration matrix based on the convex hull of the vertices
Description
This function is just a simple function for registering voxel models with their original Solid Geoemtry
Example Illustration
Syntax
T=TregisterConvexHull(VLA,VLB)
Input Parameter
VLA: | | Vertex list A or Solid A |
VLB: | | Vertex list B or Solid B |
Output Parameter
T: | | Transformation from B into A |
Examples
Show the result of a random geoemtry
T=TofR(rot(pi/3,pi,6,pi/9,[10 10 10])), inv(T), VL=rand(10,3);
TregisterConvexHull(VL,VLtransT(VL,T))
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, TregisterConvexHull, is designed to register voxel models with their original solid geometry using the convex hull of the vertices. It calculates a transformation matrix that aligns two sets of vertices, VLA and VLB.
Input Parameters
- VLA: Vertex list A or Solid A. This is the first set of vertices or the first solid geometry.
- VLB: Vertex list B or Solid B. This is the second set of vertices or the second solid geometry.
Output
- T: Transformation matrix that aligns VLB to VLA.
Algorithm Steps
- Convert the vertex lists VLA and VLB into transformation matrices and solid geometries using the function
TofVL. This results in TA and SGA for VLA, and TB and SGB for VLB.
- Calculate the transformation matrix
T by dividing TA by TB. This operation effectively aligns the two sets of vertices.
- If no output is requested (i.e.,
nargout==0), visualize the result:
- Open a new figure using
SGfigure and set the view angle to (-30, 30).
- Set the color and transparency of
SGA to red and 0.5, respectively.
- Set the color and transparency of
SGB to white and 0.5, respectively.
- Plot
SGA and SGB using SGplot.
- Transform
SGB using the transformation matrix T to get SGC, set its color to green and transparency to 0.3, and plot it.
- Convert
VLB to a vertex list using VLofSG.
- Transform
VLB using VLtransT and plot the result in green using VLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 00:03. (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