Objects
The base object class is Object3D
.
class simulate.Object3D
< source >( 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
orList[Material]
, optional, defaults to None) — The material of the object. -
name (
str
, optional, defaults toNone
) — 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 toFalse
) — Whether the object is an actor. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the object is an actor. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the object has a rigid body. -
with_articulation_body (
bool
, optional, defaults toFalse
) — 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 toTrue
) — Whether to recompute normals per vertex for this object. -
parent (
Asset
, optional, defaults toNone
) — The parent of the object. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — The children of the object.
Create a 3D Object.
build_collider
< source >( 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
< source >(
with_children: bool = True
**kwargs: typing.Any
)
→
copy (Object3D
)
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
< source >( 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 to10.0
) — Size of the plane in the i direction. -
j_size (
float
, optional, defaults to10.0
) — Size of the plane in the j direction. -
i_resolution (
int
, optional, defaults to1
) — Number of points on the plane in the i direction. -
j_resolution (
int
, optional, defaults to1
) — Number of points on the plane in the j direction. -
name (
str
, optional, defaults toNone
) — Name of the plane. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the plane. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the plane is an actor or not. -
with_collider (
bool
, optional, defaults toTrue
) — Whether the plane has a collider or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the plane has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — 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 they
(up) direction. -
collider_thickness (
float
, optional, defaults toNone
) — Thickness of the collider. -
parent (
Asset
, optional, defaults toNone
) — Parent of the plane. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the plane.
Create a plane.
class simulate.Sphere
< source >( 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 they
(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
< source >( 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 they
(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
< source >( 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 to1.0
) — Height of the cylinder. -
radius (
float
, optional, defaults to1.0
) — Radius of the cylinder. -
resolution (
int
, optional, defaults to16
) — Number of points on the circular face of the cylinder. -
capping (
bool
, optional, defaults toTrue
) — Cap cylinder ends with polygons. -
name (
str
, optional, defaults toNone
) — Name of the cylinder. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the cylinder. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the top of the cylinder points to in[x, y, z]
. Default to top of cylinder pointing in they
(up) direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the cylinder is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the cylinder has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the cylinder has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the cylinder. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the cylinder.
Create the surface of a cylinder.
class simulate.Box
< source >( 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
- a single float: size
=> bounds are
- a list of 6 floats:(xMin, xMax, yMin, yMax, zMin, zMax)
=> bounds are
-
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
< source >( 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 to1.0
) — Height of the cone. -
radius (
float
, optional, defaults to1.0
) — Radius of the cone. -
resolution (
int
, optional, defaults to6
) — Number of facets used to represent the cone. -
name (
str
, optional, defaults toNone
) — Name of the cone. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the cone. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the top of the cone points to in[x, y, z]
. Default to top of cone pointing in they
(up) direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the cone is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the cone has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the cone has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the cone. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the cone.
Create a cone.
class simulate.Line
< source >( 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
orList[float]
, optional, defaults to[-1.0, 0.0, 0.0]
) — Location of the first point of the line. -
pointb (
np.ndarray
orList[float]
, optional, defaults to[1.0, 0.0, 0.0]
) — Location of the second point of the line. -
resolution (
int
, optional, defaults to1
) — Number of pieces to divide line into. -
name (
str
, optional, defaults toNone
) — Name of the line. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the line points to in[x, y, z]
. Default to line pointing in thex
direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the line is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the line has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the line has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the line. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the line.
Create a line.
class simulate.MultipleLines
< source >( 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
orList[float]
, optional, defaults toNone
) — 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 toNone
) — Name of the multiple lines. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the multiple lines is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the multiple lines points to in[x, y, z]
. Default to multiple lines pointing in thex
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the multiple lines have a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the multiple lines have an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the multiple lines. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the multiple lines.
Create multiple lines.
class simulate.Tube
< source >( 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
orList[float]
, optional, defaults to[-1.0, 0.0, 0.0]
) — Location of the first point of the tube. -
pointb (
np.ndarray
orList[float]
, optional, defaults to[1.0, 0.0, 0.0]
) — Location of the second point of the tube. -
resolution (
int
, optional, defaults to1
) — Number of pieces to divide tube into. -
radius (
float
, optional, defaults to0.1
) — Minimum tube radius (minimum because the tube radius may vary). -
n_sides (
int
, optional, defaults to16
) — Number of sides of the tube. -
name (
str
, optional, defaults toNone
) — Name of the tube. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the tube is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the tube points to in[x, y, z]
. Default to tube pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the tube has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the tube has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the tube. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the tube.
Create a tube that goes from point A to point B.
class simulate.Polygon
< source >( 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
orList[float]
, optional, defaults toNone
) — 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
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the polygon. -
name (
str
, optional, defaults toNone
) — Name of the polygon. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the polygon is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the polygon points to in[x, y, z]
. Default to polygon pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the polygon has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the polygon has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the polygon. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the polygon. -
with_colliders (
bool
, optional, defaults toFalse
) — Whether the polygon has colliders or not.
Create a polygon.
class simulate.RegularPolygon
< source >( 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 to1.0
) — Radius of the regular polygon. -
n_sides (
int
, optional, defaults to6
) — Number of sides of the regular polygon. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the regular polygon. -
name (
str
, optional, defaults toNone
) — Name of the regular polygon. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the regular polygon is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the regular polygon points to in[x, y, z]
. Default to regular polygon pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the regular polygon has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the regular polygon has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the regular polygon. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the regular polygon.
Create a regular polygon.
class simulate.Ring
< source >( 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 to0.25
) — Inner radius of the ring. -
outer (
float
, optional, defaults to0.5
) — Outer radius of the ring. -
r_res (
int
, optional, defaults to1
) — Number of points in radial direction. -
c_res (
int
, optional, defaults to6
) — Number of points in circumferential direction. -
name (
str
, optional, defaults toNone
) — Name of the ring. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the ring. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the ring points to in[x, y, z]
. Default to ring pointing in they
direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the ring is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the ring has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the ring has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the ring. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — 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
< source >( 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 toNone
) — String to be converted to 3D text. -
depth (
float
, optional, defaults to0.5
) — Depth of the text. -
name (
str
, optional, defaults toNone
) — Name of the text. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the text. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the text points to in[x, y, z]
. Default to text pointing in thez
direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the text is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the text has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the text has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the text. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the text.
Create 3D text from a string.
class simulate.Triangle
< source >( 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
orList[List[float]]
, optional, defaults toNone
) — Points of the triangle. -
name (
str
, optional, defaults toNone
) — Name of the triangle. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the triangle is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the triangle points to in[x, y, z]
. Default to triangle pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the triangle has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the triangle has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the triangle. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the triangle.
Create a triangle defined by 3 points.
class simulate.Rectangle
< source >( 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
orList[List[float]]
, optional, defaults toNone
) — Points of the rectangle. -
name (
str
, optional, defaults toNone
) — Name of the rectangle. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the rectangle is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the rectangle points to in[x, y, z]
. Default to rectangle pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the rectangle has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the rectangle has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the rectangle. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the rectangle.
Create a rectangle defined by 4 points.
class simulate.Circle
< source >( 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 to0.5
) — Radius of the circle. -
resolution (
int
, optional, defaults to100
) — Number of points to define the circle. -
name (
str
, optional, defaults toNone
) — Name of the circle. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the circle. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the circle is an actor or not. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the circle points to in[x, y, z]
. Default to circle pointing in they
direction. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the circle has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the circle has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the circle. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the circle.
Create a single PolyData circle defined by radius in the XY plane.
class simulate.StructuredGrid
< source >( 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
orList[List[float]]
) — Position of the points in x direction. -
y (
np.ndarray
orList[List[float]]
) — Position of the points in y direction. -
z (
np.ndarray
orList[List[float]]
) — Position of the points in z direction. -
name (
str
, optional, defaults toNone
) — Name of the structured grid. -
position (
np.ndarray
orList[float]
, optional, defaults to[0, 0, 0]
) — Position of the structured grid. -
set_mesh_direction (
np.ndarray
orList[float]
, optional, defaults toNone
) — Direction the structured grid points to in[x, y, z]
. Default to structured grid pointing in they
direction. -
is_actor (
bool
, optional, defaults toFalse
) — Whether the structured grid is an actor or not. -
with_rigid_body (
bool
, optional, defaults toFalse
) — Whether the structured grid has a rigid body or not. -
with_articulation_body (
bool
, optional, defaults toFalse
) — Whether the structured grid has an articulation body or not. -
parent (
Asset
, optional, defaults toNone
) — Parent of the structured grid. -
children (
Asset
orList[Asset]
, optional, defaults toNone
) — Children of the structured grid.
Create a 3D grid (structured plane) defined by lists of X, Y and Z positions of points.
class simulate.ProcGenGrid
< source >( 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
< source >( 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
< source >( 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 )