40#ifndef GEOGRAM_NUMERICS_EXACT_GEOMETRY
41#define GEOGRAM_NUMERICS_EXACT_GEOMETRY
94 ) : x(x_in), y(y_in), w(w_in) {
101 ) : x(x_in), y(y_in), w(w_in) {
105 x(rhs.x), y(rhs.y), w(rhs.w) {
109 x(rhs.x), y(rhs.y), w(rhs.w) {
113 x(rhs.x), y(rhs.y), w(1.0) {
134 expansion_nt* data() {
138 const expansion_nt* data()
const {
191 ) : x(x_in), y(y_in), z(z_in), w(w_in) {
199 ) : x(x_in), y(y_in), z(z_in), w(w_in) {
207 ) : x(x_in), y(y_in), z(z_in), w(w_in) {
211 x(rhs.x), y(rhs.y), z(rhs.z), w(rhs.w) {
215 x(rhs.x), y(rhs.y), z(rhs.z), w(rhs.w) {
219 x(rhs.x), y(rhs.y), z(rhs.z), w(1.0) {
242 expansion_nt* data() {
246 const expansion_nt* data()
const {
277 vec2HE GEOGRAM_API
operator-(
const vec2HE& p1,
const vec2HE& p2);
279 vec3HE GEOGRAM_API
operator-(
const vec3HE& p1,
const vec3HE& p2);
365 template <
class T>
inline bool same_point(
369 return (v1.x == v2.x) && (v1.y == v2.y) && (v2.z == v1.z);
372 template <
class T>
inline bool same_point(
376 return (v1.x == v2.x) && (v1.y == v2.y);
379 bool GEOGRAM_API same_point(
const vec2HE& v1,
const vec2HE& v2);
380 bool GEOGRAM_API same_point(
const vec3HE& v1,
const vec3HE& v2);
382 Sign GEOGRAM_API orient_2d(
386 Sign GEOGRAM_API orient_2d_projected(
393 Sign GEOGRAM_API orient_3d(
398 Sign GEOGRAM_API dot_2d(
423 double h0,
double h1,
double h2,
double h3
426 Sign GEOGRAM_API orient_2dlifted_SOS_projected(
429 double h0,
double h1,
double h2,
double h3,
442 template <
class VEC3>
444 typedef typename VEC3::value_type value_type;
445 return VEC3(value_type(p.x),value_type(p.y),value_type(p.z));
455 template <
class VEC3 = vec3>
457 typedef typename VEC3::value_type value_type;
459 value_type(p2.x) - value_type(p1.x),
460 value_type(p2.y) - value_type(p1.y),
461 value_type(p2.z) - value_type(p1.z)
484 template <
class VEC2>
488 typedef typename VEC2::value_type value_type;
490 value_type(p2.x) - value_type(p1.x),
491 value_type(p2.y) - value_type(p1.y)
514 template <
class VEC3>
519 make_vec3<VEC3>(p1,p2),
520 make_vec3<VEC3>(p1,p3)
#define geo_debug_assert(x)
Verifies that a condition is met.
Common include file, providing basic definitions. Should be included before anything else by all head...
Expansion_nt (expansion Number Type) is used to compute the sign of polynoms exactly.
void optimize()
Optimizes the internal representation without changing the represented value.
Rational_nt (rational Number Type) is used to compute the sign of rational fractions exactly.
Comparator class for vec3HE \detail Used to create maps indexed by vec3HE.
bool operator()(const vec2HE &v1, const vec2HE &v2) const
Compares two vec3HE.
Comparator class for vec3HE \detail Used to create maps indexed by vec3HE.
bool operator()(const vec3HE &v1, const vec3HE &v2) const
Compares two vec3HE.
Comparator class for projected vec3HE.
bool operator()(const vec3HE &v1, const vec3HE &v2) const
Compares two vec3HE.
High-level interface to multi-precision arithmetics.
Geometric functions in 2d and 3d.
Sign orient_2dlifted_SOS(const vec2HE &p0, const vec2HE &p1, const vec2HE &p2, const vec2HE &p3, double h0, double h1, double h2, double h3)
Computes the 3d orientation test with lifted points.
Global Vorpaline namespace.
expansion_nt det(const vec2E &v1, const vec2E &v2)
Specialization optimized using low-level API.
Quaternion operator-(const Quaternion &a, const Quaternion &b)
Computes the difference between two Quaternion.
T dot(const vecng< 3, T > &v1, const vecng< 3, T > &v2)
Computes the dot product of 2 vectors. vecng
vecng< 2, expansion_nt > vec2E
vec2 with coordinates as expansions
vecng< 3, Numeric::float64 > vec3
Represents points and vectors in 3d.
vec3E make_vec3< vec3E >(const vec3 &p1, const vec3 &p2)
Specialization for vec3E.
VEC3 make_vec3(const vec3 &p)
Converts a 3d vector with double coordinates into a 3d vector with coordinates of arbitrary type.
vec2E make_vec2< vec2E >(const vec2 &p1, const vec2 &p2)
Specialization for vec2E.
Sign
Integer constants that represent the sign of a value.
bool get_three_planes_intersection(vec3HE &result, const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &q1, const vec3 &q2, const vec3 &q3, const vec3 &r1, const vec3 &r2, const vec3 &r3)
Computes the exact intersection between the support planes of three triangles.
VEC2 make_vec2(const vec2 &p1, const vec2 &p2)
Creates a vector with coordinates of arbitrary type from two points with double coordinates.
vec3E triangle_normal< vec3E >(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Specialization for vec3E.
vecng< 2, Numeric::float64 > vec2
Represents points and vectors in 2d.
geo_coord_index_t coord_index_t
The type for storing coordinate indices, and iterating on the coordinates of a point.
vec3HE plane_line_intersection(const vec3 &p1, const vec3 &p2, const vec3 &p3, const vec3 &q1, const vec3 &q2)
Computes the exact intersection between the support plane of a triangle and the support line of a seg...
VEC3 triangle_normal(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Computes the normal to a triangle from its three vertices.
vecng< 3, expansion_nt > vec3E
vec3 with coordinates as expansions
coord_index_t triangle_normal_axis_exact(const vec3 &p1, const vec3 &p2, const vec3 &p3)
Finds an axis along which a triangle can be projected without degeneracy.
2D vector in homogeneous coordinates with coordinates as arithmetic expansions
vec2HE()
Creates an uninitialized vec2HE.
void optimize()
Optimizes the internal storage of the expansions used to store the coordinates.
3D vector in homogeneous coordinates with coordinates as arithmetic expansions.
void optimize()
Optimizes the internal storage of the expansions used to store the coordinates.
vec3HE()
Creates an uninitialized vec3HE.