Skip to content

Commit

Permalink
格式化了文档
Browse files Browse the repository at this point in the history
  • Loading branch information
LaiQE committed Mar 7, 2019
1 parent f2afe6a commit 8d93aa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/easydexnet/dex_object.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
from .mesh import BaseMesh
from .stable_poses import StablePoses


class DexObject():
def __init__(self, mesh, poses=None, grasps=None):
self._mesh = mesh
if not poses:
self._poses = self.get_poses(self._mesh)
if not grasps:
pass

@staticmethod
def get_poses(mesh):
if not isinstance(mesh, (BaseMesh)):
Expand All @@ -19,5 +20,6 @@ def get_poses(mesh):
_center_mass = mesh.center_mass
else:
_center_mass = mesh.centroid
_raw_poses = mesh.convex_hull.compute_stable_poses(center_mass=_center_mass)
_raw_poses = mesh.convex_hull.compute_stable_poses(
center_mass=_center_mass)
return StablePoses.from_raw_poses(_raw_poses)
3 changes: 2 additions & 1 deletion src/easydexnet/mesh.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# -*- coding:utf-8 -*-

import trimesh


class BaseMesh(trimesh.base.Trimesh):
pass

0 comments on commit 8d93aa1

Please sign in to comment.