[Bf-blender-cvs] [c66cfa01a9b] newboolean: Changes to master for this branch.
Howard Trickey
noreply at git.blender.org
Mon Dec 2 15:05:24 CET 2019
Commit: c66cfa01a9b2f49cf2b08ae61d5e52a0d5b89627
Author: Howard Trickey
Date: Mon Oct 7 06:51:56 2019 -0400
Branches: newboolean
https://developer.blender.org/rBc66cfa01a9b2f49cf2b08ae61d5e52a0d5b89627
Changes to master for this branch.
===================================================================
M source/blender/blenlib/BLI_math_base.h
M source/blender/blenlib/BLI_math_geom.h
M source/blender/blenlib/BLI_math_matrix.h
M source/blender/blenlib/BLI_math_vector.h
M source/blender/blenlib/intern/math_base_inline.c
M source/blender/blenlib/intern/math_geom.c
M source/blender/blenlib/intern/math_matrix.c
M source/blender/blenlib/intern/math_vector.c
M source/blender/blenlib/intern/math_vector_inline.c
M source/blender/bmesh/CMakeLists.txt
M source/blender/editors/mesh/editmesh_intersect.c
===================================================================
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 4f841f75d3a..8d9ac478298 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -218,6 +218,14 @@ double double_round(double x, int ndigits);
} \
(void)0
+# define BLI_ASSERT_UNIT_V3_DB(v) \
+ { \
+ const double _test_unit = len_squared_v3_db(v); \
+ BLI_assert(!(fabs(_test_unit - 1.0) >= BLI_ASSERT_UNIT_EPSILON) || \
+ !(fabs(_test_unit) >= BLI_ASSERT_UNIT_EPSILON)); \
+ } \
+ (void)0
+
# define BLI_ASSERT_UNIT_V2(v) \
{ \
const float _test_unit = len_squared_v2(v); \
@@ -255,6 +263,7 @@ double double_round(double x, int ndigits);
#else
# define BLI_ASSERT_UNIT_V2(v) (void)(v)
# define BLI_ASSERT_UNIT_V3(v) (void)(v)
+# define BLI_ASSERT_UNIT_V3_DB(v) (void)(v)
# define BLI_ASSERT_UNIT_QUAT(v) (void)(v)
# define BLI_ASSERT_ZERO_M3(m) (void)(m)
# define BLI_ASSERT_ZERO_M4(m) (void)(m)
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 4f8810d50e1..8a6fe40b857 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -42,6 +42,7 @@ extern "C" {
/********************************** Polygons *********************************/
float normal_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]);
+double normal_tri_v3_db(double r[3], const double a[3], const double b[3], const double c[3]);
float normal_quad_v3(
float r[3], const float a[3], const float b[3], const float c[3], const float d[3]);
float normal_poly_v3(float r[3], const float verts[][3], unsigned int nr);
@@ -126,6 +127,7 @@ float dist_to_plane3_v3(const float p[3], const float plane[4]);
float dist_squared_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
float dist_to_line_segment_v3(const float p[3], const float l1[3], const float l2[3]);
float dist_squared_to_line_v3(const float p[3], const float l1[3], const float l2[3]);
+double dist_squared_to_line_v3_db(const double p[3], const double l1[3], const double l2[3]);
float dist_to_line_v3(const float p[3], const float l1[3], const float l2[3]);
float dist_signed_squared_to_corner_v3v3v3(const float p[3],
const float v1[3],
@@ -196,6 +198,10 @@ double closest_to_line_v2_db(double r_close[2],
const double l1[2],
const double l2[2]);
float closest_to_line_v3(float r_close[3], const float p[3], const float l1[3], const float l2[3]);
+double closest_to_line_v3_db(double r_close[3],
+ const double p[3],
+ const double l1[3],
+ const double l2[3]);
void closest_to_line_segment_v2(float r_close[2],
const float p[2],
const float l1[2],
@@ -207,6 +213,9 @@ void closest_to_line_segment_v3(float r_close[3],
void closest_to_plane_normalized_v3(float r_close[3], const float plane[4], const float pt[3]);
void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[3]);
void closest_to_plane3_normalized_v3(float r_close[3], const float plane[3], const float pt[3]);
+void closest_to_plane3_normalized_v3_db(double r_close[3],
+ const double plane[3],
+ const double pt[3]);
void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt[3]);
/* Set 'r' to the point in triangle (t1, t2, t3) closest to point 'p' */
@@ -227,6 +236,11 @@ float line_point_factor_v3_ex(const float p[3],
const float l2[3],
const float epsilon,
const float fallback);
+double line_point_factor_v3_ex_db(const double p[3],
+ const double l1[3],
+ const double l2[3],
+ const double epsilon,
+ const double fallback);
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3]);
float line_point_factor_v2_ex(const float p[2],
@@ -302,12 +316,25 @@ int isect_line_line_epsilon_v3(const float v1[3],
float i1[3],
float i2[3],
const float epsilon);
+int isect_line_line_epsilon_v3_db(const double v1[3],
+ const double v2[3],
+ const double v3[3],
+ const double v4[3],
+ double i1[3],
+ double i2[3],
+ const double epsilon);
int isect_line_line_v3(const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3],
float r_i1[3],
float r_i2[3]);
+int isect_line_line_v3_db(const double v1[3],
+ const double v2[3],
+ const double v3[3],
+ const double v4[3],
+ double r_i1[3],
+ double r_i2[3]);
bool isect_line_line_strict_v3(const float v1[3],
const float v2[3],
const float v3[3],
@@ -351,6 +378,10 @@ bool isect_plane_plane_v3(const float plane_a[4],
const float plane_b[4],
float r_isect_co[3],
float r_isect_no[3]) ATTR_WARN_UNUSED_RESULT;
+bool isect_plane_plane_v3_db(const double plane_a[4],
+ const double plane_b[4],
+ double r_isect_co[3],
+ double r_isect_no[3]) ATTR_WARN_UNUSED_RESULT;
/* line/ray triangle */
bool isect_line_segment_tri_v3(const float p1[3],
@@ -491,6 +522,10 @@ bool isect_aabb_aabb_v3(const float min1[3],
const float max1[3],
const float min2[3],
const float max2[3]);
+bool isect_aabb_aabb_v3_db(const double min1[3],
+ const double max1[3],
+ const double min2[3],
+ const double max2[3]);
struct IsectRayAABB_Precalc {
float ray_origin[3];
@@ -771,6 +806,7 @@ float form_factor_hemi_poly(
void axis_dominant_v3_to_m3_negate(float r_mat[3][3], const float normal[3]);
void axis_dominant_v3_to_m3(float r_mat[3][3], const float normal[3]);
+void axis_dominant_v3_to_m3_db(double r_mat[3][3], const double normal[3]);
MINLINE void axis_dominant_v3(int *r_axis_a, int *r_axis_b, const float axis[3]);
MINLINE float axis_dominant_v3_max(int *r_axis_a,
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 814b13fa47f..5c58c47736b 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -218,6 +218,7 @@ bool invert_m3_m3_ex(float m1[3][3], const float m2[3][3], const float epsilon);
bool invert_m3(float R[3][3]);
bool invert_m3_m3(float R[3][3], const float A[3][3]);
+bool invert_m3_m3_db(double R[3][3], const double A[3][3]);
bool invert_m4(float R[4][4]);
bool invert_m4_m4(float R[4][4], const float A[4][4]);
bool invert_m4_m4_fallback(float R[4][4], const float A[4][4]);
@@ -233,6 +234,7 @@ void mul_m3_v3_db(const double M[3][3], double r[3]);
/****************************** Linear Algebra *******************************/
void transpose_m3(float R[3][3]);
+void transpose_m3_db(double R[3][3]);
void transpose_m3_m3(float R[3][3], const float A[3][3]);
void transpose_m3_m4(float R[3][3], const float A[4][4]);
void transpose_m4(float R[4][4]);
@@ -269,12 +271,14 @@ bool is_uniform_scaled_m4(const float m[4][4]);
*/
void adjoint_m2_m2(float R[2][2], const float A[2][2]);
void adjoint_m3_m3(float R[3][3], const float A[3][3]);
+void adjoint_m3_m3_db(double R[3][3], const double A[3][3]);
void adjoint_m4_m4(float R[4][4], const float A[4][4]);
float determinant_m2(float a, float b, float c, float d);
float determinant_m3(
float a, float b, float c, float d, float e, float f, float g, float h, float i);
float determinant_m3_array(const float m[3][3]);
+double determinant_m3_array_db(const double m[3][3]);
float determinant_m4_mat3_array(const float m[4][4]);
float determinant_m4(const float A[4][4]);
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 9fbd0227b7e..c7f50c3c7be 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -76,6 +76,8 @@ MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
/* double */
MINLINE void zero_v3_db(double r[3]);
+MINLINE void zero_v4_db(double r[4]);
+MINLINE void copy_v3_db(double r[3], double d);
MINLINE void copy_v2_v2_db(double r[2], const double a[2]);
MINLINE void copy_v3_v3_db(double r[3], const double a[3]);
MINLINE void copy_v4_v4_db(double r[4], const double a[4]);
@@ -109,6 +111,7 @@ MINLINE void add_v2_v2v2_int(int r[2], const int a[2], const int b[2]);
MINLINE void add_v3_v3(float r[3], const float a[3]);
MINLINE void add_v3_v3_db(double r[3], const double a[3]);
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]);
+MINLINE void add_v3_v3v3_db(double r[3], const double a[3], const double b[3]);
MINLINE void add_v4_v4(float r[4], const float a[4]);
MINLINE void add_v4_v4v4(float r[4], const float a[4], const float b[4]);
@@ -132,7 +135,9 @@ MINLINE void mul_v2_fl(float r[2], float f);
MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f);
MINLINE void mul_v3_fl(float r[3], float f);
MINLINE void mul_v3db_db(double r[3], double f);
+MINLINE void mul_v3db_db(double r[3], double f);
MINLINE void mul_v3_v3fl(floa
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list