Car Mirror Symmetry

examples/car-mirror-symmetry/

A stylized hatchback lofted as one half (52 stations, 13-point rings) and completed by the Mirror modifier, evaluated through the depsgraph. Wheels, lamps, grille, door mirrors and handles mirror about object origins parked on the symmetry plane; the grille is authored as a half and welded on it.

Rendered headless by the example itself. Select it to enlarge.

witnesses Mirror is a modifier, not applied data: the original keeps the authored half while the evaluated mesh is the welded, watertight, exactly symmetric whole.

tags modifiers depsgraph

runs on 4.5 LTS · 5.1 · 5.2 LTS

blender --background --python examples/car-mirror-symmetry/car_mirror_symmetry.py --

falsify it Breaks the contract on purpose and must exit 5

blender --background --python examples/car-mirror-symmetry/car_mirror_symmetry.py -- --no-mirror

A runnable example that builds a stylized hatchback as one half — a loft of 52 stations, each a 13-point half-ring from the bottom centerline out to the roof centerline — and completes it with a Mirror modifier, evaluated through the depsgraph, following depsgraph-and-evaluated-data. Wheels, headlamps, taillamps, grille, door mirrors and door handles are separate objects mirrored the idiomatic way: the object origin sits on the symmetry plane and the mesh data is offset — mirror mirrors about the object's own origin, so you offset the data, never the object. The grille is the one part authored across the plane: a half profile whose end points lie exactly on x = 0, welded into one grille by the merge.

What it witnesses: the original datablock keeps only the authored half while the depsgraph carries the mirrored whole, and both directions are closed forms:

Why the checks target the modifier, not the base: mutating a non-plane base vertex cannot break the ±X pairing — the evaluated set is always half ∪ mirror(half), symmetric by construction. Realistic failures live in the modifier (merge off, axis off, modifier applied into data, origin off the plane), which is what the probes break.

Version witness: check output is byte-identical on Blender 4.5.11 LTS, 5.1.2 and 5.2.1 LTS. Mirror, evaluated_get / to_mesh / to_mesh_clear (no argument — passing the mesh raises TypeError on both), BVHTree, and TRACK_TO constraint behavior are stable across them; only the EEVEE engine id is version-gated.

The render is the proof: hide the mirror and the still is literally half a car — one headlamp, one door mirror, half a grille, a hood cut open at the centerline. The camera stands on the key light's side, high enough to look down the hood centerline so both halves read at once. The weld itself is not a pixel witness — the hood and roof are nearly flat across the plane, so an unwelded seam renders within 12/255 of the welded one; the 2n − c count is what catches it.

Render notes: the 13-point loft reads faceted at gallery size, so the --output path — after check() has asserted every closed-form count on the Mirror-only stack — stacks a Subdivision Surface modifier (level 2) after MirrorHalf. Order matters: subdividing the half first would pull the centerline off the plane; subdividing the welded whole keeps it exact. Panel breaks stay crisp through a crease_edge attribute: every material border (glass, pillars, arch cladding, the chrome window-sill strip) creases fully and the fascia cap outlines half-crease, so the nose keeps its shape. The body is smooth-shaded with hard shading only at material borders; the separate parts keep a 40° dihedral split, and their boundary edges on the plane take the angle to their own mirror image, acos(1 − 2nₓ²), so centerlines shade smooth. The paint is candy red over a faint metallic base under a softened clear coat; the rim light is large and dim and set steep — a small bright rim mirrors in the roof as a clipped white slab, and a shallow one prints its own terminator line across the floor. Tires carry a 72-groove tread bump masked to the outward-facing band, and the rims are a half-metallic alloy (a full metal mirrors the black stage and the spokes vanish). The previous faceted loft had a thin pink-white streak on the hood by the windshield: not a seam (it sat at |x| 0.11–0.38, on the mirrored half, and all weld checks passed) but a sliver facet — the loft's greenhouse points collapsing onto the hood — flat-shaded and facing the key almost head on (n · −key = 0.967). The redesigned ring lerps a hood layout into a cabin layout, so no such sliver exists. Panel classes are by construction position: underbody, rocker and arch cladding are trim; side glass is the sill-to-glass-top segment under the roof, broken by a trim B-pillar; the drip rail becomes the A-pillar; windshield and hatch glass are the roof bands where the cabin factor ramps. The glass is a dark dielectric whose base colour ramps toward steel blue at grazing angles (Layer Weight → Color Ramp) — on a near-black stage there is little to reflect, and flat dark glass read as dull paint. Lamps, grille, mirrors and handles are closed superellipse pods seated on the skin by a BVHTree ray cast, with a chrome bezel and an inset lens rather than flat boxes.

Run#

# Cheap correctness check (no render) — the CI check:
blender --background --python car_mirror_symmetry.py --

# Falsifier: Mirror X off. Must exit non-zero (evaluated verts stay at n).
blender --background --python car_mirror_symmetry.py -- --no-mirror

# Also render a still (EEVEE on a GPU host; use --engine cycles on GPU-less hosts):
blender --background --python car_mirror_symmetry.py -- --output car.png
blender --background --python car_mirror_symmetry.py -- --output car.png --engine cycles

Exit codes#

Per-script sequential checks. 9 is a valid check code; there is no rule against it.

CodeMeaning
0Success
1Uncaught exception (FATAL wrapper)
2argparse / usage
3Body datablock is not the authored half
4Authored centerline vert count ≠ 28
5Evaluated verts ≠ 2n − c (--no-mirror lands here)
6Evaluated on-plane verts ≠ centerline; also --output produced no file
7Evaluated Euler characteristic ≠ 2
8Non-manifold edges in the evaluated shell
9Evaluated verts lack a mirrored partner
10Gallery framing violation (--output path only; gallery_framing)
11Asset-quality floor violation (--output path only; gallery_asset_quality)
12Mirrored-part origin off the plane
13Mirrored-part datablock is not the authored half (verts, faces, on-plane verts)
14Mirrored-part evaluated counts ≠ 2n − weld / 2f, or on-plane verts ≠ weld
15Mirrored-part partner check failed
16Mirrored-part evaluated mesh stayed on one side
17Mirror partner deviation above tolerance
18Evaluated bbox not symmetric about X

The blender-smoke workflow runs the check on Blender 5.2 LTS and 4.5 LTS (5.1 on the weekly cron, the needs-5.1 PR label, or manual dispatch). Smoke does not pass --output. Its catalog falsifier is --no-mirror (expects exit 5).

Source

examples/car-mirror-symmetry/car_mirror_symmetry.py View the script on GitHub →
A smooth candy-red hatchback in front three-quarter view with tinted glass, a chrome sill, five-spoke alloy wheels, and matched headlamps and mirrors either side of one centered grille.