Commit 66474496 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Bind ConvexBase::convexHull

parent 6efdcedc
......@@ -88,10 +88,10 @@ class XmlDocString (object):
def otherTags (self, node):
if node.text:
self._write (node.text.strip())
self._write (node.text.strip().replace('"', r'\"'))
for c in node.iterchildren():
self.visit (c)
if c.tail: self._write (c.tail.strip())
if c.tail: self._write (c.tail.strip().replace('"', r'\"'))
def emphasis (self, node):
self._write ("*")
......@@ -103,10 +103,10 @@ class XmlDocString (object):
self.otherTags (node)
def para (self, node):
if node.text: self._write (node.text)
if node.text: self._write (node.text.replace('"', r'\"'))
for c in node.iterchildren():
self.visit (c)
if c.tail: self._write (c.tail)
if c.tail: self._write (c.tail.replace('"', r'\"'))
self._newline()
def ref (self, node):
......
......@@ -120,6 +120,13 @@ struct ConvexBaseWrapper
n.append (convex.neighbors[i][j]);
return n;
}
static ConvexBase* convexHull (const Vec3fs& points, bool keepTri,
const char* qhullCommand)
{
return ConvexBase::convexHull (points.data(), (int)points.size(), keepTri,
qhullCommand);
}
};
template <typename PolygonT>
......@@ -179,6 +186,10 @@ void exposeShapes ()
.DEF_RO_CLASS_ATTRIB (ConvexBase, num_points)
.def ("points", &ConvexBaseWrapper::points)
.def ("neighbors", &ConvexBaseWrapper::neighbors)
.def ("convexHull", &ConvexBaseWrapper::convexHull,
doxygen::member_func_doc(&ConvexBase::convexHull),
return_value_policy<manage_new_object>())
.staticmethod("convexHull")
;
class_ <Convex<Triangle>, bases<ConvexBase>, shared_ptr<Convex<Triangle> >, noncopyable>
......
......@@ -156,5 +156,12 @@ class TestGeometricShapes(TestCase):
faces.append(hppfcl.Triangle(0,1,2))
convex = hppfcl.Convex(verts, faces)
verts.append (np.array([0, 0, 1]))
convexHull = hppfcl.Convex.convexHull(verts, False, None)
convexHull = hppfcl.Convex.convexHull(verts, False, "")
convexHull = hppfcl.Convex.convexHull(verts, True, "")
if __name__ == '__main__':
unittest.main()
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