Simulate documentation

Objects

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.1.2).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Objects

The base object class is Object3D.

class simulate.Object3D

< >

( mesh: typing.Union[pyvista.core.pointset.UnstructuredGrid, pyvista.core.composite.MultiBlock, pyvista.core.pointset.PolyData, pyvista.core.dataset.DataSet, NoneType] = None material: typing.Union[simulate.assets.material.Material, typing.List[simulate.assets.material.Material], NoneType] = None name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None original_mesh_direction: typing.Optional[typing.List[float]] = None recompute_normals: bool = True parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • mesh (pyvista.[UnstructuredGrid, MultiBlock, PolyData, DataSet], optional, defaults to None) — The mesh of the object.
  • material (Material or List[Material], optional, defaults to None) — The material of the object.
  • name (str, optional, defaults to None) — The name of the object.
  • position (List[float], optional, defaults to [0.0, 0.0, 0.0]) — The position of the object.
  • is_actor (bool, optional, defaults to False) — Whether the object is an actor.
  • is_actor (bool, optional, defaults to False) — Whether the object is an actor.
  • with_rigid_body (bool, optional, defaults to False) — Whether the object has a rigid body.
  • with_articulation_body (bool, optional, defaults to False) — Whether the object has an articulation body.
  • set_mesh_direction (List[float], optional, defaults to [1.0, 0.0, 0.0]) — The direction of the mesh.
  • original_mesh_direction (List[float], optional, defaults to [1.0, 0.0, 0.0]) — The original direction of the mesh.
  • recompute_normals (bool, optional, defaults to True) — Whether to recompute normals per vertex for this object.
  • parent (Asset, optional, defaults to None) — The parent of the object.
  • children (Asset or List[Asset], optional, defaults to None) — The children of the object.

Create a 3D Object.

build_collider

< >

( max_convex_hulls = 16 resolution = 4000 minimum_volume_percent_error_allowed = 1 max_recursion_depth = 10 shrink_wrap = True fill_mode = 'FLOOD_FILL' max_num_vertices_per_hull = 64 async_ACD = True min_edge_length = 2 find_best_plane = False )

Build a collider from the mesh.

Parameters

max_convex_hulls : int, optional Maximum number of convex hulls to generate, by default 16 resolution : int, optional Resolution of the voxel grid, by default 4000 minimum_volume_percent_error_allowed : float, optional Minimum volume percent error allowed, by default 1 max_recursion_depth : int, optional Maximum recursion depth, by default 10 shrink_wrap : bool, optional Shrink wrap, by default True fill_mode : str, optional Fill mode, by default “FLOOD_FILL” max_num_vertices_per_hull : int, optional Maximum number of vertices per hull, by default 64 async_ACD : bool, optional Async ACD, by default True min_edge_length : int, optional Minimum edge length, by default 2 find_best_plane : bool, optional Find best plane, by default False

copy

< >

( with_children: bool = True **kwargs: typing.Any ) copy (Object3D)

Parameters

  • with_children (bool, optional, defaults to True) — Whether to copy the children of the object.

Returns

copy (Object3D)

The copied object.

Copy an Object3D node in a new (returned) object.

By default, mesh and materials are copied in respectively new mesh and material. ‘share_material’ and ‘share_mesh’ can be set to True to share mesh and/or material between original and copy instead of creating new one.

Other included objects

class simulate.Plane

< >

( i_size: float = 10.0 j_size: float = 10.0 i_resolution: int = 1 j_resolution: int = 1 name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None is_actor: bool = False with_collider: bool = True with_rigid_body: bool = False with_articulation_body: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None collider_thickness: typing.Optional[float] = None parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • i_size (float, optional, defaults to 10.0) — Size of the plane in the i direction.
  • j_size (float, optional, defaults to 10.0) — Size of the plane in the j direction.
  • i_resolution (int, optional, defaults to 1) — Number of points on the plane in the i direction.
  • j_resolution (int, optional, defaults to 1) — Number of points on the plane in the j direction.
  • name (str, optional, defaults to None) — Name of the plane.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the plane.
  • is_actor (bool, optional, defaults to False) — Whether the plane is an actor or not.
  • with_collider (bool, optional, defaults to True) — Whether the plane has a collider or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the plane has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the plane has an articulation body or not.
  • set_mesh_direction — list or tuple or np.ndarray, optional Direction the normal to the plane in [x, y, z]. Default to normal pointing in the y (up) direction.
  • collider_thickness (float, optional, defaults to None) — Thickness of the collider.
  • parent (Asset, optional, defaults to None) — Parent of the plane.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the plane.

Create a plane.

class simulate.Sphere

< >

( position: typing.Optional[typing.List[float]] = None radius: float = 1.0 theta_resolution: int = 10 phi_resolution: int = 10 start_theta: float = 0.0 end_theta: float = 360.0 start_phi: float = 0.0 end_phi: float = 180.0 sphere_type: str = 'uv' with_collider: bool = True name: typing.Optional[str] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the sphere.
  • radius (float, optional, defaults to 1.0) — Sphere radius.
  • theta_resolution (int, optional, defaults to 10) — Set the number of points in the longitude direction (ranging from start_theta to end_theta).
  • phi_resolution (int, optional, defaults to 10) — Set the number of points in the latitude direction (ranging from start_phi to end_phi).
  • start_theta (float, optional, defaults to 0.0) — Starting longitude angle.
  • end_theta (float, optional, defaults to 360.0) — Ending longitude angle.
  • start_phi (float, optional, defaults to 0.0) — Starting latitude angle.
  • end_phi (float, optional, defaults to 180.0) — Ending latitude angle.
  • sphere_type (str, optional, defaults to “uv”) — One of ‘uv’ for a UV-sphere or ‘ico’ for an icosphere.
  • with_collider (bool, optional, defaults to True) — Set to true to automatically add an associated Sphere collider.
  • name (str, optional, defaults to None) — Name of the sphere.
  • is_actor (bool, optional, defaults to False) — Whether the sphere is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the sphere has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the sphere has an articulation body or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the top of the sphere points to in [x, y, z]. Default to top of sphere pointing in the y (up) direction.
  • parent (Asset, optional, defaults to None) — Parent of the sphere.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the sphere.

Create a Sphere

class simulate.Capsule

< >

( position: typing.Optional[typing.List[float]] = None height: float = 1.0 radius: float = 0.2 theta_resolution: int = 4 phi_resolution: int = 4 sphere_type: str = 'uv' with_collider: bool = True name: typing.Optional[str] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the capsule.
  • height (float, optional, defaults to 1.0) — Height of the capsule.
  • radius (float, optional, defaults to 0.2) — Radius of the capsule.
  • theta_resolution (int, optional, defaults to 4) — Set the number of points in the longitude direction.
  • phi_resolution (int, optional, defaults to 4) — Set the number of points in the latitude direction.
  • sphere_type (str, optional, defaults to “uv”) — One of ‘uv’ for a UV-sphere or ‘ico’ for an icosphere.
  • with_collider (bool, optional, defaults to True) — Set to true to automatically add an associated Sphere collider.
  • name (str, optional, defaults to None) — Name of the capsule.
  • is_actor (bool, optional, defaults to False) — Whether the capsule is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the capsule has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the capsule has an articulation body or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the top of the capsule points to in [x, y, z]. Default to top of capsule pointing in the y (up) direction.
  • parent (Asset, optional, defaults to None) — Parent of the capsule.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the capsule.

A capsule (a cylinder with hemispheric ends).

class simulate.Cylinder

< >

( height: float = 1.0 radius: float = 1.0 resolution: int = 16 capping: bool = True name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • height (float, optional, defaults to 1.0) — Height of the cylinder.
  • radius (float, optional, defaults to 1.0) — Radius of the cylinder.
  • resolution (int, optional, defaults to 16) — Number of points on the circular face of the cylinder.
  • capping (bool, optional, defaults to True) — Cap cylinder ends with polygons.
  • name (str, optional, defaults to None) — Name of the cylinder.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the cylinder.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the top of the cylinder points to in [x, y, z]. Default to top of cylinder pointing in the y (up) direction.
  • is_actor (bool, optional, defaults to False) — Whether the cylinder is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the cylinder has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the cylinder has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the cylinder.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the cylinder.

Create the surface of a cylinder.

class simulate.Box

< >

( bounds: typing.Union[int, float, typing.List[float], numpy.ndarray, typing.Tuple[float, ...], NoneType] = None level: int = 0 quads: bool = True with_collider: bool = True name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • bounds (float or np.ndarray or List[float], optional, defaults to (-0.5, 0.5, -0.5, 0.5, -0.5, 0.5)) — Specify the bounding box of the cube as either:
    • a list of 6 floats:(xMin, xMax, yMin, yMax, zMin, zMax) => bounds are (xMin, xMax, yMin, yMax, zMin, zMax)
    • a list of 3 floats: xSize, ySize, zSize => bounds are (-xSize/2, xSize/2, ySize/2, ySize/2, -zSize/2, zSize/2)
      • a single float: size => bounds are (-size/2, size/2, size/2, size/2, -size/2, size/2) If no value is provided, create a centered unit box
  • level (int, optional, defaults to 0) — The level of subdivision of the box. The number of faces will be 6*4**level.
    • quads (bool, optional, defaults to True) — If True, the faces of the box will be quads. Otherwise, they will be triangles.
  • with_colliders (bool, optional, defaults to True) — Whether the box has colliders or not.
  • name (str, optional, defaults to None) — Name of the box.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the box.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the top of the box points to in [x, y, z]. Default to top of box pointing in the y (up) direction.
  • is_actor (bool, optional, defaults to False) — Whether the box is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the box has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the box has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the box.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the box.

Create a box with solid faces for the given bounds.

class simulate.Cone

< >

( height: float = 1.0 radius: float = 1.0 resolution: int = 6 name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • height (float, optional, defaults to 1.0) — Height of the cone.
  • radius (float, optional, defaults to 1.0) — Radius of the cone.
  • resolution (int, optional, defaults to 6) — Number of facets used to represent the cone.
  • name (str, optional, defaults to None) — Name of the cone.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the cone.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the top of the cone points to in [x, y, z]. Default to top of cone pointing in the y (up) direction.
  • is_actor (bool, optional, defaults to False) — Whether the cone is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the cone has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the cone has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the cone.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the cone.

Create a cone.

class simulate.Line

< >

( pointa: typing.Optional[typing.List[float]] = None pointb: typing.Optional[typing.List[float]] = None resolution: int = 1 name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • pointa (np.ndarray or List[float], optional, defaults to [-1.0, 0.0, 0.0]) — Location of the first point of the line.
  • pointb (np.ndarray or List[float], optional, defaults to [1.0, 0.0, 0.0]) — Location of the second point of the line.
  • resolution (int, optional, defaults to 1) — Number of pieces to divide line into.
  • name (str, optional, defaults to None) — Name of the line.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the line points to in [x, y, z]. Default to line pointing in the x direction.
  • is_actor (bool, optional, defaults to False) — Whether the line is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the line has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the line has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the line.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the line.

Create a line.

class simulate.MultipleLines

< >

( points: typing.Optional[typing.List[typing.List[float]]] = None name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • points (np.ndarray or List[float], optional, defaults to None) — List of points defining a broken line, default is [[-0.5, 0.0, 0.0], [0.5, 0.0, 0.0]].
  • name (str, optional, defaults to None) — Name of the multiple lines.
  • is_actor (bool, optional, defaults to False) — Whether the multiple lines is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the multiple lines points to in [x, y, z]. Default to multiple lines pointing in the x direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the multiple lines have a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the multiple lines have an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the multiple lines.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the multiple lines.

Create multiple lines.

class simulate.Tube

< >

( pointa: typing.Optional[typing.List[float]] = None pointb: typing.Optional[typing.List[float]] = None resolution: int = 1 radius: float = 1.0 n_sides: int = 16 name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • pointa (np.ndarray or List[float], optional, defaults to [-1.0, 0.0, 0.0]) — Location of the first point of the tube.
  • pointb (np.ndarray or List[float], optional, defaults to [1.0, 0.0, 0.0]) — Location of the second point of the tube.
  • resolution (int, optional, defaults to 1) — Number of pieces to divide tube into.
  • radius (float, optional, defaults to 0.1) — Minimum tube radius (minimum because the tube radius may vary).
  • n_sides (int, optional, defaults to 16) — Number of sides of the tube.
  • name (str, optional, defaults to None) — Name of the tube.
  • is_actor (bool, optional, defaults to False) — Whether the tube is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the tube points to in [x, y, z]. Default to tube pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the tube has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the tube has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the tube.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the tube.

Create a tube that goes from point A to point B.

class simulate.Polygon

< >

( points: typing.List[typing.List[float]] position: typing.Optional[typing.List[float]] = None name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None with_collider: bool = False **kwargs: typing.Any )

Parameters

  • points (np.ndarray or List[float], optional, defaults to None) — List of points defining the polygon, e.g. [[0, 0, 0], [1, 0, -.1], [.8, 0, .5], [1, 0, 1], [.6, 0, 1.2], [0, 0, .8]]. The polygon is defined by an ordered list of three or more points lying in a plane. The polygon normal is implicitly defined by a counterclockwise ordering of its points using the right-hand rule.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the polygon.
  • name (str, optional, defaults to None) — Name of the polygon.
  • is_actor (bool, optional, defaults to False) — Whether the polygon is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the polygon points to in [x, y, z]. Default to polygon pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the polygon has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the polygon has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the polygon.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the polygon.
  • with_colliders (bool, optional, defaults to False) — Whether the polygon has colliders or not.

Create a polygon.

class simulate.RegularPolygon

< >

( radius: float = 1.0 n_sides: int = 6 position: typing.Optional[typing.List[float]] = None name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • radius (float, optional, defaults to 1.0) — Radius of the regular polygon.
  • n_sides (int, optional, defaults to 6) — Number of sides of the regular polygon.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the regular polygon.
  • name (str, optional, defaults to None) — Name of the regular polygon.
  • is_actor (bool, optional, defaults to False) — Whether the regular polygon is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the regular polygon points to in [x, y, z]. Default to regular polygon pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the regular polygon has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the regular polygon has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the regular polygon.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the regular polygon.

Create a regular polygon.

class simulate.Ring

< >

( inner: float = 0.25 outer: float = 0.5 r_res: int = 1 c_res: int = 6 name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • inner (float, optional, defaults to 0.25) — Inner radius of the ring.
  • outer (float, optional, defaults to 0.5) — Outer radius of the ring.
  • r_res (int, optional, defaults to 1) — Number of points in radial direction.
  • c_res (int, optional, defaults to 6) — Number of points in circumferential direction.
  • name (str, optional, defaults to None) — Name of the ring.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the ring.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the ring points to in [x, y, z]. Default to ring pointing in the y direction.
  • is_actor (bool, optional, defaults to False) — Whether the ring is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the ring has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the ring has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the ring.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the ring.

Create a polygonal disk with a hole in the center.

The disk has zero height. The user can specify the inner and outer radius of the disk, and the radial and circumferential resolution of the polygonal representation.

class simulate.Text3D

< >

( string: str = 'Hello' depth: float = 0.5 name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • string (str, optional, defaults to None) — String to be converted to 3D text.
  • depth (float, optional, defaults to 0.5) — Depth of the text.
  • name (str, optional, defaults to None) — Name of the text.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the text.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the text points to in [x, y, z]. Default to text pointing in the z direction.
  • is_actor (bool, optional, defaults to False) — Whether the text is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the text has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the text has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the text.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the text.

Create 3D text from a string.

class simulate.Triangle

< >

( points: typing.Optional[typing.List[typing.List[float]]] = None name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • points (np.ndarray or List[List[float]], optional, defaults to None) — Points of the triangle.
  • name (str, optional, defaults to None) — Name of the triangle.
  • is_actor (bool, optional, defaults to False) — Whether the triangle is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the triangle points to in [x, y, z]. Default to triangle pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the triangle has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the triangle has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the triangle.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the triangle.

Create a triangle defined by 3 points.

class simulate.Rectangle

< >

( points: typing.Optional[typing.List[typing.List[float]]] = None name: typing.Optional[str] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • points (np.ndarray or List[List[float]], optional, defaults to None) — Points of the rectangle.
  • name (str, optional, defaults to None) — Name of the rectangle.
  • is_actor (bool, optional, defaults to False) — Whether the rectangle is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the rectangle points to in [x, y, z]. Default to rectangle pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the rectangle has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the rectangle has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the rectangle.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the rectangle.

Create a rectangle defined by 4 points.

class simulate.Circle

< >

( radius: float = 0.5 resolution: int = 100 name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None is_actor: bool = False set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • radius (float, optional, defaults to 0.5) — Radius of the circle.
  • resolution (int, optional, defaults to 100) — Number of points to define the circle.
  • name (str, optional, defaults to None) — Name of the circle.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the circle.
  • is_actor (bool, optional, defaults to False) — Whether the circle is an actor or not.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the circle points to in [x, y, z]. Default to circle pointing in the y direction.
  • with_rigid_body (bool, optional, defaults to False) — Whether the circle has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the circle has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the circle.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the circle.

Create a single PolyData circle defined by radius in the XY plane.

class simulate.StructuredGrid

< >

( x: typing.Union[numpy.ndarray, typing.List[typing.List[float]]] y: typing.Union[numpy.ndarray, typing.List[typing.List[float]]] z: typing.Union[numpy.ndarray, typing.List[typing.List[float]]] name: typing.Optional[str] = None position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Parameters

  • x (np.ndarray or List[List[float]]) — Position of the points in x direction.
  • y (np.ndarray or List[List[float]]) — Position of the points in y direction.
  • z (np.ndarray or List[List[float]]) — Position of the points in z direction.
  • name (str, optional, defaults to None) — Name of the structured grid.
  • position (np.ndarray or List[float], optional, defaults to [0, 0, 0]) — Position of the structured grid.
  • set_mesh_direction (np.ndarray or List[float], optional, defaults to None) — Direction the structured grid points to in [x, y, z]. Default to structured grid pointing in the y direction.
  • is_actor (bool, optional, defaults to False) — Whether the structured grid is an actor or not.
  • with_rigid_body (bool, optional, defaults to False) — Whether the structured grid has a rigid body or not.
  • with_articulation_body (bool, optional, defaults to False) — Whether the structured grid has an articulation body or not.
  • parent (Asset, optional, defaults to None) — Parent of the structured grid.
  • children (Asset or List[Asset], optional, defaults to None) — Children of the structured grid.

Create a 3D grid (structured plane) defined by lists of X, Y and Z positions of points.

Examples:

# create a 5x5 mesh grid
xrng = np.arange(-2, 3, dtype=np.float32)
zrng = np.arange(-2, 3, dtype=np.float32)
x, z = np.meshgrid(xrng, zrng)
# let's make the y-axis a sort of cone
y = 1. / np.sqrt(x*x + z*z + 0.1)
asset = sm.StructuredGrid(x, y, z)

class simulate.ProcGenGrid

< >

( sample_map: typing.Union[numpy.ndarray, typing.List[typing.List[typing.List[int]]]] = None specific_map: typing.Union[numpy.ndarray, typing.List[typing.List[typing.List[int]]]] = None tiles: typing.Optional[typing.List] = None neighbors: typing.Optional[typing.List] = None symmetries: typing.Optional[typing.List] = None weights: typing.Optional[typing.List] = None width: int = 9 height: int = 9 shallow: bool = False algorithm_args: typing.Optional[dict] = None seed: int = None name: typing.Optional[str] = None is_actor: bool = False position: typing.Optional[typing.List[float]] = None set_mesh_direction: typing.Optional[typing.List[float]] = None with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None verbose: bool = False **kwargs: typing.Any )

Create a procedural generated 3D grid (structured plane) from tiles / previous map.

Parameters

sample_map : np.ndarray or python list of lists of floats Map to procedurally generate from. specific_map: np.ndarray or python list of lists of floats Map to show as it is. tiles : list of tiles Tiles for procedural generation when using generation from tiles and neighbors definitions. Tiles must be NxN np.ndarray that define height maps. In the future, we plan to support more generic tiles. neighbors: list of available neighbors for each tile Expects pair of tiles. symmetries: list of char Expects a list of symmetry definitions. If passed, you must define a symmetry for each tile. Possible symmetries are “X”, “I” / ”/”, “T” / “L”, another character, and each character defines the tile with the same level of symmetry as the character:

  • X: has symmetry in all ways. So it has 1 different format.
  • I / /: when rotated, it’s different from the original tile. Has 2 different formats.
  • T / L: Has 4 different formats.
  • other characters: the algorithm supposes it has 8 different formats. weights: list of floats sampling weights for each of the tiles width: int width of the generated map height: int height of the generated map shallow: bool Indicates whether procedural generation mesh should be generated in simenv or not. When it’s true, we just return the map returned by the algorithm without actually creating the mesh in simenv. Created for the purpose of optimizing certain environments such as XLand. seed: int Random seed used for procedural generation. algorithm_args: dict Extra arguments to be passed to the procedural generation. Returns

Examples

generate_3D

< >

( name: typing.Optional[str] = None is_actor: bool = False with_rigid_body: bool = False with_articulation_body: bool = False parent: typing.Optional[ForwardRef('Asset')] = None children: typing.Union[ForwardRef('Asset'), typing.List[ForwardRef('Asset')], NoneType] = None **kwargs: typing.Any )

Function for creating the mesh in case the creation of map was shallow.

class simulate.ProcGenPrimsMaze3D

< >

( width: int depth: int name: typing.Optional[str] = None wall_keep_prob: float = 0.5 wall_material: typing.Optional[simulate.assets.material.Material] = None **kwargs: typing.Any )