Skip to content

novaphy.CollisionShape

Low-level collision shape descriptor with material, flags, owning body/link, and local pose information.

For new scene-building code, prefer the ModelBuilder.add_shape_* family. The CollisionShape.make_* factories are still useful for tests, importers, and direct low-level shape construction.

Constructors

Constructor Description
CollisionShape() Default box descriptor.
CollisionShape.make_box(half_extents, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Box shape.
CollisionShape.make_sphere(radius, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Sphere shape.
CollisionShape.make_plane(normal, offset, friction=0.5, restitution=0.0) Infinite plane.
CollisionShape.make_cylinder(radius, half_length, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Cylinder shape.
CollisionShape.make_capsule(radius, half_length, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Capsule aligned along local Z.
CollisionShape.make_convex_hull(vertices, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Convex hull from shape-local vertices.
CollisionShape.make_triangle_mesh(vertices, triangles, body_idx, local=None, friction=0.5, restitution=0.3, art_idx=-1, link_idx=-1) Triangle mesh from vertices and index triplets.

Properties

Property Description
type ShapeType.
body_index Owning body index (-1 for world-owned plane).
articulation_index, link_index Owning articulation/link indices, or -1.
local_transform Local pose relative to the owning body or link.
scale Geometry scale metadata.
friction, restitution Contact material coefficients.
ke, kd, kf, ka, kh Contact stiffness / damping material parameters.
mu_torsional, mu_rolling Optional torsional / rolling friction coefficients.
margin, gap Contact margin and detection gap [m].
collision_group Collision group; 0 disables shape collision.
is_solid Solid/source metadata used by mass and inertia construction paths; current collision kernels do not branch on this flag.
flags Integer bitmask of ShapeFlags.
box_half_extents Box half-extents, when type == ShapeType.Box.
sphere_radius Sphere radius, when type == ShapeType.Sphere.
capsule_radius, capsule_half_length Capsule radius and cylindrical half-length along local Z.
plane_normal, plane_offset Plane parameters, when type == ShapeType.Plane.
cylinder_radius, cylinder_half_length Cylinder parameters, when type == ShapeType.Cylinder.
convex_hull_vertices Read-only vertices for convex hull shapes.
triangle_mesh_vertices, triangle_mesh_triangles Read-only mesh payload for triangle mesh shapes.
triangle_mesh_normals, triangle_mesh_uvs Read-only optional mesh vertex attributes; empty when absent.
triangle_mesh_texture Read-only optional texture path/URI.
triangle_mesh_roughness, triangle_mesh_metallic Read-only optional material scalars.
color Optional writable RGB display color in [0, 1].
sdf_source_values, sdf_source_tile_coords Read-only dense/sparse SDF source payload.
sdf_source_dims, sdf_source_tile_dim Read-only SDF grid and tile dimensions.
sdf_source_origin, sdf_source_spacing Read-only SDF grid origin and spacing.

Methods

Method Description
compute_aabb(body_transform) World-space AABB for the shape.

Example

import numpy as np
import novaphy

shape = novaphy.CollisionShape.make_cylinder(
    radius=0.25,
    half_length=0.5,
    body_idx=body_idx,
    local=novaphy.Transform.identity(),
)

See Also