@@ -9,8 +9,10 @@ template <typename collision_type, typename parent_type>
99void  define_SmoothCollisionTemplate (py::module_& m, std::string name)
1010{
1111    py::class_<collision_type, parent_type>(m, name.c_str ())
12-     .def (" name" " Get the type name of collision" 
13-     .def (" num_vertices" " Get the number of vertices" 
12+         .def (" name" " Get the type name of collision" 
13+         .def (
14+             " num_vertices" 
15+             " Get the number of vertices" 
1416}
1517
1618void  define_SmoothCollisions (py::module_& m, std::string name)
@@ -20,7 +22,9 @@ void define_SmoothCollisions(py::module_& m, std::string name)
2022        .def (
2123            " build" 
2224            py::overload_cast<
23-                 const  CollisionMesh&, Eigen::ConstRef<Eigen::MatrixXd>, const  ParameterType, const  bool , std::shared_ptr<BroadPhase>>(&SmoothCollisions::build),
25+                 const  CollisionMesh&, Eigen::ConstRef<Eigen::MatrixXd>,
26+                 const  ParameterType, const  bool , std::shared_ptr<BroadPhase>>(
27+                 &SmoothCollisions::build),
2428            R"ipc_Qu8mg5v7( 
2529            Initialize the set of collisions used to compute the barrier potential. 
2630
@@ -32,9 +36,11 @@ void define_SmoothCollisions(py::module_& m, std::string name)
3236                broad_phase: Broad phase method. 
3337            )ipc_Qu8mg5v7"  ,
3438            py::arg (" mesh" py::arg (" vertices" py::arg (" param" 
35-             py::arg (" use_adaptive_dhat" false , py::arg (" broad_phase" make_default_broad_phase ())
39+             py::arg (" use_adaptive_dhat" false ,
40+             py::arg (" broad_phase" make_default_broad_phase ())
3641        .def (
37-             " compute_minimum_distance" 
42+             " compute_minimum_distance" 
43+             &SmoothCollisions::compute_minimum_distance,
3844            R"ipc_Qu8mg5v7( 
3945            Computes the minimum distance between any non-adjacent elements. 
4046
@@ -46,12 +52,16 @@ void define_SmoothCollisions(py::module_& m, std::string name)
4652                The minimum distance between any non-adjacent elements. 
4753            )ipc_Qu8mg5v7"  ,
4854            py::arg (" mesh" py::arg (" vertices" 
49-         .def (" __len__" " Get the number of collisions." 
50-         .def (" empty" " Get if the collision set is empty." 
55+         .def (
56+             " __len__" " Get the number of collisions." 
57+         .def (
58+             " empty" 
59+             " Get if the collision set is empty." 
5160        .def (" clear" " Clear the collision set." 
5261        .def (
5362            " __getitem__" 
54-             [](SmoothCollisions& self, size_t  i) -> typename  SmoothCollisions::value_type& { return  self[i]; },
63+             [](SmoothCollisions& self, size_t  i) ->
64+             typename  SmoothCollisions::value_type& { return  self[i]; },
5565            py::return_value_policy::reference,
5666            R"ipc_Qu8mg5v7( 
5767            Get a reference to collision at index i. 
@@ -66,7 +76,9 @@ void define_SmoothCollisions(py::module_& m, std::string name)
6676        .def (
6777            " to_string" py::arg (" mesh" 
6878            py::arg (" vertices" py::arg (" param" 
69-         .def (" n_candidates" " Get the number of candidates." 
79+         .def (
80+             " n_candidates" 
81+             " Get the number of candidates." 
7082}
7183
7284void  define_normal_collisions (py::module_& m)
@@ -228,8 +240,7 @@ void define_normal_collisions(py::module_& m)
228240    py::class_<SmoothCollision>(m, " SmoothCollision2" 
229241        .def (" n_dofs" " Get the degree of freedom" 
230242        .def (
231-             " __call__" 
232-             &SmoothCollision::operator (),
243+             " __call__" SmoothCollision::operator (),
233244            R"ipc_Qu8mg5v7( 
234245            Compute the potential. 
235246     
@@ -255,8 +266,12 @@ void define_normal_collisions(py::module_& m)
255266            )ipc_Qu8mg5v7"  ,
256267            py::arg (" i" 
257268
258-     define_SmoothCollisionTemplate<SmoothCollisionTemplate<Edge2, Point2>, SmoothCollision>(m, " Edge2Point2Collision" 
259-     define_SmoothCollisionTemplate<SmoothCollisionTemplate<Point2, Point2>, SmoothCollision>(m, " Point2Point2Collision" 
269+     define_SmoothCollisionTemplate<
270+         SmoothCollisionTemplate<Edge2, Point2>, SmoothCollision>(
271+         m, " Edge2Point2Collision" 
272+     define_SmoothCollisionTemplate<
273+         SmoothCollisionTemplate<Point2, Point2>, SmoothCollision>(
274+         m, " Point2Point2Collision" 
260275
261276    define_SmoothCollisions (m, " SmoothCollisions" 
262277}
0 commit comments