Hi guys,
I’m trying to create a .3dm file from a set of vertices and faces and ran into a problem where the file gave the “file.3dm is not a Rhino m_archive” error when opening in Rhino. Upon further investigation it seems as if this error occurs only when creating a mesh and adding 6 or more vertices with the mesh.vertices().add() function. It’s probably worth noting that sending the resulting file to a rhino.compute instance successfully produces an output, making me guess that there could be an issue in the filewrite.
I used the following code:
rhino3dm().then((r) => {
rhino = r;
let doc = new rhino.File3dm();
let mesh = new rhino.Mesh();
let vert0 = mesh.vertices().add(1.0,1.0,1.0);
let vert1 = mesh.vertices().add(2.0,1.0,1.0);
let vert2 = mesh.vertices().add(3.0,1.0,1.0);
let vert3 = mesh.vertices().add(4.0,1.0,1.0);
let vert4 = mesh.vertices().add(2.0,1.0,1.0);
let vert5 = mesh.vertices().add(6.0,1.0,1.0);
let vert6 = mesh.vertices().add(7.0,1.0,1.0);
doc.objects().add(mesh, null);
fs.writeFileSync(__dirname + '/mesh.3dm', doc.toByteArray());
commonSolve(inputs);
})
and these dependencies:
“compute-rhino3d”: “^0.13.0-beta”,
“rhino3dm”: “^0.14.0”
When you run it with vert5 & 6 commented out, it should result in a perfectly fine file, but with 5 and/or 6 active, your file should not be usable.
It’s my first post here, so I hope I explained everything clearly enough!