-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added basic 3mf export #500
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #500 +/- ##
=======================================
Coverage 90.34% 90.34%
=======================================
Files 35 35
Lines 4414 4414
=======================================
Hits 3988 3988
Misses 426 426 ☔ View full report in Codecov by Sentry. |
I am jealous of @elalish and how good manifold has become and how quickly. Also thanks @pca006132 for taking this over the finish line :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
vertices[i * 3 + j] = mesh.vertProperties[i * mesh.numProp + j]; | ||
} | ||
const model = | ||
to3dmodel({simple: [{vertices, indices: mesh.triVerts, id: '1'}]}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always generate the 3MF from result
rather than the nodes, which means the 3MF could be very different from the glTF we generate (and show to the user). 3MF supports a scene hierarchy much like glTF - can we write those transforms using to3dmodel
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can, but I am not very familiar with this. We probably need to look into the 3mf spec about how to specify the hierarchy and materials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may get complicated. What about leaving this to a follow up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, actually it looks like we also need a small change in to3dmodel
- @hrgdavor where can we file issues and/or make PRs to 3mf-export
? Looking at your code, it appears a component tree can't be exported correctly because it places every component in the build, rather than just the root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code is in this repo https://github.com/hrgdavor/jscadui/
3mf export part is here https://github.com/hrgdavor/jscadui/tree/main/file-format/3mf-export
Suggestions and PR's are welcome
@@ -48,7 +48,8 @@ | |||
</div> | |||
</div> | |||
<button type="button" id="compile" class="margin green" disabled><span>Run</span></button> | |||
<button type="button" id="download" class="blue margin">Save GLB</button> | |||
<button type="button" id="glb" class="blue margin">Save GLB</button> | |||
<button type="button" id="threemf" class="blue margin">Save 3MF</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To save UX space and in case other formats get added later, it would be nice to combine these into a drop-down like the examples. I can also do this as a follow-on if you'd rather.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh it seems that the dropdown you are using is very manual. I thought that it would be some sort of a reusable component similar to bootstrap.
Not sure what is the cleanest way of implementing this, I guess I will leave it for another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely want to tweak the UX and get the node hierarchy exporting, but probably best not to block this one. I haven't had a chance to test it, so please give it a good prodding before merging.
* added basic 3mf export * updated worker test * fixes * formatting * fix
Closes #452.
The 3mf export is now run together with glb export, it seems that it doesn't take much time (0.2s for gyroid) so I did not bother to make it async.