SGisidentical

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.8, Creation date: 2019-10-21, Last change: 2025-09-14

try to compare two solids to find equality as fast as possible

Description

Two solids are identical if
- they have the same number of facets
- the difference of the area lists of all facets is near zero

Major changes und bug fixes:
SGLib 5.4 handles also empty solids

See Also: SGisconvex , SGisInterior

Example Illustration

 missing image of SGisidentical(SGA,SGB)

Syntax

[fdiff,TBA,TAB]=SGisidentical(SGA,SGB)

Input Parameter

SGA: Solid A; or a file name for a solid
SGB: Solid B; or a file name for a solid

Output Parameter

fdiff: true if identical or false if not
TBA: HT matrix to transfer B into the coordinate system of A
TAB: HT matrix to transfer A into the coordinate system of B

Examples


loadweb JACO_robot.mat
SGisidentical(JCF,SGtransR(JCF,rot(pi/3,pi/2,pi/6)))

fname=SGwriteSTL(JC1,'JC1_tmp'), SGisidentical(JC1,fname)
fname=SGwriteSTL(JC2,'JC2_tmp'), SGisidentical(JC1,fname)

A=SGbox; B=SGtransT(SGtetramesh(A),TofPez([10 10 10],[-1 -1 1]));
SGfigure(-30,30); SGplotalpha(A,'r','','r'); SGplotalpha(B,'g','','g');
SGisidentical(A,SGremsurfedgepoints(B))




Copyright 2019-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

Last html export of this page out of FM database by TL: 2025-09-21