Add AMF to understood extensions/formats.

This commit is contained in:
Ian Rees 2017-02-04 12:05:51 +13:00 committed by wmayer
parent 7a0a997481
commit ff1ac5fdad
4 changed files with 16 additions and 1 deletions

View File

@ -299,6 +299,16 @@ private:
MeshObject global_mesh;
auto exportFormat( MeshOutput::GetFormat(EncodedName.c_str()) );
// Currently, AMF is the only export format where we export separate meshes
// into the same file.
auto combineMeshes( exportFormat != MeshIO::AMF );
if (!combineMeshes) {
Base::Console().Message("AMF Export isn't quite supported yet.");
return Py::None();
}
Py::Sequence list(object);
Base::Type meshId = Base::Type::fromName("Mesh::Feature");
Base::Type partId = Base::Type::fromName("Part::Feature");

View File

@ -1628,6 +1628,9 @@ MeshIO::Format MeshOutput::GetFormat(const char* FileName)
else if (file.hasExtension("nas") || file.hasExtension("bdf")) {
return MeshIO::NAS;
}
else if (file.hasExtension("amf")) {
return MeshIO::AMF;
}
else {
return MeshIO::Undefined;
}

View File

@ -53,7 +53,8 @@ namespace MeshIO {
NAS,
PLY,
APLY,
PY
PY,
AMF
};
enum Binding {
OVERALL,

View File

@ -13,3 +13,4 @@ FreeCAD.addExportType("Binary Mesh (*.bms)","Mesh")
FreeCAD.addExportType("Alias Mesh (*.obj)","Mesh")
FreeCAD.addExportType("Object File Format Mesh (*.off)","Mesh")
FreeCAD.addExportType("Stanford Triangle Mesh (*.ply)","Mesh")
FreeCAD.addExportType("Additive Manufacturing Format (*.amf)","Mesh")