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_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 Whether the shape is treated as solid for mass/contact semantics.
flags Integer bitmask of ShapeFlags.
box_half_extents Box half-extents, when type == ShapeType.Box.
sphere_radius Sphere radius, when type == ShapeType.Sphere.
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.

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