$ show 3MFConsortium/lib3mf
lib3mf is a production-grade C++ library that implements the 3D Manufacturing Format (3MF) standard, providing read, write, validation, and conversion capabilities for 3MF files. It supports the full 3MF specification including mesh objects, beam lattices, textures, materials, colors, slice stacks, volumetric data, implicit modeling via computation node graphs, and encryption (key store, AES-GCM, RSA-OAEP). The library is cross-platform (Windows, Linux, macOS) and exposes a C++ API with auto-generated bindings for Java, Python, C#, Go, and NodeJS via the Automatic Component Toolkit (ACT). Architecture is layered: platform abstraction (streams, XML readers/writers), OPC (Open Packaging Conventions) ZIP-based package handling, version-specific XML readers/writers (v093, v100, extensions), in-memory model classes, and a public API wrapper. Key entry points are CModelReader_3MF_Native for reading and CModelWriter_3MF for writing. External dependencies include libzip (ZIP), zlib (compression), libressl (encryption), fast_float (float parsing), and cpp-base64. The codebase is well-structured with extensive use of design patterns (factory, decorator, iterator, reader node hierarchy) and includes a comprehensive test suite using Google Test.
The LLM identified 3 files worth highlighting for reuse:
Abstract base class for input streams with multiple concrete implementations (memory, file, callback, encrypted, compressed). Demonstrates a clean polymorphic stream design that can be extracted and reused in any project requiring flexible input sources.
Generic directed graph implementation with topological sort and cycle detection. Self-contained and reusable for any dependency resolution or graph analysis task.
A tree structure for efficient pair matching and deduplication, used in mesh processing to avoid duplicate edges or vertices. Demonstrates a non-obvious data structure that can be extracted for similar deduplication problems.