Skip to content

Commit f9a2520

Browse files
committed
Fix default broad phase in python
1 parent 34de5a1 commit f9a2520

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

python/src/candidates/candidates.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <common.hpp>
22

33
#include <ipc/candidates/candidates.hpp>
4-
#include <ipc/broad_phase/broad_phase.hpp>
54

65
namespace py = pybind11;
76
using namespace ipc;
@@ -25,7 +24,8 @@ void define_candidates(py::module_& m)
2524
broad_phase: Broad phase to use.
2625
)ipc_Qu8mg5v7",
2726
py::arg("mesh"), py::arg("vertices"),
28-
py::arg("inflation_radius") = 0, py::arg("broad_phase") = nullptr)
27+
py::arg("inflation_radius") = 0,
28+
py::arg("broad_phase") = make_default_broad_phase())
2929
.def(
3030
"build",
3131
py::overload_cast<
@@ -46,7 +46,8 @@ void define_candidates(py::module_& m)
4646
broad_phase: Broad phase to use.
4747
)ipc_Qu8mg5v7",
4848
py::arg("mesh"), py::arg("vertices_t0"), py::arg("vertices_t1"),
49-
py::arg("inflation_radius") = 0, py::arg("broad_phase") = nullptr)
49+
py::arg("inflation_radius") = 0,
50+
py::arg("broad_phase") = make_default_broad_phase())
5051
.def("__len__", &Candidates::size)
5152
.def("empty", &Candidates::empty)
5253
.def("clear", &Candidates::clear)
@@ -127,7 +128,7 @@ void define_candidates(py::module_& m)
127128
)ipc_Qu8mg5v7",
128129
py::arg("mesh"), py::arg("vertices_t0"), py::arg("vertices_t1"),
129130
py::arg("dhat"), py::arg("min_distance") = 0.0,
130-
py::arg("broad_phase") = nullptr,
131+
py::arg("broad_phase") = make_default_broad_phase(),
131132
py::arg("narrow_phase_ccd") = DEFAULT_NARROW_PHASE_CCD)
132133
.def(
133134
"save_obj", &Candidates::save_obj, py::arg("filename"),

python/src/collisions/normal/normal_collisions.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <common.hpp>
22

33
#include <ipc/collisions/normal/normal_collisions.hpp>
4-
#include <ipc/broad_phase/broad_phase.hpp>
54

65
namespace py = pybind11;
76
using namespace ipc;
@@ -27,7 +26,8 @@ void define_normal_collisions(py::module_& m)
2726
broad_phase: Broad-phase to use.
2827
)ipc_Qu8mg5v7",
2928
py::arg("mesh"), py::arg("vertices"), py::arg("dhat"),
30-
py::arg("dmin") = 0, py::arg("broad_phase") = nullptr)
29+
py::arg("dmin") = 0,
30+
py::arg("broad_phase") = make_default_broad_phase())
3131
.def(
3232
"build",
3333
py::overload_cast<

python/src/ipc.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#include <common.hpp>
22

33
#include <ipc/ipc.hpp>
4-
#include <ipc/broad_phase/broad_phase.hpp>
54
#include <ipc/config.hpp>
65

76
#include <igl/edges.h>
@@ -33,7 +32,8 @@ void define_ipc(py::module_& m)
3332
True if <b>any</b> collisions occur.
3433
)ipc_Qu8mg5v7",
3534
py::arg("mesh"), py::arg("vertices_t0"), py::arg("vertices_t1"),
36-
py::arg("min_distance") = 0.0, py::arg("broad_phase") = nullptr,
35+
py::arg("min_distance") = 0.0,
36+
py::arg("broad_phase") = make_default_broad_phase(),
3737
py::arg("narrow_phase_ccd") = DEFAULT_NARROW_PHASE_CCD);
3838

3939
m.def(
@@ -56,7 +56,8 @@ void define_ipc(py::module_& m)
5656
A step-size :math:`\in [0, 1]` that is collision free. A value of 1.0 if a full step and 0.0 is no step.
5757
)ipc_Qu8mg5v7",
5858
py::arg("mesh"), py::arg("vertices_t0"), py::arg("vertices_t1"),
59-
py::arg("min_distance") = 0.0, py::arg("broad_phase") = nullptr,
59+
py::arg("min_distance") = 0.0,
60+
py::arg("broad_phase") = make_default_broad_phase(),
6061
py::arg("narrow_phase_ccd") = DEFAULT_NARROW_PHASE_CCD);
6162

6263
m.def(
@@ -72,7 +73,8 @@ void define_ipc(py::module_& m)
7273
Returns:
7374
A boolean for if the mesh has intersections.
7475
)ipc_Qu8mg5v7",
75-
py::arg("mesh"), py::arg("vertices"), py::arg("broad_phase") = nullptr);
76+
py::arg("mesh"), py::arg("vertices"),
77+
py::arg("broad_phase") = make_default_broad_phase());
7678

7779
m.def(
7880
"edges",

0 commit comments

Comments
 (0)