Building practical AI
Deepak Kumar Tiwari

Deepak Kumar Tiwari

Technology & AI Leader · Building practical systems

Multimodal inspection / Guide 97

3D Garment Collision Validation Needs More Than Overlapping Boxes

Validate 3D garment collision reports with versioned caches, narrow-phase measurements, temporal coverage, and uncertainty before artists approve simulation changes.

Illustrative engineering guide. Examples are not client deployments, production-ready integrations, or evidence of measured results. Validate the design with your domain and security owners.

Reference workflow: Garment and avatar cache; Candidate intersection regions; Specialist contact measurement; Temporal coverage validation; Artist review and rebake.
Reference workflow. Steps identify responsibilities, not necessarily separate agents. Branches and recovery paths are explained below. Open full-size diagram.

A hypothetical turntable render shows a jacket sleeve briefly disappearing into an avatar’s elbow. An assistant reports collisions everywhere because the sleeve and torso bounding boxes overlap throughout the shot. That diagnosis is nearly useless: loose clothing normally occupies overlapping spatial envelopes. Conversely, clean bounding boxes at sampled frames do not rule out a fast intersection between samples. The harness must distinguish broad-phase candidates from actual contact measurements.

Raw evidence includes rendered frames, evaluated garment and avatar meshes, animation, and simulation caches. A vision model can nominate the elbow interval for closer inspection. A geometry or cloth specialist then measures the evaluated surfaces under declared assumptions. The output is a repair packet for a technical artist, not proof of physical garment fit, comfort, durability, or manufacturing quality.

Freeze the Evaluated Scene

Record garment mesh digest, topology revision, avatar mesh and rig versions, material parameters, collision settings, solver version, cache digest, and animation interval. A clean render from yesterday cannot validate today’s rebaked cloth. Capture the evaluated geometry after modifiers and deformation; inspecting the undeformed bind mesh would answer the wrong question.

Define world coordinates as right-handed, with a documented up axis and a length conversion into millimeters for reporting. Render overlays remain in top-left pixels with crop and camera transforms preserved. Frame numbers must map to rational frame rate, scene start, and simulation substeps. Keep capture time and cache creation time distinct from animation time. Repeated rendered frames are correlated, not independent trials.

Blender’s cloth collision documentation describes collision and self-collision controls, including quality and distance settings. Those controls affect a simulation rather than certify it. A chosen collision distance may produce visible separation, missed detail, or expensive computation. The project should record the actual settings and test whether they meet its visual requirements instead of quoting defaults as universal tolerances.

Measure Contact Under Explicit Assumptions

Axis-aligned bounding box overlap is only a broad-phase filter. It cannot prove mesh collision, penetration depth, or continuous collision avoidance. Narrow-phase requires appropriate triangle, contact, or signed-distance queries against the actual evaluated surfaces. Store primitive identifiers and witness locations so the reviewer can reproduce the reported issue rather than searching a whole garment.

Open3D’s distance query guide explains that signed distance and occupancy depend on watertight geometry and well-defined inside and outside. Cloth is often an open surface. A negative signed distance produced under invalid assumptions should not become a confident penetration report. Choose a method appropriate to open surfaces, shell thickness, contact sidedness, and the particular solver representation.

An imported body scan introduces another uncertainty source. Open3D’s ICP registration tutorial describes alignment refinement from an initial transformation. Record the registration version and independent check landmarks; symmetric body regions can align incorrectly. A low fit residual is not anatomical truth and does not validate private body measurements for unrelated uses.

Test the Report Contract

This self-contained Python fixture tests the HARNESS using synthetic structured contact measurements and cache metadata. It does not run a trained vision model, camera, CAD engine, cloth solver, or real mesh collision test. The supplied penetration depths stand in for a specialist’s output. The one millimeter review threshold is an illustrative project policy, not a physical standard.

from math import isfinite

base = dict(cache="cloth-r12", frame="world-mm", broad_overlap=True,
            narrow_valid=True, penetration_mm=0.2, bound_mm=0.1,
            sampled={100, 101, 102})
required = {100, 101, 102}

def validate(row):
    if (row["cache"], row["frame"]) != ("cloth-r12", "world-mm"):
        return "stale-or-unregistered"
    if not required <= row["sampled"]:
        return "temporal-unknown"
    if not row["narrow_valid"]:
        return "narrow-phase-required"
    d, u = row["penetration_mm"], row["bound_mm"]
    if not all(isfinite(v) and v >= 0 for v in (d, u)):
        return "measurement-unknown"
    if d - u > 1:
        return "contact-review"
    return "sampled-packet-ready" if d + u <= 1 else "uncertain"

assert validate(base) == "sampled-packet-ready"
assert validate(dict(base, narrow_valid=False)) == "narrow-phase-required"
assert validate(dict(base, penetration_mm=2)) == "contact-review"
assert validate(dict(base, penetration_mm=0.95)) == "uncertain"
assert validate(dict(base, sampled={100, 102})) == "temporal-unknown"
assert validate(dict(base, cache="cloth-r11")) == "stale-or-unregistered"
print("six synthetic contact-report checks passed")

The broad-overlap flag deliberately cannot approve or reject a collision by itself. Even the supported result is scoped to sampled frames. The code does not establish what happened between frames 100 and 101. Fast motion requires an appropriate continuous method or additional validated substep sampling, with the remaining temporal limitation stated explicitly.

The uncertainty bound should account for registration, mesh approximation, numerical tolerances, and any measurement sampling effect that can legitimately be bounded. Do not hide an unbounded temporal gap inside an arbitrary small distance margin. Track temporal coverage separately from spatial uncertainty. Production ingress also needs schema checks, authenticated cache origins, duplicate-frame handling, and method-version validation before this contract is evaluated.

Repair the Cause, Not the Screenshot

The artist should receive the affected body region, animation interval, witness geometry, cache version, and neighboring frames. They might adjust topology, collision thickness, solver quality, or animation, then rebake and rerun the same inspection plan. The system must not automatically push vertices outward until the screenshot looks clean; that can introduce stretched seams or a different intersection elsewhere.

Define spatial coverage over garment regions and contact pairs: sleeve-body, hem-leg, garment-garment, and self-contact where relevant. Invisible back surfaces still matter even when the final camera never sees them, depending on the delivery requirement. Conversely, a camera-specific visual waiver should not be represented as whole-scene geometric validity. A reviewer can approve a bounded exception with explicit scope and rationale.

Enforce server-side access by project and asset permissions, especially when avatars derive from personal scans. Filenames and scene text are untrusted inputs. A model may draft a rebake request but cannot overwrite released caches. Approved changes need immutable input digests and a new output version; a timed-out publish must be reconciled before retrying. Preserve the old cache for comparison and rollback.

The code review workflow offers a useful analogy: a diagnostic finding is a review input, not permission to merge. Here, cache publication is the controlled side effect. Multiple autonomous agents rarely help this first version; a deterministic geometry adapter and one summarizer provide a clearer responsibility boundary.

Acceptance Tests and Evaluation

  • Overlap sleeve and torso bounding boxes while surfaces remain separate; do not label that fact a mesh collision.
  • Supply signed-distance output from an unsupported open mesh; require a valid narrow-phase method.
  • Omit the frame containing the elbow artifact; report temporal unknown rather than a clean interval.
  • Replace the avatar rig after baking; invalidate the previous cache comparison and review packet.
  • Put the penetration interval across the policy threshold; preserve uncertainty instead of rounding.
  • Reuse a rendered frame across several timestamps; coverage validation must detect the provenance mismatch.

Baseline against specialist inspection of evaluated meshes and frame sequences, with adjudicated contact intervals. Report detected actionable intervals divided by all adjudicated actionable intervals, false contact reports divided by all reports, and evaluated required contact-pair intervals divided by all required intervals. Group train and evaluation material by animation and asset family, not adjacent frames. Also track review time and regressions introduced by accepted fixes.

Start with one garment, one avatar, and an elbow motion designed to expose contact failures. Garment visual quality inspection addresses manufactured fabric rather than simulation. A focused AI systems engineering effort should first make stale-cache rejection and narrow-phase provenance reliable, then expand coverage without claiming more than the tested geometry supports.

Sources