Unverified Commit a089b172 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Merge pull request #241 from jcarpent/devel

Bug fixes
parents a8a119ed 8471b409
Pipeline #16030 passed with stage
in 23 minutes and 8 seconds
......@@ -13,3 +13,4 @@ dependencies:
- doxygen
- lxml
- pylatexenc
- qhull
......@@ -40,7 +40,7 @@ jobs:
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3) -DGENERATE_PYTHON_STUBS=ON
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3) -DGENERATE_PYTHON_STUBS=ON -DHPP_FCL_HAS_QHULL=ON
make -j2
make build_tests
export CTEST_OUTPUT_ON_FAILURE=1
......
......@@ -55,6 +55,7 @@ jobs:
-DGENERATE_PYTHON_STUBS=OFF ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DHPP_FCL_HAS_QHULL=ON ^
-DBUILD_PYTHON_INTERFACE=ON ^
..
......
......@@ -54,6 +54,7 @@ jobs:
-DGENERATE_PYTHON_STUBS=OFF ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^
-DHPP_FCL_HAS_QHULL=ON ^
-DBUILD_PYTHON_INTERFACE=ON ^
..
......
......@@ -120,10 +120,8 @@ endif()
option(HPP_FCL_HAS_QHULL "use qhull library to compute convex hulls." FALSE)
if(HPP_FCL_HAS_QHULL)
if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD EQUAL 98)
message(FATAL_ERROR "Cannot use qhull library with C++ < 11.\nYou may add -DCMAKE_CXX_STANDARD=11")
endif()
find_package(Qhull COMPONENTS qhull_r qhullcpp)
CHECK_MINIMAL_CXX_STANDARD(11 ENFORCE)
ADD_PROJECT_DEPENDENCY(Qhull COMPONENTS qhull_r qhullcpp PKG_CONFIG_REQUIRES "qhull_r, qhuppcpp")
if(Qhull_FOUND)
set(HPP_FCL_USE_SYSTEM_QHULL TRUE)
else()
......
......@@ -119,10 +119,7 @@ public:
virtual bool BVDisjoints(int b1, int b2, FCL_REAL& sqrDistLowerBound) const = 0;
/// @brief Leaf test between node b1 and b2, if they are both leafs
virtual void leafCollides(int /*b1*/, int /*b2*/, FCL_REAL& /*sqrDistLowerBound*/) const
{
throw std::runtime_error ("Not implemented");
}
virtual void leafCollides(int /*b1*/, int /*b2*/, FCL_REAL& /*sqrDistLowerBound*/) const = 0;
/// @brief Check whether the traversal can stop
bool canStop() const { return this->request.isSatisfied(*(this->result)); }
......
......@@ -77,12 +77,20 @@ typedef std::vector<Triangle> Triangles;
struct BVHModelBaseWrapper
{
static Vec3f vertices (const BVHModelBase& bvh, int i)
typedef Eigen::Matrix<double,Eigen::Dynamic,3> MatrixX3;
typedef Eigen::Map<MatrixX3> MapMatrixX3;
static Vec3f & vertice (BVHModelBase & bvh, int i)
{
if (i >= bvh.num_vertices) throw std::out_of_range("index is out of range");
return bvh.vertices[i];
}
static MapMatrixX3 vertices(BVHModelBase & bvh)
{
return MapMatrixX3(bvh.vertices[0].data(),bvh.num_vertices,3);
}
static Triangle tri_indices (const BVHModelBase& bvh, int i)
{
if (i >= bvh.num_tris) throw std::out_of_range("index is out of range");
......@@ -461,8 +469,12 @@ void exposeCollisionGeometries ()
class_ <BVHModelBase, bases<CollisionGeometry>, BVHModelPtr_t, noncopyable>
("BVHModelBase", no_init)
.def ("vertice", &BVHModelBaseWrapper::vertice,
bp::args("self","index"),"Retrieve the vertex given by its index.",
bp::return_internal_reference<>())
.def ("vertices", &BVHModelBaseWrapper::vertices,
bp::args("self","index"),"Retrieve the vertex given by its index.")
bp::args("self"),"Retrieve the vertex given by its index.",
bp::with_custodian_and_ward_postcall<0,1>())
.def ("tri_indices", &BVHModelBaseWrapper::tri_indices,
bp::args("self","index"),"Retrieve the triangle given by its index.")
.def_readonly ("num_vertices", &BVHModelBase::num_vertices)
......
......@@ -139,7 +139,7 @@ void BVHModelBase::buildConvexRepresentation(bool share_memory)
polygons = new Triangle[num_tris];
memcpy(polygons, tri_indices, sizeof(Triangle) * (size_t)num_tris);
}
convex.reset(new Convex<Triangle>(!share_memory, points, num_vertices, polygons, num_vertices));
convex.reset(new Convex<Triangle>(!share_memory, points, num_vertices, polygons, num_tris));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment