Golang wrapper for the lib3mf library
This library uses the Autodesk/AutomaticComponentToolkit and the lib3mf IDL to automatically generate Go wrappers. The added value is that the resulting wrappers are published as Go module that can be imported without having to manually create and mantain the wrappers.
A precompiled version of lib3mf is distributed together with the Go wrapper and the appropiate cgo
flags are set up, so you only need to have a cgo
toolchain to use this library as an ordinary go package.
When distributing an executable that uses go-lib3mf
and dynamic linking make sure to distribute to apropiate lib3mf
shared library and that it is accessible by the executable.
package main
import (
"github.com/qmuntal/go-lib3mf/v2"
)
func main() {
flag.Parse()
model, _ := lib3mf.CreateModel()
reader, _ := model.QueryReader("3mf")
reader.ReadFromFile(flag.Arg(0))
box_, _ := model.GetOutbox()
fmt.Println(box)
}