Blender V2.61 - r43446
|
#include <math.h>
#include <float.h>
#include "MT_Point3.h"
#include "MT_Plane3.h"
Go to the source code of this file.
Definition in file BOP_MathUtils.h.
#define VAR_EPSILON |
Definition at line 44 of file BOP_MathUtils.h.
MT_Point3 BOP_4PointIntersect | ( | const MT_Point3 & | p0, |
const MT_Point3 & | p1, | ||
const MT_Point3 & | p2, | ||
const MT_Point3 & | q | ||
) |
Pre: p0, p1 and p2 is a triangle and q is an interior point.
p0 | point |
p1 | point |
p2 | point |
q | point |
v = P1-P2 w = P3-Q r0(t) = v*t+P1 r1(t) = w*t+P3 I = r0^r1
Definition at line 438 of file BOP_MathUtils.cpp.
References BOP_intersect(), I, simple_enum_gen::w, MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
Definition at line 55 of file BOP_MathUtils.h.
References fabs().
Returns if p1 is between p2 and p3 and lay on the same line (are collinears).
p1 | point |
p2 | point |
p3 | point |
Definition at line 141 of file BOP_MathUtils.cpp.
References BOP_collinear(), distance(), and MT_Point3::distance().
Classifies a point according to the specified plane with EPSILON accuracy.
p | point |
plane | plane |
Definition at line 366 of file BOP_MathUtils.cpp.
References BOP_comp0(), and MT_Plane3::signedDistance().
Referenced by BOP_concave(), BOP_convex(), BOP_overlap(), BOP_splitFace(), and BOP_BSPNode::testPoint().
Returns if three points lay on the same line (are collinears).
p1 | point |
p2 | point |
p3 | point |
Definition at line 154 of file BOP_MathUtils.cpp.
References BOP_comp(), BOP_fuzzyZero(), MT_Vector3::cross(), MT_Vector3::normalize(), simple_enum_gen::w, MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
Referenced by BOP_between(), BOP_mergeVertexs(), and clean_nonmanifold().
Compares two scalar triplets with EPSILON accuracy.
A | scalar triplet |
B | scalar triplet |
Definition at line 86 of file BOP_MathUtils.cpp.
References BOP_comp(), BOP_EPSILON(), MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
Compares two scalars with EPSILON accuracy.
A | scalar |
B | scalar |
Definition at line 44 of file BOP_MathUtils.cpp.
References BOP_EPSILON().
Referenced by BOP_collinear(), BOP_comp(), BOP_getNearestVertex(), BOP_isInsideCircle(), and BOP_BBox::intersect().
int BOP_comp0 | ( | const MT_Scalar | A | ) |
Compares a scalar with EPSILON accuracy.
A | scalar |
Definition at line 73 of file BOP_MathUtils.cpp.
References BOP_EPSILON().
Referenced by BOP_classify(), and BOP_fuzzyZero().
int BOP_concave | ( | const MT_Point3 & | p1, |
const MT_Point3 & | p2, | ||
const MT_Point3 & | p3, | ||
const MT_Point3 & | p4 | ||
) |
Returns if a quad (coplanar) is concave and where is the split edge.
Definition at line 198 of file BOP_MathUtils.cpp.
References BOP_classify(), and MT_Vector3::cross().
Referenced by BOP_splitQuad().
Returns if a plane contains a point with EPSILON accuracy.
plane | plane |
point | point |
Definition at line 409 of file BOP_MathUtils.cpp.
References BOP_fuzzyZero(), and MT_Plane3::signedDistance().
Referenced by BOP_Face2Face(), BOP_removeOverlappedFaces(), and BOP_sew().
bool BOP_convex | ( | const MT_Point3 & | p1, |
const MT_Point3 & | p2, | ||
const MT_Point3 & | p3, | ||
const MT_Point3 & | p4 | ||
) |
Returns if a quad (coplanar) is convex.
Definition at line 176 of file BOP_MathUtils.cpp.
References BOP_classify(), and MT_Vector3::cross().
const MT_Scalar BOP_EPSILON | ( | 9.3132257461547852e- | 10 | ) |
Referenced by BOP_comp(), and BOP_comp0().
Pre: p0, p1 and q are collinears.
p0 | point |
p1 | point |
q | point |
(p0)-----(q)------------(p1) |<-d1-->| | |<---------d0---------->|
Definition at line 461 of file BOP_MathUtils.cpp.
References BOP_fuzzyZero(), simple_enum_gen::d, and MT_Point3::distance().
Compares two scalars strictly.
A | scalar |
B | scalar |
Definition at line 111 of file BOP_MathUtils.cpp.
Compares two scalar strictly.
A | scalar triplet |
B | scalar triplet |
Definition at line 123 of file BOP_MathUtils.cpp.
References MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
bool BOP_fuzzyZero | ( | MT_Scalar | x | ) | [inline] |
Definition at line 59 of file BOP_MathUtils.h.
References BOP_comp0().
Referenced by BOP_collinear(), BOP_containsPoint(), BOP_EpsilonDistance(), BOP_intersect(), and BOP_mergeSort().
bool BOP_getCircleCenter | ( | const MT_Point3 & | p1, |
const MT_Point3 & | p2, | ||
const MT_Point3 & | p3, | ||
const MT_Point3 & | center | ||
) |
bool BOP_intersect | ( | const MT_Vector3 & | vL1, |
const MT_Point3 & | pL1, | ||
const MT_Vector3 & | vL2, | ||
const MT_Point3 & | pL2, | ||
MT_Point3 & | intersection | ||
) |
Computes the intersection between two lines (on the same plane).
vL1 | first line vector |
pL1 | first line point |
vL2 | second line vector |
pL2 | second line point |
intersection | intersection point (if exists) |
Definition at line 225 of file BOP_MathUtils.cpp.
References BOP_fuzzyZero(), MT_Tuple3::setValue(), MT_Tuple3::x(), MT_Tuple3::y(), and MT_Tuple3::z().
Referenced by BOP_4PointIntersect(), and BOP_getCircleCenter().
MT_Point3 BOP_intersectPlane | ( | const MT_Plane3 & | plane, |
const MT_Point3 & | p1, | ||
const MT_Point3 & | p2 | ||
) |
Intersects a plane with the line that contains the specified points.
plane | split plane |
p1 | first line point |
p2 | second line point |
Definition at line 379 of file BOP_MathUtils.cpp.
References MT_Tuple3::setValue(), MT_Tuple4::w(), MT_Tuple3::x(), MT_Tuple4::x(), MT_Tuple3::y(), MT_Tuple4::y(), MT_Tuple3::z(), and MT_Tuple4::z().
Referenced by BOP_BSPNode::addFace(), BOP_splitEdge(), BOP_BSPNode::classifyFace(), and BOP_BSPNode::splitTriangle().
bool BOP_isInsideCircle | ( | const MT_Point3 & | p1, |
const MT_Point3 & | p2, | ||
const MT_Point3 & | p3, | ||
const MT_Point3 & | p4, | ||
const MT_Point3 & | p5 | ||
) |
Returns if points p4 or p5 is inside the circle defined by p1, p2 and p3.
p1 | point |
p2 | point |
p3 | point |
p4 | point |
p5 | point |
Definition at line 333 of file BOP_MathUtils.cpp.
References BOP_comp(), BOP_getCircleCenter(), and MT_Point3::distance().
bool BOP_isInsideCircle | ( | const MT_Point3 & | p1, |
const MT_Point3 & | p2, | ||
const MT_Point3 & | p3, | ||
const MT_Point3 & | q | ||
) |
Returns if points q is inside the circle defined by p1, p2 and p3.
p1 | point |
p2 | point |
p3 | point |
q | point |
Definition at line 307 of file BOP_MathUtils.cpp.
References BOP_comp(), BOP_getCircleCenter(), simple_enum_gen::d, and MT_Point3::distance().
Referenced by BOP_getTriangleVertex(), BOP_isInsideCircle(), BOP_splitQuad(), BOP_triangulateC(), and BOP_BSPNode::classifyFace().
Returns if two planes share the same orientation.
Definition at line 352 of file BOP_MathUtils.cpp.
References MT_Tuple4::x(), MT_Tuple4::y(), and MT_Tuple4::z().
Referenced by BOP_Face2Face(), BOP_sew(), BOP_splitQuad(), and BOP_BSPNode::hasSameOrientation().
int BOP_sign | ( | MT_Scalar | x | ) | [inline] |
Definition at line 52 of file BOP_MathUtils.h.