Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/recipes/tight_inclusion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()
message(STATUS "Third-party: creating target 'tight_inclusion::tight_inclusion'")

include(CPM)
CPMAddPackage("gh:Continuous-Collision-Detection/Tight-Inclusion@1.0.6")
CPMAddPackage("gh:Continuous-Collision-Detection/Tight-Inclusion@1.1.0")

# Folder name for IDE
set_target_properties(tight_inclusion PROPERTIES FOLDER "ThirdParty")
15 changes: 11 additions & 4 deletions python/src/ccd/tight_inclusion_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ void define_tight_inclusion_ccd(py::module_& m)
"BREADTH_FIRST_SEARCH",
ticcd::CCDRootFindingMethod::BREADTH_FIRST_SEARCH,
"Breadth first search")
.value(
"BUCKET_DEPTH_FIRST_SEARCH",
ticcd::CCDRootFindingMethod::BUCKET_DEPTH_FIRST_SEARCH,
"Depth first search with a dedicated traversal stack per time "
"lower bound")
.export_values();

m_ti.def(
Expand Down Expand Up @@ -61,7 +66,7 @@ void define_tight_inclusion_ccd(py::module_& m)
max_iterations: Maximum number of solver iterations (default: 1e7). If negative, solver will run until convergence.
filter: Filters calculated using get_numerical_error (default: (-1,-1,-1)). Use (-1,-1,-1) if checking a single query.
no_zero_toi: Refine further if a zero TOI is produced (assuming not initially in contact).
ccd_method: Root finding method (default: BREADTH_FIRST_SEARCH).
ccd_method: Root finding method (default: BUCKET_DEPTH_FIRST_SEARCH).

Returns:
Tuple of:
Expand All @@ -75,7 +80,8 @@ void define_tight_inclusion_ccd(py::module_& m)
"max_iterations"_a = TightInclusionCCD::DEFAULT_MAX_ITERATIONS,
"filter"_a = ticcd::Array3::Constant(-1),
"no_zero_toi"_a = ticcd::DEFAULT_NO_ZERO_TOI,
"ccd_method"_a = ticcd::CCDRootFindingMethod::BREADTH_FIRST_SEARCH);
"ccd_method"_a =
ticcd::CCDRootFindingMethod::BUCKET_DEPTH_FIRST_SEARCH);

m_ti.def(
"point_triangle_ccd",
Expand Down Expand Up @@ -113,7 +119,7 @@ void define_tight_inclusion_ccd(py::module_& m)
max_iterations: Maximum number of solver iterations (default: 1e7). If negative, solver will run until convergence.
filter: Filters calculated using get_numerical_error (default: (-1,-1,-1)). Use (-1,-1,-1) if checking a single query.
no_zero_toi: Refine further if a zero TOI is produced (assuming not initially in contact).
ccd_method: Root finding method (default: BREADTH_FIRST_SEARCH).
ccd_method: Root finding method (default: BUCKET_DEPTH_FIRST_SEARCH).

Returns:
Tuple of:
Expand All @@ -127,7 +133,8 @@ void define_tight_inclusion_ccd(py::module_& m)
"max_iterations"_a = TightInclusionCCD::DEFAULT_MAX_ITERATIONS,
"filter"_a = ticcd::Array3::Constant(-1),
"no_zero_toi"_a = ticcd::DEFAULT_NO_ZERO_TOI,
"ccd_method"_a = ticcd::CCDRootFindingMethod::BREADTH_FIRST_SEARCH);
"ccd_method"_a =
ticcd::CCDRootFindingMethod::BUCKET_DEPTH_FIRST_SEARCH);

m_ti.def(
"compute_ccd_filters",
Expand Down
8 changes: 4 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ endif()
if (IPC_TOOLKIT_TESTS_CCD_BENCHMARK)
include(ccd_query_io)
target_link_libraries(ipc_toolkit_tests PRIVATE ccd_io::ccd_io)
if(NOT (IPC_TOOLKIT_CCD_BENCHMARK_DIR STREQUAL ""))
message(STATUS "Using CCD benchmark directory: ${IPC_TOOLKIT_CCD_BENCHMARK_DIR}")
if(NOT "${IPC_TOOLKIT_TESTS_CCD_BENCHMARK_DIR}" STREQUAL "")
message(STATUS "Using CCD benchmark directory: ${IPC_TOOLKIT_TESTS_CCD_BENCHMARK_DIR}")
endif()
if(NOT (IPC_TOOLKIT_CCD_NEW_BENCHMARK_DIR STREQUAL ""))
message(STATUS "Using new CCD benchmark directory: ${IPC_TOOLKIT_CCD_NEW_BENCHMARK_DIR}")
if(NOT (IPC_TOOLKIT_TESTS_NEW_CCD_BENCHMARK_DIR STREQUAL ""))
message(STATUS "Using new CCD benchmark directory: ${IPC_TOOLKIT_TESTS_NEW_CCD_BENCHMARK_DIR}")
endif()
endif()

Expand Down
25 changes: 24 additions & 1 deletion tests/src/tests/ccd/benchmark_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,31 @@ TEST_CASE("Benchmark earliest toi", "[!benchmark][ccd][earliest_toi]")
mesh_name_t0 = "private/slow-broadphase-ccd/s0.ply";
mesh_name_t1 = "private/slow-broadphase-ccd/s1.ply";
}
SECTION("Cloth-Funnel")
{
mesh_name_t0 = "cloth-funnel/227.ply";
mesh_name_t1 = "cloth-funnel/228.ply";
}
SECTION("Cloth-ball")
{
mesh_name_t0 = "cloth_ball92.ply";
mesh_name_t1 = "cloth_ball93.ply";
}
SECTION("Armadillo-Rollers")
{
mesh_name_t0 = "armadillo-rollers/326.ply";
mesh_name_t1 = "armadillo-rollers/327.ply";
}
SECTION("N-Body-Simulation")
{
mesh_name_t0 = "n-body-simulation/balls16_18.ply";
mesh_name_t1 = "n-body-simulation/balls16_19.ply";
}
SECTION("Rod-Twist")
{
mesh_name_t0 = "rod-twist/3036.ply";
mesh_name_t1 = "rod-twist/3037.ply";
}
SECTION("Puffer-Ball")
{
mesh_name_t0 = "puffer-ball/20.ply";
Expand All @@ -39,7 +59,10 @@ TEST_CASE("Benchmark earliest toi", "[!benchmark][ccd][earliest_toi]")

if (!tests::load_mesh(mesh_name_t0, V0, E, F)
|| !tests::load_mesh(mesh_name_t1, V1, E, F)) {
SKIP("Slow broadphase CCD meshes are private");
SKIP(
fmt::format(
"Unable to load {} and/or {} (some meshes are private)",
mesh_name_t0, mesh_name_t1));
}

CollisionMesh mesh = CollisionMesh::build_from_full_mesh(V0, E, F);
Expand Down
10 changes: 3 additions & 7 deletions tests/src/tests/ccd/test_ccd_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,27 +187,23 @@ static const std::string BENCHMARK_TAGS =

TEST_CASE("Run CCD Benchmark", BENCHMARK_TAGS)
{
std::shared_ptr<NarrowPhaseCCD> ccd;

#ifdef IPC_TOOLKIT_WITH_INEXACT_CCD
SECTION("Floating-Point CCD")
{
fmt::print("Floating-Point CCD:\n\n");
ccd = std::make_shared<InexactCCD>();
run_benchmark(std::make_shared<InexactCCD>());
}
#endif
SECTION("Tight Inclusion CCD")
{
fmt::print("Tight Inclusion CCD:\n\n");
ccd = std::make_shared<TightInclusionCCD>();
run_benchmark(std::make_shared<TightInclusionCCD>());
}
SECTION("Additive CCD")
{
fmt::print("Additive CCD:\n\n");
ccd = std::make_shared<AdditiveCCD>();
run_benchmark(std::make_shared<AdditiveCCD>());
}

run_benchmark(ccd);
}

// TEST_CASE("Failing Benchmark Cases", "[ccd]")
Expand Down
Loading