Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
66474496
Commit
66474496
authored
May 04, 2020
by
Joseph Mirabel
Browse files
Bind ConvexBase::convexHull
parent
6efdcedc
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/python/xml_docstring.py
View file @
66474496
...
...
@@ -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
):
...
...
python/collision-geometries.cc
View file @
66474496
...
...
@@ -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
>
...
...
test/python_unit/geometric_shapes.py
View file @
66474496
...
...
@@ -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
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment