/3dcodeverse:c3d-urdf-jointsfrom 3dcodeverse
Guides authoring and repairing URDF joint definitions (axes, limits, clearances) for articulated objects. Explains sweep-gate logic, FK consistency, rest-penetration checks, and the arithmetic that predicts child motion from positive q.
Ships in 3dcodeverse. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When: any articulated_object round that writes or fixes src/robot.urdf (and the rest pose
in src/model.py), or that received a 3dcode joint-sweep / motion_direction finding.
The frame rule (link frame at the pivot, joint origin = pivot of the child minus the frame of
the parent, visual and collision origin = minus the pivot) is in
codeverse3d/prompts/urdf/contract.md. This skill is what the gates measure, and how to
satisfy them before the first build.
FK_TOL_M = 0.001 m). If FK at q=0 does not put every mesh back where
model.py authored it, the build stops with FkInconsistent and prints the corrected
origin. Cause is almost always a link's visual/collision origin left at 0 0 0 instead of
-pivot, or a joint with a rotated origin (rpy not 0 0 0) whose visual/collision origin
was not inverted to match.REST_PENETRATION_MAX_M = 0.005 m): the build stops with
RestPenetration.Everything else comes back as findings you still have to read.
3dcode joint-sweep poses the robot at: rest, then every movable joint alone at its lower, mid
and upper limit (others at 0), then 8 seeded random full-body combinations (seed 0) when
more than one joint moves. Continuous joints sample 0, +/-pi/2 and pi.
Severity, from sweep_findings:
| where the pair overlaps | depth | verdict |
|---|---|---|
| any pose | up to 2.0 mm | not reported (tol_m = 0.002) |
rest, or a pair joined only by fixed joints | 2.0-5.0 mm | WARN |
rest, or a fixed-joined pair | over 5.0 mm | ERROR (and fails the build) |
| any moved pose | over 2.0 mm | ERROR, whatever the depth |
So a 2.1 mm graze that only happens at one limit is scored exactly as badly as a 20 mm gouge.
Measured on the corpus: almost every finding is in a moved pose, a third of the colliding pairs never touch at rest and some appear only in a random combination — posing joints one at a time in your head is not enough: two arms that each clear the body can still meet each other.
Strong option: give every moving link more than the 2 mm the sweep tolerates, everywhere in its
envelope, and check the worst combination of joints, not the worst single joint. Fixed hardware
is different and cheap — a handle welded to a door may sink up to 2 mm with no finding at all,
because pairs joined only by fixed joints are measured once with the rest policy and never
re-judged as they move.
Attachment is checked at rest only: a fixed child must be within CONTACT_GAP_M = 0.002 of
its parent (ERROR otherwise, always); a revolute / continuous / prismatic child must be within
10 mm of its parent (WARN, ERROR beyond 30 mm) — link 'moving_jaw' slides in 'fixed_jaw_body' (prismatic joint) but the meshes are 42.5 mm apart at rest. A prismatic child
already inside the parent's bounding box (a drawer in its cavity) is exempt.
A finding tagged [approx: non-watertight mesh] is an estimate: the depth is exact only on a
watertight link mesh.
Keep the pivots in model.py and print the two origins. Record each link's world pivot (the
point you chose on its hinge line or slide axis) in a dict while building; for every joint print
the child's pivot minus the parent's (the joint origin) and the negated child pivot (the visual
and collision origin), then copy both into src/robot.urdf. The FK check confirms them within
1 mm, so a wrong line is caught by the build, not by the judge.
PIVOT = {"base": Vector((0, 0, 0))} # world pivot = link frame, recorded as each link is built
PIVOT["door"] = Vector((-0.2, -0.25, 0.4)) # a point ON the hinge line
PIVOT["handle"] = Vector((0.15, -0.27, 0.45))
for child, parent in (("door", "base"), ("handle", "door")):
print(child, "joint origin", tuple(PIVOT[child] - PIVOT[parent]), "visual/collision", tuple(-PIVOT[child]))
Hardware is geometry, not joints. A hinge barrel, a runner or a bracket lives in one of the two links it connects; it is what lets the attachment check see the child within 10 mm of its parent. A knob on a door is part of the door's mesh or a fixed child of the door — attached to the base it stays behind when the door swings, and the sweep reports the overlap.
motion_direction does not read your axis. It moves the joint positively from rest and
measures where the child link's centroid went, then asks whether that displacement is within
60 degrees of the direction the plan's motion sentence names. Probe: the limit of larger
magnitude, clamped to 0.35 rad for a rotation; the full limit for a slide.
For a revolute joint that is pure geometry:
import numpy as np
def child_moves(axis, pivot, centroid): # revolute: d ~ axis x (centroid - pivot)
d = np.cross(axis, np.subtract(centroid, pivot))
return d / np.linalg.norm(d) # prismatic: the direction IS the axis
# a lid hinged on its back top edge, centroid just above the rim
print(child_moves((-1, 0, 0), (0, 0.125, 0.351), (0, 0, 0.356)))
# [0. 0.03996804 0.99920096] -> almost pure +Z: the lid lifts UP
Verified against motion_direction_check on 2026-08-25: it reported up for axis -1 0 0 and
down for +1 0 0 on that geometry, matching the cross product's sign both times.
Two independent ways to get this wrong, and the corpus has both:
axis. The contract is explicit — never compensate by
swapping lower and upper; q=0 must stay the plan's rest pose.centroid - pivot
goes to zero: the centroid barely translates, the measured direction is noise, and the part
sweeps through its neighbour instead of swinging clear of it. The pivot must be a point ON
the hinge line._DIRS in joints_sweep.py maps the words onto the authoring frame conventions.py owns:
up = +Z, down = -Z, front = -Y, back = +Y, right = +X, left = -X. Signed-axis keys
(+y, -x, ...) name the same vectors.
tracks/articulated_object.py::expected_direction parses the plan's motion text with a fixed
precedence, and the gate is unforgiving about it:
+y, -x, ...) wins immediately;front, "inward" and
"slides in" mean back);around, rotates about, spins, a negation, either or both is skipped —
no finding either way;Make positive q go the way the plan's FIRST direction word says, even when the prose reads
loosely ("from left to right" yields left). A motion like "rotates clockwise (+Y axis)" asks
for a translation along +Y that no revolute joint about +Y can give: confirm with the
3dcode joint-sweep pose renders that the part moves as the prose describes, then leave the axis alone.
Do not flip a correct axis to chase an unsatisfiable finding.
URDF here owns physical structure only: links, joints, origins, axes, limits, visual and
collision geometry. Planning groups, end effectors, group states and disabled collision pairs
are SRDF concepts; this harness has no SRDF, so do not invent them. The URDF contract also
forbids gazebo, transmission, sensor, xacro, package:// and inline primitives. Two of
these the linter measures directly: a mesh scale attribute is a WARN ("model in meters in
model.py instead"), and a mimic joint is checked, not dismissed: the sweep drives the
joint a <mimic> names and every follower follows it, so a one-input mechanism (umbrella
ribs, scissor arms, coupled folding legs) is posed the way it really moves. Declare one
<mimic joint="<driver>" multiplier="<ratio>" offset="0"/> per follower; a coupling that
names no joint, names itself, or closes a loop is a lint ERROR.
A finish that catches everything: 3dcode build (the FK check and the rest-pose check), 3dcode joint-sweep
with a look at every joint's lower/mid/upper renders, 3dcode check-connectivity, 3dcode check-contract.
Worked repairs, the finding catalogue with real messages and the measured thresholds:
references/sweep-and-motion.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gaoypeng/3dcodeverse --plugin 3dcodeverse29 skills in this plugin
/3dcodeverseUse for ANY request to make, measure, judge or improve a 3D thing in code: a model, object or prop, a mechanism or robot with joints, a scene or environment, a shader or OpenGL effect — in Blender bpy, CadQuery, Three.js, URDF, GLSL or moderngl. This is 3D coding with the 3dcodeverse plugin: raw executable 3D code that the 3dcode instruments build, measure, render, gate and score. First step, all in ONE read: this file, skills/3d-lang-<language, hyphenated>/SKILL.md and skills/3dcodeverse/references/plan-<static|articulated|scene|graphics>.md (urdf_blender: also skills/3d-lang-blender/SKILL.md and plan-static.md, which it builds on); no c3d-* skill until a 3dcode finding or score item names its topic./3d-lang-blenderUse when writing, refining or repairing a static_object in Blender bpy (language blender): the files and builder names the lint expects, the Z-up metre frame, naming, the sandbox (allowed imports, forbidden bpy calls), the exact thresholds check-contract / check-connectivity / detail_budget measure, what the GLB exporter keeps, the Blender 5.2.2 API traps, and the 3dcode loop that ships it./3d-lang-cadqueryUse when writing, refining or repairing a static_object in CadQuery (language cadquery): the module-level `result` assembly the wrapper reads, named parts and instances, the Z-up metre frame, the lint's import and call lists, the thresholds check-contract / check-connectivity / detail_budget measure, the OCC kernel facts that fail a build, and the 3dcode loop.Other plugins' skills for the same job