Documentation
¶
Index ¶
Constants ¶
const Namespace = "http://schemas.microsoft.com/3dmanufacturing/slice/2015/07"
Namespace is the canonical name of this extension.
Variables ¶
var ( ErrSliceExtRequired = errors.New("a 3MF package which uses low resolution objects MUST enlist the slice extension as required") ErrNonSliceStack = errors.New("slicestackid MUST reference a slice stack resource") ErrSlicesAndRefs = errors.New("may either contain slices or refs, but they MUST NOT contain both element types") ErrSliceRefSamePart = errors.New("the path of the referenced slice stack MUST be different than the path of the original slice stack") ErrSliceRefRef = errors.New("a referenced slice stack MUST NOT contain any further sliceref elements") ErrSliceSmallTopZ = errors.New("slice ztop is smaller than stack zbottom") ErrSliceNoMonotonic = errors.New("the first ztop in the next slicestack MUST be greater than the last ztop in the previous slicestack") ErrSliceInsufficientVertices = errors.New("slice MUST contain at least 2 vertices") ErrSliceInsufficientPolygons = errors.New("slice MUST contain at least 1 polygon") ErrSliceInsufficientSegments = errors.New("slice polygon MUST contain at least 1 segment") ErrSlicePolygonNotClosed = errors.New("objects with type 'model' and 'solidsupport' MUST not reference slices with open polygons") ErrSliceInvalidTranform = errors.New("any transform applied to an object that references a slice stack MUST be planar") )
Functions ¶
This section is empty.
Types ¶
type MeshResolution ¶
type MeshResolution uint8
MeshResolution defines the resolutions for a slice.
const ( ResolutionFull MeshResolution = iota ResolutionLow )
Supported slice resolution.
func (MeshResolution) String ¶
func (c MeshResolution) String() string
type ObjectAttr ¶
type ObjectAttr struct { SliceStackID uint32 MeshResolution MeshResolution }
ObjectAttr defines the attributes added to Object.
func GetObjectAttr ¶
func GetObjectAttr(obj *go3mf.Object) *ObjectAttr
func (*ObjectAttr) Marshal3MFAttr ¶
Marshal3MFAttr encodes the resource attributes.
type Polygon ¶
The Polygon element contains a set of 1 or more Segment elements to describe a 2D contour. If a Slice contains content, there MUST be at least one Polygon to describe it.
type Segment ¶
A Segment element represents a single line segment (or edge) of a polygon. It runs from the vertex specified by the previous segment (or the startv Polygon attribute for the first segment) to the specified vertex, v2.
type SliceStack ¶
SliceStack defines a slice stack resource. It can either contain a SliceStack or a Refs slice.
func (*SliceStack) Identify ¶
func (s *SliceStack) Identify() uint32
Identify returns the unique ID of the resource.
func (*SliceStack) Marshal3MF ¶
func (s *SliceStack) Marshal3MF(x spec.Encoder) error
Marshal3MF encodes the resource.
type Spec ¶
type Spec struct{}
func (Spec) CreateElementDecoder ¶
func (Spec) CreateElementDecoder(parent interface{}, name string) spec.ElementDecoder