MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / orient3dPoly

Function orient3dPoly

source/MRMesh/MRPrecisePredicates3.cpp:63–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61using Poly = SparsePolynomial<FastInt128, int, cMaxPolyD>;
62
63Poly orient3dPoly( const PointDegree & a, const PointDegree & b, const PointDegree & c, const PointDegree & d,
64 int dy ) // degree.x = ( degree.y = degree.z * dy ) * dy
65{
66 const int dx = dy * dy;
67
68 const Poly xx( a.pt.x - d.pt.x, a.d * dx, 1, d.d * dx, -1 );
69 const Poly xy( a.pt.y - d.pt.y, a.d * dy, 1, d.d * dy, -1 );
70 const Poly xz( a.pt.z - d.pt.z, a.d , 1, d.d , -1 );
71
72 const Poly yx( b.pt.x - d.pt.x, b.d * dx, 1, d.d * dx, -1 );
73 const Poly yy( b.pt.y - d.pt.y, b.d * dy, 1, d.d * dy, -1 );
74 const Poly yz( b.pt.z - d.pt.z, b.d , 1, d.d , -1 );
75
76 const Poly zx( c.pt.x - d.pt.x, c.d * dx, 1, d.d * dx, -1 );
77 const Poly zy( c.pt.y - d.pt.y, c.d * dy, 1, d.d * dy, -1 );
78 const Poly zz( c.pt.z - d.pt.z, c.d , 1, d.d , -1 );
79
80 Poly t;
81
82 t = yy * zz;
83 t -= yz * zy;
84 Poly det = xx * t;
85
86 t = yx * zz;
87 t -= yz * zx;
88 det -= xy * t;
89
90 t = yx * zy;
91 t -= yy * zx;
92 det += xz * t;
93
94 return det;
95}
96
97Int128 volume( const Vector3i & a, const Vector3i & b, const Vector3i & c, const Vector3i & d )
98{

Callers 1

segmentIntersectionOrderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected