Skip to content

Feat: improve visual consistency of exported mesh - #1

Merged
jkkicks merged 1 commit into
mainfrom
consistent-visual-style
Apr 16, 2026
Merged

jkkicks merged 1 commit into
mainfrom
consistent-visual-style

Conversation

@jkkicks

@jkkicks jkkicks commented Apr 16, 2026

Copy link
Copy Markdown
Contributor
  • Add ensure_vertex_normals() to app/services/converters/__init__.py; uses trimesh to compute per-vertex normals when a converter leaves them empty (IGES was the primary offender)
  • Call ensure_vertex_normals() in ConversionPipeline.convert() after converter.read() so every format is normalised before export
  • Define canonical PBR constants in gltf_exporter.py (baseColor=#CCCCCC, metallic=0, roughness=0.45, doubleSided=true) and apply them via trimesh.visual.TextureVisuals(PBRMaterial(...)) on the primary export path
  • Extend _export_with_pygltflib fallback to include the same material, set primitive.material = 0, and write a NORMAL accessor when normals are present, matching the primary path output

…ent upload types

- Add `ensure_vertex_normals()` to `app/services/converters/__init__.py`;
  uses trimesh to compute per-vertex normals when a converter leaves them
  empty (IGES was the primary offender)
- Call `ensure_vertex_normals()` in `ConversionPipeline.convert()` after
  `converter.read()` so every format is normalised before export
- Define canonical PBR constants in `gltf_exporter.py`
  (baseColor=#CCCCCC, metallic=0, roughness=0.45, doubleSided=true) and
  apply them via `trimesh.visual.TextureVisuals(PBRMaterial(...))` on the
  primary export path
- Extend `_export_with_pygltflib` fallback to include the same material,
  set `primitive.material = 0`, and write a NORMAL accessor when normals
  are present, matching the primary path output
@jkkicks
jkkicks merged commit 4b340e4 into main Apr 16, 2026
6 checks passed
@jkkicks
jkkicks deleted the consistent-visual-style branch April 16, 2026 19:13

This branch was successfully deployed

1 active deployment
Preview — 8840fdd5 Deployed Apr 16, 2026 by vercel[bot]
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.

1 participant