MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / is_colinear_3D

Method is_colinear_3D

tools/MeshUtils/FaceUtils.cpp:20–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20bool FaceUtils::is_colinear_3D(
21 const Vector3F& v0,
22 const Vector3F& v1,
23 const Vector3F& v2) {
24 exactinit();
25 double v0_xy[2] = {v0[0], v0[1]};
26 double v1_xy[2] = {v1[0], v1[1]};
27 double v2_xy[2] = {v2[0], v2[1]};
28
29 double v0_yz[2] = {v0[1], v0[2]};
30 double v1_yz[2] = {v1[1], v1[2]};
31 double v2_yz[2] = {v2[1], v2[2]};
32
33 double v0_zx[2] = {v0[2], v0[0]};
34 double v1_zx[2] = {v1[2], v1[0]};
35 double v2_zx[2] = {v2[2], v2[0]};
36
37 bool colinear_xy = orient2d(v0_xy, v1_xy, v2_xy) == 0;
38 bool colinear_yz = orient2d(v0_yz, v1_yz, v2_yz) == 0;
39 bool colinear_zx = orient2d(v0_zx, v1_zx, v2_zx) == 0;
40 return colinear_xy && colinear_yz && colinear_zx;
41}
42
43std::vector<size_t> FaceUtils::get_degenerated_faces(
44 const MatrixFr& vertices, const MatrixIr& faces) {

Callers 1

is_colinearFunction · 0.80

Calls 2

exactinitFunction · 0.85
orient2dFunction · 0.85

Tested by

no test coverage detected