Skip to content
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

Merged
merged 5 commits into from
Jul 27, 2023
Merged

added basic 3mf export #500

merged 5 commits into from
Jul 27, 2023

Conversation

pca006132
Copy link
Collaborator

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.

@pca006132 pca006132 requested a review from elalish July 20, 2023 15:43
@codecov
Copy link

codecov bot commented Jul 20, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (a8626f9) 90.34% compared to head (90a8bfd) 90.34%.

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           

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hrgdavor
Copy link

I am jealous of @elalish and how good manifold has become and how quickly. Also thanks @pca006132 for taking this over the finish line :)

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

bindings/wasm/examples/worker.ts Outdated Show resolved Hide resolved
vertices[i * 3 + j] = mesh.vertProperties[i * mesh.numProp + j];
}
const model =
to3dmodel({simple: [{vertices, indices: mesh.triVerts, id: '1'}]});
Copy link
Owner

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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?

Copy link
Owner

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.

Copy link

@hrgdavor hrgdavor Jul 20, 2023

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>
Copy link
Owner

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do this

Copy link
Collaborator Author

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.

bindings/wasm/examples/worker.ts Outdated Show resolved Hide resolved
Copy link
Owner

@elalish elalish left a 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.

bindings/wasm/examples/worker.ts Outdated Show resolved Hide resolved
@elalish elalish merged commit 59760b3 into elalish:master Jul 27, 2023
@elalish elalish mentioned this pull request Jul 28, 2023
@pca006132 pca006132 deleted the 3mf-export branch August 15, 2023 12:54
@elalish elalish mentioned this pull request Nov 3, 2023
cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
* added basic 3mf export

* updated worker test

* fixes

* formatting

* fix
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.

Add 3MF export to manifoldCAD.org
3 participants