production

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Namespace = "http://schemas.microsoft.com/3dmanufacturing/production/2015/06"

Namespace is the canonical name of this extension.

Variables

View Source
var (
	ErrUUID             = errors.New("UUID MUST be any of the four UUID variants described in IETF RFC 4122")
	ErrProdRefInNonRoot = errors.New("non-root model file components MUST only reference objects in the same model file")
)
View Source
var DefaultExtension = go3mf.Extension{
	Namespace:  Namespace,
	LocalName:  "p",
	IsRequired: true,
}

Functions

func SetMissingUUIDs

func SetMissingUUIDs(m *go3mf.Model)

SetMissingUUIDs traverse all the model tree setting all missing UUID attributes.

Types

type BuildAttr

type BuildAttr struct {
	UUID string
}

BuildAttr provides a UUID in the root model file build element to ensure that a 3MF package can be tracked across uses by various consumers.

func GetBuildAttr

func GetBuildAttr(build *go3mf.Build) *BuildAttr

func (*BuildAttr) Marshal3MFAttr

func (u *BuildAttr) Marshal3MFAttr(_ spec.Encoder) ([]xml.Attr, error)

Marshal3MFAttr encodes the resource attributes.

type ComponentAttr

type ComponentAttr struct {
	UUID string
	Path string
}

ObjectAttr provides a UUID in the component element for traceability across 3MF packages.

func GetComponentAttr

func GetComponentAttr(comp *go3mf.Component) *ComponentAttr

func (*ComponentAttr) Marshal3MFAttr

func (p *ComponentAttr) Marshal3MFAttr(_ spec.Encoder) ([]xml.Attr, error)

Marshal3MFAttr encodes the resource attributes.

func (*ComponentAttr) ObjectPath

func (p *ComponentAttr) ObjectPath() string

ObjectPath returns the Path extension attribute.

type ItemAttr

type ItemAttr struct {
	UUID string
	Path string
}

ItemAttr provides a UUID in the item element to ensure that each object can be reliably tracked.

func GetItemAttr

func GetItemAttr(item *go3mf.Item) *ItemAttr

func (*ItemAttr) Marshal3MFAttr

func (p *ItemAttr) Marshal3MFAttr(_ spec.Encoder) ([]xml.Attr, error)

Marshal3MFAttr encodes the resource attributes.

func (*ItemAttr) ObjectPath

func (p *ItemAttr) ObjectPath() string

ObjectPath returns the Path extension attribute.

type ObjectAttr

type ObjectAttr struct {
	UUID string
}

ObjectAttr provides a UUID in the item element for traceability across 3MF packages.

func GetObjectAttr

func GetObjectAttr(obj *go3mf.Object) *ObjectAttr

func (*ObjectAttr) Marshal3MFAttr

func (u *ObjectAttr) Marshal3MFAttr(_ spec.Encoder) ([]xml.Attr, error)

Marshal3MFAttr encodes the resource attributes.

type Spec

type Spec struct{}

func (Spec) CreateElementDecoder

func (Spec) CreateElementDecoder(_ interface{}, _ string) spec.ElementDecoder

func (Spec) DecodeAttribute

func (Spec) DecodeAttribute(parentNode interface{}, attr spec.Attr) (errs error)

func (Spec) Validate

func (Spec) Validate(model interface{}, path string, e interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL