Versions in this module Expand all Collapse all v0 v0.1.0 Oct 4, 2024 v0.0.1 Oct 3, 2024 Changes in this version + const ContentType3DModel + const ContentTypePrintTicket + const Default3DOtherDir + const Default3DTexturesDir + const DefaultMetadataDir + const DefaultModelPath + const DefaultPrintTicketName + const Namespace + const RelType3DModel + const RelTypeMustPreserve + const RelTypePrintTicket + const RelTypeThumbnail + func MarshalModel(m *Model) ([]byte, error) + func Register(namespace string, spec spec.Spec) + func UnmarshalModel(data []byte, model *Model) error + type Any []spec.Marshaler + type AnyAttr []spec.MarshalerAttr + func (any *AnyAttr) AddUnknownAttr(a spec.Attr) + func (any AnyAttr) GetUnknownAttr() *spec.UnknownAttrs + type Asset interface + Identify func() uint32 + type Attachment struct + ContentType string + Path string + Stream io.Reader + type Base struct + AnyAttr AnyAttr + Color color.RGBA + Name string + type BaseMaterials struct + AnyAttr AnyAttr + ID uint32 + Materials []Base + func (r *BaseMaterials) Identify() uint32 + func (r *BaseMaterials) Len() int + func (r *BaseMaterials) Marshal3MF(x spec.Encoder) error + func (r *BaseMaterials) Validate(m *Model, path string) error + type Box struct + Max Point3D + Min Point3D + type Build struct + AnyAttr AnyAttr + Items []*Item + type ChildModel struct + Any Any + Relationships []Relationship + Resources Resources + type Component struct + AnyAttr AnyAttr + ObjectID uint32 + Transform Matrix + func (c *Component) HasTransform() bool + func (c *Component) ObjectPath(defaultPath string) string + type Components struct + AnyAttr AnyAttr + Component []*Component + type Decoder struct + Strict bool + func NewDecoder(r io.ReaderAt, size int64) *Decoder + func (d *Decoder) Decode(model *Model) error + func (d *Decoder) DecodeContext(ctx context.Context, model *Model) error + type Encoder struct + FloatPrecision int + func NewEncoder(w io.Writer) *Encoder + func (e *Encoder) Encode(m *Model) error + type Extension struct + IsRequired bool + LocalName string + Namespace string + type Item struct + AnyAttr AnyAttr + Metadata []Metadata + ObjectID uint32 + PartNumber string + Transform Matrix + func (b *Item) HasTransform() bool + func (b *Item) ObjectPath() string + type Matrix [16]float32 + func Identity() Matrix + func (m1 Matrix) Mul(m2 Matrix) Matrix + func (m1 Matrix) Mul2D(v Point2D) Point2D + func (m1 Matrix) Mul3D(v Point3D) Point3D + func (m1 Matrix) MulBox(b Box) Box + func (m1 Matrix) String() string + func (m1 Matrix) Translate(x, y, z float32) Matrix + type Mesh struct + Any Any + AnyAttr AnyAttr + Triangles []Triangle + Vertices []Point3D + func (m *Mesh) BoundingBox() Box + func (m *Mesh) ValidateCoherency() error + type MeshBuilder struct + CalculateConnectivity bool + Mesh *Mesh + func NewMeshBuilder(m *Mesh) *MeshBuilder + func (mb *MeshBuilder) AddVertex(node Point3D) uint32 + type Metadata struct + Name xml.Name + Preserve bool + Type string + Value string + type Model struct + Any Any + AnyAttr AnyAttr + Attachments []Attachment + Build Build + Childs map[string]*ChildModel + Extensions []Extension + Language string + Metadata []Metadata + Path string + Relationships []Relationship + Resources Resources + RootRelationships []Relationship + Thumbnail string + Units Units + func (m *Model) BoundingBox() Box + func (m *Model) FindAsset(path string, id uint32) (Asset, bool) + func (m *Model) FindObject(path string, id uint32) (*Object, bool) + func (m *Model) FindResources(path string) (*Resources, bool) + func (m *Model) PathOrDefault() string + func (m *Model) Validate() error + func (m *Model) ValidateCoherency() error + func (m *Model) WalkAssets(fn func(string, Asset) error) error + func (m *Model) WalkObjects(fn func(string, *Object) error) error + type Object struct + AnyAttr AnyAttr + Components *Components + ID uint32 + Mesh *Mesh + Metadata []Metadata + Name string + PID uint32 + PIndex uint32 + PartNumber string + Thumbnail string + Type ObjectType + func (r *Object) Validate(m *Model, path string) error + type ObjectType int8 + const ObjectTypeModel + const ObjectTypeOther + const ObjectTypeSolidSupport + const ObjectTypeSupport + const ObjectTypeSurface + func (o ObjectType) String() string + type Point2D [2]float32 + func (n Point2D) X() float32 + func (n Point2D) Y() float32 + type Point3D [3]float32 + func (v1 Point3D) X() float32 + func (v1 Point3D) Y() float32 + func (v1 Point3D) Z() float32 + type ReadCloser struct + func OpenReader(name string) (*ReadCloser, error) + func (r *ReadCloser) Close() error + type Relationship struct + ID string + Path string + Type string + type Resources struct + AnyAttr AnyAttr + Assets []Asset + Objects []*Object + func (rs *Resources) FindAsset(id uint32) (Asset, bool) + func (rs *Resources) FindObject(id uint32) (*Object, bool) + func (rs *Resources) UnusedID() uint32 + type Triangle struct + P1 uint32 + P2 uint32 + P3 uint32 + PID uint32 + V1 uint32 + V2 uint32 + V3 uint32 + type Units uint8 + const UnitCentimeter + const UnitFoot + const UnitInch + const UnitMeter + const UnitMicrometer + const UnitMillimeter + func (u Units) String() string + type UnknownAsset struct + func (u UnknownAsset) Identify() uint32 + type WriteCloser struct + func CreateWriter(name string) (*WriteCloser, error) + func (w *WriteCloser) Close() error