Skip to content

Refine OBJ exporter#108

Open
Aime23 wants to merge 5 commits intoJuliaIO:masterfrom
3Dmap-fr:fix/obj-save
Open

Refine OBJ exporter#108
Aime23 wants to merge 5 commits intoJuliaIO:masterfrom
3Dmap-fr:fix/obj-save

Conversation

@Aime23
Copy link

@Aime23 Aime23 commented Jun 20, 2025

This PR refines the OBJ exporter to be closer to the OBJ specification, allowing greater compatibility with other software.

Key changes:

  • Handling of variable-length UV coordinates (u, uv, and uvw)
  • Tests for variable-length UV coordinates
  • Properly writes face reference numbers for texture vertex and vertex normals in the format v/vt/vn, addressing issue loading with software like Blender and ThreeJs

Aime23 added 5 commits June 19, 2025 17:25
The obj spec define the statement *vt* as :
vt u v w
With *u* being the only one required.

The current writer only handled case with u and v defined.
The current write only outputs `f v1 v2 v3`
However, the obj spec says that f should also reference texture vertices index and vertex normal index in the format `f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3`
Furthermore, the spec allow leaving the texture vertices spot empty if there is only vertex normal with the format `f v1//vn1 v2//vn2 v3//vn3`.
Both vt and vn are optional if there is no vertex data.

Software like Blender and ThreeJs does not load the texture vertices from a MeshIO.jl exported obj.
@codecov
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.16%. Comparing base (8102339) to head (71a7601).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
+ Coverage   74.82%   75.16%   +0.33%     
==========================================
  Files          10       10              
  Lines         735      745      +10     
==========================================
+ Hits          550      560      +10     
  Misses        185      185              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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