From 4cf9a55341a299236344c4d8e31fb76c89200395 Mon Sep 17 00:00:00 2001 From: Denis Haumont Date: Wed, 22 May 2024 17:00:51 +0200 Subject: [PATCH] Fix compilation and initialization issues --- visilib/math_plane_3.h | 4 ++-- visilib/math_plucker_6.h | 13 +++++++++++++ visilib/math_vector_2.h | 5 ++++- visilib/math_vector_3.h | 5 ++++- visilib/plucker_polytope_splitter.h | 7 +++++-- 5 files changed, 28 insertions(+), 6 deletions(-) diff --git a/visilib/math_plane_3.h b/visilib/math_plane_3.h index 3b29bb7..5167f64 100644 --- a/visilib/math_plane_3.h +++ b/visilib/math_plane_3.h @@ -61,10 +61,10 @@ namespace visilib if (MathArithmetic::getAbs(r) > epsilon) { - return MathPlane3d(myNormal, -myNormal.dot(v0)); + return MathPlane3_(myNormal, -myNormal.dot(v0)); } V_ASSERT(0); - return MathPlane3d::Zero(); + return MathPlane3_::Zero(); } static bool computeTrianglePlane(MathPlane3_ & aPlane, MathVector3_ * aTriangeVertices, S epsilon) diff --git a/visilib/math_plucker_6.h b/visilib/math_plucker_6.h index f9ff8b5..1f1050e 100644 --- a/visilib/math_plucker_6.h +++ b/visilib/math_plucker_6.h @@ -74,6 +74,19 @@ namespace visilib V_ASSERT(MathArithmetic::isFinite(getLocation())); } + /**@brief Construct a plucker point from a 3D line defined by two points*/ + MathPlucker6(const MathVector3f& aBegin, const MathVector3f& anEnd) + { + MathVector3_ myBegin = convert>(aBegin); + MathVector3_ myEnd = convert>(anEnd); + + mDirection = myEnd - myBegin; + mLocation = MathVector3_::cross(myBegin, myEnd); + + V_ASSERT(MathArithmetic::isFinite(getDirection())); + V_ASSERT(MathArithmetic::isFinite(getLocation())); + } + /**@brief Subtract another point in Plucker space*/ MathPlucker6& operator -= (const MathPlucker6& v) { diff --git a/visilib/math_vector_2.h b/visilib/math_vector_2.h index a2ada47..b327cf5 100644 --- a/visilib/math_vector_2.h +++ b/visilib/math_vector_2.h @@ -106,7 +106,10 @@ namespace visilib x *= inv; y *= inv; } - + else + { + x=y=0.0; + } return d; } MathVector2_ getNormalized() const diff --git a/visilib/math_vector_3.h b/visilib/math_vector_3.h index fad5814..aa7e463 100644 --- a/visilib/math_vector_3.h +++ b/visilib/math_vector_3.h @@ -170,7 +170,10 @@ namespace visilib y *= inv; z *= inv; } - + else + { + x = y = z = 0; + } return d; } diff --git a/visilib/plucker_polytope_splitter.h b/visilib/plucker_polytope_splitter.h index 7394ec4..dccce71 100644 --- a/visilib/plucker_polytope_splitter.h +++ b/visilib/plucker_polytope_splitter.h @@ -200,9 +200,12 @@ namespace visilib myI2 = temp; } + const std::vector& facetsI1 = aPolyhedron->getFacetsDescription(myI1); + const std::vector& facetsI2 = aPolyhedron->getFacetsDescription(myI2); + std::vector myFacets; - MathCombinatorial::initFacets(aPolyhedron->getFacetsDescription(myI1), - aPolyhedron->getFacetsDescription(myI2), + MathCombinatorial::initFacets(facetsI1, + facetsI2, aPlaneID, myFacets);