## 01 · The invisible geometry problem

Let's look at the invisible geometry problem using a real-to-sim experiment. An assembly can look perfect in the viewer and still collide with a surface centimeters before the visible fingertip arrives. That is not necessarily a mysterious solver defect. It is often the shape, placement, or collision mask of an unseen geom.

Think of three representations: the rendered mesh used for appearance, the collision geom used by the dynamics engine, and the measured object the real robot actually touches. All three have different purposes and levels of approximation.

Watch the animation carefully as we change only one part of the setup. Begin with a gripper reaching a simple box on a table. Draw the visual triangles, collision proxies, contact points and coordinate axes in different colors. Advance in millimeter steps and record the first contact pair and signed separation.

A particularly seductive mistake is correcting early contact by lowering stiffness or increasing friction. That hides a geometric mistake behind different physical parameters.

Start with the reported contact distance, then compare a projected contact point to the visible fingertip. An error consistent across every approach direction suggests an offset or scale. A discrepancy that changes around edges points toward approximation or topology. A problem that appears only after release suggests dynamics rather than first-touch geometry.

Verify which exact body and geom pair establishes first contact; compare their frames and dimensions with a physical measurement before changing contact tuning.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

The goal is an engineering test that can fail for an understandable reason.

## 02 · What the renderer sees

Our next diagnostic is what the renderer sees. Render meshes are normally optimized for appearance. They may include bevels, decorative openings, dense subdivisions or separated components that would be inefficient or unstable as collision shapes.

Triangle count by itself does not determine contact correctness. Surface orientation, watertightness, thin walls, self-intersection, scale and object origin can all alter the shape a collision algorithm effectively receives.

The important thing here is to separate an observation from an explanation. Toggle a transparent high-resolution visual shell over an opaque fitted convex proxy. Sweep a virtual probe across the rim, edge and broad face; map distance errors by region.

A mesh may look like a concave jaw while a single convex hull bridges its opening. With that shape the simulator makes contact where a real finger could pass through empty space.

A useful geometric error is the maximum surface distance over the actual contact patch, not the average distance over decorative mesh elements. Weight tests by likely approach directions, and deliberately test a fingertip entering every concavity that the real tool could access.

For each task-relevant region, measure a signed distance and test the approach directions that actually occur in the real manipulation.

Watch the geometry in the left workcell while the digital approximation is shown beside it. The invisible part is what the solver actually queries. If the two bodies appear to intersect in the renderer, that alone tells us neither the contact impulse nor the separation returned by the engine.

Notice that the image is evidence of a hypothesis, not a substitute for measurement.

## 03 · Frames, units and placement

In this scene, frames, units and placement is our focus. Geometry cannot be evaluated until we know exactly where it lives. A good bounding box in the wrong frame is a bad collision model.

CAD imports can change axis conventions, unit scale, handedness and nested transforms. Body, joint, visual, collision and inertial frames should be recorded separately. A transform order mistake is particularly hard to notice when the object is symmetric.

Here is how I would turn this into a reproducible experiment. Add an asymmetric marker to a robotic link and transform it through parent body, child link and collider origins. Display both transform multiplication orders and compare the resulting probe position.

Never silently fix a hundredfold size error by moving contact offsets. A scale error also changes implied volume, mass and inertia, often by different powers of scale.

For a direct transform test use a point that is not on any symmetry axis. Evaluate its position through the frame chain, then invert the full transform. The recovered local coordinates should agree within numerical tolerance. If that fails, collision debugging must wait.

Check one known physical dimension with calipers, one asymmetric direction with an explicit frame test, and a round-trip point transform with bounded numerical error.

First inspect the candidate contact bodies without movement. Then advance them under a known commanded pose. Finally remove every material and controller change not required to observe the geometry. A repeatable first-touch discrepancy is much easier to fix than an intermittent failed grasp.

Keep the original trial and the counterexample in the record; both teach us something.

## 04 · Who is allowed to touch?

Let's look at who is allowed to touch? using a real-to-sim experiment. Collision detection is usually more than a geometric proximity test. There is a broadphase to select candidate pairs, a narrowphase to compute contact geometry and user rules that decide which pairs are eligible.

Disabled contacts can resemble tunneling; accidental self-contacts can resemble joint friction or a motor stall. In MuJoCo, geom contype and conaffinity, exclusions, and body hierarchy affect the candidate pairs; other engines use layers, masks and pair filters.

Before fitting anything, verify the definitions of the quantities on screen. Color every candidate pair gray, eligible pairs cyan and active contacts amber. Close a gripper around a block, then enable one filter rule at a time and record the first newly active pair.

Turning all collisions on is not universally safer. Neighbors of a tightly coupled mechanism may need intentional exclusions, but those exclusions must not hide finger-to-object interactions.

In a pair-mask matrix, each row is a geom and each column is another geom. Write the expected eligibility before running the engine; then compare it with observed contacts. This makes an accidentally filtered necessary pair visible as a concrete test failure.

Deliver an explicit pair matrix and a test that would fail if a required finger-object pair were missing or a forbidden pair became active.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

If those checks disagree, stop and fix the assumption before continuing.

## 05 · Contact normals and manifolds

Our next diagnostic is contact normals and manifolds. When geometry is colliding, the next question is not simply whether a red dot appears. We need to know where the contact point is, which bodies it joins and which normal direction defines the response.

A solver works with a contact normal, distance or penetration measure, and a local tangent basis for friction. Multiple valid nearby contacts can form a manifold. Small changes in polygon topology can change that manifold discontinuously.

We're going to test this rather than treat it as a cosmetic adjustment. Move a rounded probe over a box face, edge, then corner. Show the normals and contact locations as the probe crosses each feature. Inspect the resulting force and torque about the center of mass.

A normal that flips unexpectedly, or a single contact far from the visible intersection, is a stronger geometry clue than the gross motion of the object.

The contact force is not a free-floating arrow: it is a wrench contribution. Translating the force application point while keeping its direction fixed can change angular acceleration, even if total force stays constant. That is why a small normal-position error matters.

Check contact location in world coordinates and geometry-local coordinates, then compare expected lever arms and force directions against the measured wrench.

Watch the geometry in the left workcell while the digital approximation is shown beside it. The invisible part is what the solver actually queries. If the two bodies appear to intersect in the renderer, that alone tells us neither the contact impulse nor the separation returned by the engine.

That is how a visually convincing demonstration becomes an experimentally defensible claim.

## 06 · Convex and primitive baselines

In this scene, convex and primitive baselines is our focus. Before debugging a thousand-triangle collision mesh, ask whether two primitives can reproduce the same failure. Primitive boxes, capsules, spheres and cylinders give us controllable geometry and known support directions.

A complex concave assembly is often better approximated by a union of smaller convex shapes than by one convex hull. The right number of pieces depends on task-relevant gaps, contact accuracy and solver budget.

Watch the animation carefully as we change only one part of the setup. Replace the troubled finger with one box. Reproduce the approach trajectory, then add a second small capsule where the fingertip pad belongs. Measure the change in first contact and the number of active points.

The purpose is not to make the scene look more lifelike. It is to isolate whether the failure follows topology, size, frame alignment, material parameters or the numerical solver.

Convex decomposition should preserve grasp affordances. Check holes, narrow slots and fingertip pockets explicitly; a convex hull over the entire geometry can bridge them. Use the fewest pieces that preserve the relevant collisions at measured accuracy.

Keep a simple primitive regression scene permanently, and require the complex model to match it on cases where the approximations should agree.

First inspect the candidate contact bodies without movement. Then advance them under a known commanded pose. Finally remove every material and controller change not required to observe the geometry. A repeatable first-touch discrepancy is much easier to fix than an intermittent failed grasp.

The goal is an engineering test that can fail for an understandable reason.

## 07 · Reading contact diagnostics

Let's look at reading contact diagnostics using a real-to-sim experiment. A simulator gives us contact state for inspection, not merely an image of a collision. In MuJoCo, mjData holds contact records while the compiled mjModel contains the resolved geom definitions.

Inspect geom identifiers, contact position, contact frame, contact distance and the number of active contacts. Force queries must respect solver coordinates and conventions; never assume a plotted contact force vector is directly in world coordinates.

The important thing here is to separate an observation from an explanation. Advance the model in controlled increments and print a compact log: simulation time, geom one, geom two, contact distance, world position and normal. Highlight records as they appear and disappear.

A blank contact list can mean filtered pairs, separated geometry or uninitialized state. A huge contact list can indicate poor proxy decomposition or interpenetrating initial conditions.

In a diagnostic log, include geom names in addition to integer indices. A numerical contact record is valid only at a particular compiled model version. If the model changes, array indices may no longer refer to the same geometry.

Include a known positive-contact case and a known negative-contact case in a short automated diagnostic test.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

Notice that the image is evidence of a hypothesis, not a substitute for measurement.

## 08 · Separate shape from solver behavior

Our next diagnostic is separate shape from solver behavior. Geometry and numerical integration can produce similar-looking symptoms. A sinking foot may come from a collider placed above its sole, from a compliant contact model or from an excessively large timestep.

Use a disciplined isolation sequence: freeze or drive the body kinematically, inspect penetration at rest, substitute a primitive collider, simplify to one pair, then vary solver settings one parameter at a time.

Here is how I would turn this into a reproducible experiment. Start with a cube supported on one table collider. Hold the pose constant, check gap and normals, then release dynamics and record contact impulse and displacement while reducing timestep.

If the error persists with the body fixed, changing solver iterations will not relocate the misplaced collider. If it appears only after dynamics starts, numerical details may matter.

One good tactic is to step into contact quasi-statically, freeze the model, then recompute signed distances independently where possible. This distinguishes first-touch geometry from solver behavior under load. Never tune both categories simultaneously.

Report both a static geometry check and a dynamic convergence check before claiming the root cause has been found.

Watch the geometry in the left workcell while the digital approximation is shown beside it. The invisible part is what the solver actually queries. If the two bodies appear to intersect in the renderer, that alone tells us neither the contact impulse nor the separation returned by the engine.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

Keep the original trial and the counterexample in the record; both teach us something.

## 09 · Adversarial contact cases

In this scene, adversarial contact cases is our focus. A contact model that works for a broad flat tabletop may fail on a bevel, narrow lip, cavity or near-tangent approach. Validation must include difficult encounters outside the calibration examples.

Assemble a matrix of face, edge and corner approaches, varying orientation, load and speed. Where real measurements exist, compare first-touch displacement, slip onset and object rotation, not just whether the animation appears plausible.

Before fitting anything, verify the definitions of the quantities on screen. Take the gripper to a new object pose that was not used when choosing the convex proxies. Inspect whether contact appears on the intended fingertips instead of a hidden wrist or fixture.

It is easy to overfit geometric tolerances to a single grasp and conceal systematic pose errors. A successful test must predict unseen approaches.

The holdout cases should include orientations that create new contact topologies, not just more repetitions of the same flat face. A new edge case is informative precisely because it can reveal a wrong hull or missing collider.

Freeze geometry and collision filter choices, run independent test contacts, and preserve signed error statistics per surface region.

First inspect the candidate contact bodies without movement. Then advance them under a known commanded pose. Finally remove every material and controller change not required to observe the geometry. A repeatable first-touch discrepancy is much easier to fix than an intermittent failed grasp.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

If those checks disagree, stop and fix the assumption before continuing.

## 10 · Build a reproducible debug report

Let's look at build a reproducible debug report using a real-to-sim experiment. Finishing collision debugging means another engineer can reproduce the failure, not merely that one screenshot looks correct.

The evidence bundle should identify the exact source asset and SHA or version, units, collider dimensions, frame hierarchy, filter masks, engine version and time step. Include contact logs and a minimal deterministic reproduction.

We're going to test this rather than treat it as a cosmetic adjustment. Prepare before-and-after overlays of first-touch geometry and a table of changed parameters. Re-run baseline, edge, and corner cases with the same starting conditions and include both successes and remaining failures.

Avoid burying unresolved topology errors in a final visual polish pass. When a approximation is intentionally imperfect, document the affected orientations and task boundary.

When exporting the report, include one view with all collision geoms made opaque and visuals hidden. Include another with first-touch positions and normals. These two pictures help locate the discrepancy without relying on a cinematic rendering.

Ship a compact regression test with pass criteria, a change log, a minimal model and an honest scope statement for what the collision model can predict.

We should be able to name the source file, scale, transformation and intended solid geometry for this collider. That provenance matters because a late import-stage correction may change all four. Never rely on a color overlay without a dimension check.

That is how a visually convincing demonstration becomes an experimentally defensible claim.