Skip to content

Metric UVs on pulled meshes - #31

Merged
robDL89 merged 2 commits into
mainfrom
claude/pull-metric-uv
Oct 22, 2026
Merged

robDL89 merged 2 commits into
mainfrom
claude/pull-metric-uv

Conversation

@robDL89

@robDL89 robDL89 commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Revit sends no UVs: a pulled mesh needed an unwrap per object before it could take a texture, and Unreal had nothing to build lightmap UVs from (Roberto's flow goes Blender -> Unreal -> Quest 3 over Link).

Every mesh built by the pull (elements, shared instance meshes, linked models) now gets a UVMap in meters:

  • each face projected on its own plane, so a wall at 45 degrees is not stretched (box mapping would shrink it to 71%);
  • u horizontal on walls and roofs, v up the face, so bricks and boards stay level;
  • within 5 degrees of horizontal, world X and Y, so floors and gentle ramps stay square to the building;
  • instance meshes are mapped in the family's frame and turn with the instance.

Regenerated on every pull like the mesh. Known limit: curved surfaces break slightly between faces.

bridge_uv.py is pure numpy (Blender ships it), tested under pytest; numpy added to the CI Python job. smoke_pull checks the map on a flat element, an instance and a linked element.

Cost, Blender 5.2: 8000 tiny linked elements 1.8 s -> 2.5 s (about 0.2 ms per mesh built); 980k triangles in 0.5 s.

🤖 Generated with Claude Code

rdarch-admin and others added 2 commits October 22, 2026 18:19
Revit sends no UVs, so a pulled mesh could not take a texture without an
unwrap per object, and Unreal had nothing to build lightmap UVs from.
Every mesh built by the pull (elements, shared instance meshes, linked
models) now gets a UVMap in meters: each face projected on its own plane,
u horizontal on walls and roofs, world X and Y within 5 degrees of
horizontal. Computed with numpy, which Blender ships: about 0.2 ms per
tiny mesh, half a second for a million triangles.

numpy is added to the CI Python job for the new tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The metric UVMap becomes a scene choice, saved with the .blend like the
reset-transform one: on by default, off for whoever unwraps their own
way. Shared instance meshes and linked models follow it too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@robDL89
robDL89 merged commit 9187cc3 into main Oct 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants