cross2F

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analyzing function
Introduced first in SolidGeometry 1.0, Creation date: 2012-07-17, Last change: 2025-09-14

Fundamental fnct of generating the intersection points of two triangles

Description

Triangle [p1, p2, p3] intrudes triangle [pa pb pc]. The function generates a list of intersection points for p1p2 p2p3 p3p1 and papb pbpc pcpa. In addition, for p1p2 p2p3 p3p1 it is calculated whether the facet normal of papbpc, is opposite of p1p2 etc. In other words if the dotproduct is negative, the edge p1p2 etc. enters the body of papbpc.
Handling of planar situations added in SG-Lib 4.9 by introducing n and tx
Planar Situation does not only create one crossing point per line but it creates crossing edges which require a complex new Delaunay triangualation.
This function will change for SGbool6 and SGbool7

See Also: crossingfacets2VLFL , intersectstriangle , SGintersectFacetPoints , VLsampletriangles

Example Illustration

 missing image of cross2F(p1,p2,p3,pa,pb,pc)

Syntax

[t,n,tx]=cross2F(p1,p2,p3,pa,pb,pc)

Input Parameter

p1: Point 1 of intersecting triangle A
p2: Point 2 of intersecting triangle A
p3: Point 3 of intersecting triangle A
pa: Point 1 of intersected triangle B
pb: Point 2 of intersected triangle B
pc: Point 3 of intersected triangle B

Output Parameter

t: d1 d2 d3 da db dc n1 n2 n3 na nb nc
n: n=0; n=-1 => planar problem; opposite facets; n=+1 => planar problem; same facets;
tx: planar case; [x y z k1 k2 e1 ea]

Examples


VLA=[0 0 0; 7 7 0; -7 7 0]; VLB=[-4 2 0; 4 2 0; 0 10 0]; FLA=[3 2 1]; FLB=[1 2 3];
[v1,v2,v3,~,~,~,bba]=VLDLBBofVLFL(VLA,FLA);
[va,vb,vc,~,~,~,bbb]=VLDLBBofVLFL(VLB,FLB);
[a,b,c]=cross2F(va,vb,vc,v1,v2,v3) % Planar situation c is used, a = not used;

VLA=[0 0 1; 7 7 0; -7 7 0]; VLB=[-4 2 0; 4 2 0; 0 10 0]; FLA=[3 2 1]; FLB=[1 2 3];
[v1,v2,v3,~,~,~,bba]=VLDLBBofVLFL(VLA,FLA);
[va,vb,vc,~,~,~,bbb]=VLDLBBofVLFL(VLB,FLB);
[a,b,c]=cross2F(va,vb,vc,v1,v2,v3) % Standard situation b is zero, c is not used




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

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