Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/ElmerGUI/netgen/libsrc/gprim/geomtest3d.hpp
3206 views
1
#ifndef FILE_GEOMTEST3D
2
#define FILE_GEOMTEST3D
3
4
/* *************************************************************************/
5
/* File: geomtest3d.hh */
6
/* Author: Joachim Schoeberl */
7
/* Date: 13. Feb. 98 */
8
/* *************************************************************************/
9
10
11
12
extern int
13
IntersectTriangleLine (const Point<3> ** tri, const Point<3> ** line);
14
15
16
17
/**
18
Returns 0, iff
19
closure (tet) cup closure (tri) is empty, one corner point of tet,
20
one edge of tet or one face of tet
21
*/
22
extern int
23
IntersectTetTriangle (const Point<3> ** tet, const Point<3> ** tri,
24
const int * tetpi = NULL, const int * tripi = NULL);
25
26
/**
27
Same test as above, but tet int reference position (0, ex, ey, ez),
28
tetpi = 1, 2, 4, 5
29
*/
30
extern int
31
IntersectTetTriangleRef (const Point3d ** tri, const int * tripi = NULL);
32
33
34
// 1, iff not regular triangulation
35
extern int
36
IntersectTriangleTriangle (const Point<3> ** tri1, const Point<3> ** tri2);
37
38
39
extern void
40
LocalCoordinates (const Vec3d & e1, const Vec3d & e2,
41
const Vec3d & v, double & lam1, double & lam2);
42
43
/// return 1 = degenerated sphere
44
extern int
45
CalcSphereCenter (const Point<3> ** pts, Point<3> & c);
46
47
/// return 1 = degenerated triangle
48
extern int
49
CalcTriangleCenter (const Point3d ** pts, Point3d & c);
50
51
52
53
/*
54
Compute radius of cylinder fitting 4 points.
55
cylinder axis is in the direction of p1-p2
56
*/
57
extern double ComputeCylinderRadius (const Point3d & p1, const Point3d & p2,
58
const Point3d & p3, const Point3d & p4);
59
60
/*
61
Two triangles T1 and T2 have normals n1 and n2.
62
The height over the common edge is h1, and h2.
63
Radius of cylinder fitting both triangles
64
*/
65
extern double ComputeCylinderRadius (const Vec3d & n1, const Vec3d & n2,
66
double h1, double h2);
67
68
69
extern double MinDistLP2 (const Point2d & lp1, const Point2d & lp2, const Point2d & p);
70
71
extern double MinDistLP2 (const Point3d & lp1, const Point3d & lp2, const Point3d & p);
72
73
extern double MinDistTP2 (const Point3d & tp1, const Point3d & tp2,
74
const Point3d & tp3, const Point3d & p);
75
76
extern double MinDistLL2 (const Point3d & l1p1, const Point3d & l1p2,
77
const Point3d & l2p1, const Point3d & l2p2);
78
79
80
#endif
81
82