3MF export
pca006132 opened this issue · comments
From elalish/manifold#626
Hi, it seems that the object id has to be at least 1, lib3mf cannot recognize things with id 0.
The _rels/.rels
is mandatory, we can remove the thumbnail line if we don't want a thumbnail.
oh the object id thing is set by us, but maybe you can add a documentation about the id has to be non-zero
ok, thanks for the hints, I could even throw an error if id is zero and add a bit in docs.
Do you plan to fix them and release a version soon? If yes, I can wait for your release without having to use this ugly workaround:
files[fileForRelThumbnail.name] = strToU8(
// remove the thumbnail line
fileForRelThumbnail.content.split('\n')
.filter((line: string) => line.indexOf('thumbnail') == -1)
.join('\n'));
oh, ok I see. You are currently removing the thumbnail from 3mf export... I thought you were adding the thumbnail :)
.. np, I can make a version today, tomorrow that allows export without thumbnail, and keeps the mandatory rel file.
Thanks. In order to make a thumbnail we need access to the canvas, but we are currently making the 3mf file in a worker. I am not familiar with js stuff so I just decided to remove the thumbnail :)
@pca006132 I created 0.5.0
version that handles ref differently.
instead of it being a static file thre is new class: FileForRelThumbnail
that has getter for proeprties name and content,
but the content is generated based on sate (added files).
instad of just importing fileForRelThumbnail
, import anduse FileForRelThumbnail
class
const fileForRelThumbnail = new FileForRelThumbnail()
//...
fileForRelThumbnail.add3dModel('3D/3dmodel.model')
//.. if you have thumbnail, add it
fileForRelThumbnail.addThumbnail('Metadata/thumbnail.png')
this way only refs actually used will be present in _rels/.rels
Thanks. Updated in manifold now.