@@ -172,5 +172,48 @@ void define_collision_stencil(py::module_& m)
172
172
Returns:
173
173
Distance Hessian of the stencil w.r.t. the stencil's vertex positions.
174
174
)ipc_Qu8mg5v7" ,
175
- py::arg (" positions" ));
175
+ py::arg (" positions" ))
176
+ .def (
177
+ " ccd" ,
178
+ [](const CollisionStencil& self, const VectorMax12d& vertices_t0,
179
+ const VectorMax12d& vertices_t1, const double min_distance,
180
+ const double tmax, const NarrowPhaseCCD& narrow_phase_ccd) {
181
+ double toi;
182
+ bool r = self.ccd (
183
+ vertices_t0, vertices_t1, toi, min_distance, tmax,
184
+ narrow_phase_ccd);
185
+ return std::make_tuple (r, toi);
186
+ },
187
+ R"ipc_Qu8mg5v7(
188
+ Perform narrow-phase CCD on the candidate.
189
+
190
+ Parameters:
191
+ vertices_t0: Stencil vertices at the start of the time step.
192
+ vertices_t1: Stencil vertices at the end of the time step.
193
+ min_distance: Minimum separation distance between primitives.
194
+ tmax: Maximum time (normalized) to look for collisions. Should be in [0, 1].
195
+ narrow_phase_ccd: The narrow phase CCD algorithm to use.
196
+
197
+ Returns:
198
+ Tuple of:
199
+ If the candidate had a collision over the time interval.
200
+ Computed time of impact (normalized).
201
+ )ipc_Qu8mg5v7" ,
202
+ py::arg (" vertices_t0" ), py::arg (" vertices_t1" ),
203
+ py::arg (" min_distance" ) = 0.0 , py::arg (" tmax" ) = 1.0 ,
204
+ py::arg (" narrow_phase_ccd" ) = DEFAULT_NARROW_PHASE_CCD)
205
+ .def (
206
+ " print_ccd_query" ,
207
+ [](const CollisionStencil& self, const VectorMax12d& vertices_t0,
208
+ const VectorMax12d& vertices_t1) -> void {
209
+ self.write_ccd_query (std::cout, vertices_t0, vertices_t1);
210
+ },
211
+ R"ipc_Qu8mg5v7(
212
+ Print the CCD query to cout.
213
+
214
+ Parameters:
215
+ vertices_t0: Stencil vertices at the start of the time step.
216
+ vertices_t1: Stencil vertices at the end of the time step.
217
+ )ipc_Qu8mg5v7" ,
218
+ py::arg (" vertices_t0" ), py::arg (" vertices_t1" ));
176
219
}
0 commit comments