MCPcopy Create free account
hub / github.com/BerkeleyAutomation/meshrender / __init__

Method __init__

meshrender/scene_object.py:15–44  ·  view source on GitHub ↗

Initialize a scene object with the given mesh, pose, and material. Parameters ---------- mesh : trimesh.Trimesh A mesh representing the object's geometry. T_obj_world : autolab_core.RigidTransform A rigid transformation from the object's frame

(self, mesh,
                 T_obj_world=None,
                 material=None,
                 enabled=True)

Source from the content-addressed store, hash-verified

13 """
14
15 def __init__(self, mesh,
16 T_obj_world=None,
17 material=None,
18 enabled=True):
19 """Initialize a scene object with the given mesh, pose, and material.
20
21 Parameters
22 ----------
23 mesh : trimesh.Trimesh
24 A mesh representing the object's geometry.
25 T_obj_world : autolab_core.RigidTransform
26 A rigid transformation from the object's frame to the world frame.
27 material : MaterialProperties
28 A set of material properties for the object.
29 enabled : bool
30 If False, the object will not be rendered.
31 """
32 if not isinstance(mesh, Trimesh):
33 raise ValueError('mesh must be an object of type Trimesh')
34 if T_obj_world is None:
35 T_obj_world = RigidTransform(from_frame='obj', to_frame='world')
36 if material is None:
37 material = MaterialProperties()
38 if material.smooth:
39 mesh = mesh.smoothed()
40
41 self._mesh = mesh
42 self._material = material
43 self.T_obj_world = T_obj_world
44 self._enabled = True
45
46 @property
47 def enabled(self):

Callers 1

__init__Method · 0.45

Calls 1

MaterialPropertiesClass · 0.85

Tested by

no test coverage detected