gmlewis/step/components/collision does not have a README file

    Aabb

    pub(all) struct Aabb {
    min_pt : (Double, Double, Double)
    max_pt : (Double, Double, Double)
    }

    Aabb is a world-axis-aligned bounding box.

    Aabb::intersection

    fn Aabb::intersection(self : Aabb, other : Aabb) -> Aabb?

    Aabb::intersection returns the overlapping box, or None when disjoint.

    Aabb::overlaps

    fn Aabb::overlaps(self : Aabb, other : Aabb, tol_mm : Double) -> Bool

    Aabb::overlaps is a broad-phase test with separation tolerance.

    Aabb::volume

    fn Aabb::volume(self : Aabb) -> Double

    Aabb::volume returns the box volume (zero when degenerate).

    CollisionKind

    pub(all) enum CollisionKind {
    Clearance
    Contact
    InterferenceFit
    Collision
    Indeterminate
    }

    CollisionKind is the geometric relationship between two placed solids.

    CollisionKind::severity

    fn CollisionKind::severity(self : CollisionKind) -> Int

    CollisionKind::severity orders kinds from least to most serious.

    CollisionKind::to_string

    fn CollisionKind::to_string(self : CollisionKind) -> String

    CollisionKind::to_string returns a stable display token.

    CollisionReport

    pub(all) struct CollisionReport {
    instance_a : String
    instance_b : String
    kind : CollisionKind
    penetration_mm : Double
    separation_mm : Double
    overlap_volume_mm3 : Double
    region : Aabb?
    }

    CollisionReport is the aggregated relationship between two component instances.

    CollisionReport::is_collision

    fn CollisionReport::is_collision(self : CollisionReport) -> Bool

    CollisionReport::is_collision reports whether the pair is an unintended positive-volume overlap.

    CollisionReport::is_contact

    fn CollisionReport::is_contact(self : CollisionReport) -> Bool

    CollisionReport::is_contact reports whether the pair is in contact.

    CollisionReport::is_interference_fit

    fn CollisionReport::is_interference_fit(self : CollisionReport) -> Bool

    CollisionReport::is_interference_fit reports whether the pair is a declared permitted overlap.

    CollisionReport::summary

    fn CollisionReport::summary(self : CollisionReport) -> String

    CollisionReport::summary returns a one-line diagnostic.

    ContactPolicy

    pub(all) struct ContactPolicy {
    permitted_interference : Array[(String, String)]
    }

    ContactPolicy declares component-instance pairs whose overlap is an explicitly permitted interference fit.

    A permitted pair is still measured (penetration depth and region are reported) but is classified as InterferenceFit instead of Collision. Pairs are matched in either order.

    ContactPolicy::none

    ContactPolicy::none permits no interference.

    ContactPolicy::permit

    fn ContactPolicy::permit(self : ContactPolicy, a : String, b : String) -> ContactPolicy

    ContactPolicy::permit returns a policy that also permits the named pair.

    Obb

    pub(all) struct Obb {
    center : (Double, Double, Double)
    half_extents : (Double, Double, Double)
    axes : ((Double, Double, Double), (Double, Double, Double), (Double, Double, Double))
    }

    Obb is an oriented bounding box: a local axis-aligned box transformed by a rigid placement. axes are unit vectors (the world directions of the local X, Y, and Z axes); half_extents are the half sizes along those axes.

    Obb::aabb

    fn Obb::aabb(self : Obb) -> Aabb

    Obb::aabb returns the world-axis-aligned box enclosing the OBB.

    Obb::from_placement

    fn Obb::from_placement(placement :
    Placement
    , bounds : (Double, Double, Double, Double, Double, Double)) -> Obb

    Obb::from_placement builds an OBB from a local box and a rigid placement.

    Obb::volume

    fn Obb::volume(self : Obb) -> Double

    Obb::volume returns the box volume.

    PairGeometry

    pub(all) struct PairGeometry {
    kind : CollisionKind
    penetration_mm : Double
    separation_mm : Double
    overlap_volume_mm3 : Double
    region : Aabb?
    }

    PairGeometry is the narrow-phase result for one pair of OBBs.

    PlacedShape

    pub(all) struct PlacedShape {
    instance_name : String
    layer_name : String
    obb : Obb
    }

    PlacedShape is one component layer placed in world coordinates, ready for collision validation.

    TolerancePolicy

    pub(all) struct TolerancePolicy {
    linear_mm : Double
    angular_deg : Double
    volume_mm3 : Double
    contact_mm : Double
    surface_deviation_mm : Double
    }

    TolerancePolicy is the named tolerance set used by geometric validation.

    Centralising the values keeps arbitrary epsilons out of the component builders and makes every reported measurement interpretable. Lengths are millimetres, angles are degrees, volumes are cubic millimetres.

    TolerancePolicy::coarse

    TolerancePolicy::coarse returns looser tolerances for large assemblies or tessellated references.

    TolerancePolicy::default

    TolerancePolicy::default returns the validation tolerances used by the component tests. The contact tolerance is deliberately small (1 micrometre) so that a nominal face-to-face joint is contact, not penetration.

    classify_obb_pair

    fn classify_obb_pair(a : Obb, b : Obb, tol? : TolerancePolicy) -> PairGeometry

    classify_obb_pair performs a narrow-phase separating-axis test on two oriented boxes.

    AABB overlap is only used to report a region and an upper bound on the common volume. The classification itself uses all 15 box separating axes (three per box plus nine edge-cross axes), so a face-to-face joint is contact and a positive-volume overlap is a collision.

    For a non-convex cross-section (for example a T-slot extrusion) the OBB is the convex envelope of the solid. A reported collision is therefore conservative: every reported collision lies inside the envelopes, and contact at the envelope is still a valid contact for the corner material that actually meets at a frame joint.

    pair_reports

    fn pair_reports(shapes : Array[PlacedShape], tol? : TolerancePolicy, policy? : ContactPolicy) -> Array[CollisionReport]

    pair_reports validates every pair of distinct component instances.

    Layer pairs belonging to the same instance are skipped. Results are aggregated per instance pair, taking the most serious kind, the deepest penetration, the closest clearance, and an upper bound on the common volume. A pair listed in policy as a permitted interference fit is classified as InterferenceFit while keeping its measured penetration and region.

    placed_shapes

    placed_shapes materialises every layer of one component instance as a placed OBB. The OBB uses the shape's local bounding box, which is exact for box-like extrusions and conservative for curved or slotted shapes.

    placed_shapes_for_parts

    placed_shapes_for_parts builds placed OBBs from an explicit part list.

    Source Files