The ruby3mf gem provides an API for parsing and validating 3MF files. It includes a logging mechanism that enables developers to programmatically check a 3MF file for warnings or errors and respond in whatever way is appropriate for their application. Ruby3mf checks everything in the 3MF core specification, from making sure that the 3MF package contains all content in the right format needed to print the file, to verifying that the geometry represents a manifold solid without holes or incorrectly oriented triangles.
Add this line to your application's Gemfile:
gem 'ruby3mf'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ruby3mf
Log3mf.reset_log
Log3mf.context <filename> do |l|
Document.read(<file>)
end
if Log3mf.count_entries(:error, :fatal_error) > 0
entries = Log3mf.entries
end
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/IPGPTP/ruby3mf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.