Prepping for stl and iges file import apis to be implemented

This commit is contained in:
Mike Molinari 2023-02-04 07:09:20 +00:00
parent 04a6e518ec
commit a270e76692

View file

@ -101,10 +101,23 @@ export const ImportModelOperation: OperationDescriptor<ImportModelParams> = {
});
// //IGES import
// FS.writeFile("newIgesObject", rawContent);
// oci.readbrep()igesread("newIgesObject", "newIgesObject");
// returnObject.created.push(occ.io.getShell("newIgesObject"));
FS.writeFile("newIgesObject", rawContent);
oci.igesread("newIgesObject", "newIgesObject");
returnObject.created.push(occ.io.getShell("newIgesObject"));
} else if (FileName.endsWith("STL") ){
throw new CadError({
kind: CadError.KIND.INVALID_INPUT,
code: 'STL is not supported yet'
});
FS.writeFile("newSTLFile.stl", rawContent);
oci.readstl("mesh", "newSTLFile.stl");
oci.unifysamedom("cleanedSTL", "mesh")
returnObject.created.push(occ.io.getShell("cleanedSTL"));
} else {
throw new CadError({
kind: CadError.KIND.INVALID_INPUT,