New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC 2017] Support 3MF Format Read/Write. #4046

Merged
merged 125 commits into from Sep 4, 2017

Conversation

Projects
None yet
3 participants
@Samir55
Member

Samir55 commented Jun 24, 2017

3MF is generally smaller than other comparable 3D formats where transforms and object references are supported. 3MF has an advantage over the STL format since STL doesn’t contain color or material/property and also it doesn’t have mesh topology which in turn results in larger file size.
This topic was discussed in this original issue: #2811

Features:

  • Import/Export to 3MF files command line options.
  • Export plate with modifiers and print configs in .3MF (GUI).
  • Export selected objects with modifiers print configs in .3MF (GUI).

The test suite is found in 23_3mf.t in xs/t/.
The code is documented using Doxygen syntax.

Related Links:

  • The GSoC project blog (A dedicated issue): #3934
  • 3MF Document Specification wiki page I've written summarizing the 3MF format core specification.
  • Project Plan containing Deliverables and what Slic3r should support.

Other Pull Requests:

Samir55 added some commits May 30, 2017

call IO::TMF:write function with the read model and the output file i…
…n slic3r.cpp

Fix miniz.c error:
 * Miniz source functions were included more than once (once during TMF.cpp and once during compiling miniz.c in /xs/src/miniz.
 * Miniz is a header file library.
 * Solution was to add #define MINIZ_HEADER_FILE_ONLY to include the header part of the single header library miniz.c.
- Create a Zip archive contating a 3dmodel.model file conatining a ba…
…sic string.

- Remove #define #define MINIZ_HEADER_FILE_ONLY in the previous commit ( It's not the solution)
Renaming miniz.c to miniz.h, if you want to include it in other file …
…use #define MINIZ_HEADER_FILE_ONLY before including it.
Fix CMakeLists.txt zip library error:
Add zip lib to target_link_libraries.
Add 3MF Read/Write Structure.
I think this makes TMF read/write more modular.
Add 3MF Types and OPC relationships.
* Write types in "[Content_Types].xml" at /
* Create "_rels" folder at /
Write Model Volumes of each object in the 3MF Document.
* write <triangles> element representing the volumes of each object.
* Refactoring removed Camel Case style.
* Adding ModelObject part number attribute (Specific to the new 3MF format).
Fix ContentTypes.xml file causing 3D Builder not to load the file.
* xmlns schema link added to < Types > element.
* Write Slic3r metadata version.
* Write ModelMaterials custom config data.
* Fix ModelInstance transformation matrix in < build > element. The p…
…roblem was that 3MF 3d matrices were row major matrices.
Some Refactoring:
* Add namspaces as constant map<string, string> carrying name of namspace and the link to the namespace.
*Fix std::map namespaces. I was using [] operator to access the map v…
…alues but according to c++11 I must use .at(key) to compile.
@Samir55

This comment has been minimized.

Member

Samir55 commented Aug 19, 2017

@alexrj, @lordofhyphens I have updated the code according to the link you have provided in IRC and I have used also -Weffc++ and -Wextra flags to see warnings. There were only warnings about TMFEditor and TMFParserContext not having their override versions of copy constructor and =operator overloading. I will implement them when I wake up, I don't see any need for them in our case, however.

@Samir55

This comment has been minimized.

Member

Samir55 commented Aug 19, 2017

@alexrj @lordofhyphens If there are any improvements I should do please tell me :)

@Samir55 Samir55 changed the title from GSoC Support 3MF Format Read/Write. to [GSoC 2017] Support 3MF Format Read/Write. Aug 21, 2017

Samir55 added some commits Aug 21, 2017

* Remove zip library.
* Add Slic3r::ZipArchive class to handle creating zip files.
* Split ZipArchive class to .cpp and .hpp
* Add Doxygen documentation to ZipArchive class.
* Update MANIFEST file/
* Update CMakeLists.txt file
@lordofhyphens

This comment has been minimized.

Member

lordofhyphens commented Sep 3, 2017

Not in MANIFEST: t/23_3mf.t
Not in MANIFEST: t/models/3mf/box.3mf
Not in MANIFEST: t/models/3mf/chess.3mf
Not in MANIFEST: t/models/3mf/FaceColors.3mf
Not in MANIFEST: t/models/3mf/gimblekeychain.3mf
Not in MANIFEST: t/models/3mf/SplitPyramid.3mf
Not in MANIFEST: t/models/amf/FaceColors.amf.xml
Not in MANIFEST: t/models/stl/gimblekeychainExtended.stl
Not in MANIFEST: t/models/stl/spikey_top.stl
MANIFEST appears to be out of sync with the distribution

@Samir55 probably should add these files to the MANIFEST file.

@Samir55

This comment has been minimized.

Member

Samir55 commented Sep 3, 2017

I've added the test files to the MANIFEST But these files should be removed from the repo (they are no longer used)

t/models/3mf/FaceColors.3mf
t/models/3mf/SplitPyramid.3mf
t/models/stl/gimblekeychainExtended.stl

@lordofhyphens sorry I forgot to add them :)

@lordofhyphens

This comment has been minimized.

Member

lordofhyphens commented Sep 3, 2017

@Samir55 Then you should git rm everything that shouldn't be in the repo and remove from MANIFEST.

@Samir55

This comment has been minimized.

Member

Samir55 commented Sep 3, 2017

  • t/models/3mf/FaceColors.3mf It was removed using unlink() function I've added in this commit . It is generated only when the test is run.
  • t/models/3mf/SplitPyramid.3mf this file was generated during a test I deleted later at this commit .
  • t/models/stl/gimblekeychainExtended.stl was a file generated also by 3mf test (conversion from gimblekeychainExtended.3mf to STL) and I've removed that file in that commit
    @lordofhyphens I mean they are only on your branch.
@lordofhyphens

This comment has been minimized.

Member

lordofhyphens commented Sep 3, 2017

Well, that would do it ;)

@alranel

alranel approved these changes Sep 4, 2017

@alranel alranel merged commit 5cd9ecb into slic3r:master Sep 4, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment