Open Floppy opened 6 months ago
Getting there with this; it now generates valid 3MF files. Just working on getting the child object traversal and relationships right, because at the moment running the example produces a version of male02.obj
without various parts, which is... suboptimal :)
OK, the root cause of my problem is in the OBJ loader, rather than the 3MF output, and I've filed it for a rainy day as https://github.com/danini-the-panini/mittsu/issues/123.
I'll update the converter example to use a simpler model, and then this should be done, at least for an initial basic form.
OK, working 3MF export is ready! There are probably plenty of edge cases to find, but as an MVP, I'm happy with it.
This is also green now, I was missing a gem dependency for rexml
.
@danini-the-panini it's just occurred to me that while I'm writing mesh analysis code in https://github.com/manyfold3d/manyfold/pull/1981/files#diff-b33a35020b14550d6b315e9628edd985f88159a26555ab2f4027358e592ebfab, this is actually required to check that meshes are valid for 3MF files before exporting. Would you like me to PR that stuff into the mittsu core? It checks that meshes are manifold, and that they aren't inside out.
As in, generic manifold checks for all meshes? I'm not sure that's necessary, since inside out meshes are useful in some cases, and are still valid in mittsu
Yeah, that's what I was thinking, it's probably too specific as those things are totally valid unless you're trying to bring things into the real world. I wonder if that has similar implications for this PR, because it currently could produce invalid 3MF files.
What with 3mf being non-threejs functionality, that might be another argument that this should be in a separate extension gem, not core.
No i think it's fine in Core, at least for now
My current need for Mittsu is to be able to convert files into more efficient forms, as a feature for https://manyfold.app. So, I'm working on a 3MF exporter. This is NOT an existing THREE.js feature, so you may want it to be in a separate addon gem - up to you.
It adds two dependencies;
builder
which was already a transitive dependency fromminitest
, andrubyzip
which is completely new. It also usesrexml
in dev for testing the output.THREE.js annoyingly uses
parse
for exporting which makes no sense; I've rename itexport
and madeparse
an alias for consistency with the original.