Documentation
¶
Index ¶
Constants ¶
const ( // Namespace is the canonical name of this extension. Namespace = "http://schemas.microsoft.com/3dmanufacturing/material/2015/02" // RelTypeTexture3D is the canonical 3D texture relationship type. RelTypeTexture3D = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dtexture" )
Variables ¶
var ( ErrMultiBlend = errors.New("there MUST NOT be more blendmethods than layers – 1") ErrMaterialMulti = errors.New("a material, if included, MUST be positioned as the first layer") ErrMultiRefMulti = errors.New("the pids list MUST NOT contain any references to a multiproperties") ErrMultiColors = errors.New("the pids list MUST NOT contain more than one reference to a colorgroup") ErrTextureReference = errors.New("MUST reference to a texture resource") ErrCompositeBase = errors.New("MUST reference to a basematerials group") ErrMissingTexturePart = errors.New("texture part MUST be added as an attachment") )
Functions ¶
This section is empty.
Types ¶
type BlendMethod ¶
type BlendMethod uint8
BlendMethod defines the equation to use when blending a layer with the previous layer.
const ( BlendMix BlendMethod = iota BlendMultiply )
Supported blend methods.
func (BlendMethod) String ¶
func (b BlendMethod) String() string
type ColorGroup ¶
ColorGroup acts as a container for color properties.
func (*ColorGroup) Identify ¶
func (c *ColorGroup) Identify() uint32
Identify returns the unique ID of the resource.
func (*ColorGroup) Marshal3MF ¶
func (r *ColorGroup) Marshal3MF(x spec.Encoder) error
Marshal3MF encodes the resource.
type Composite ¶
type Composite struct {
Values []float32
}
A Composite specifies the proportion of the overall mixture for each material.
type CompositeMaterials ¶
type CompositeMaterials struct { ID uint32 MaterialID uint32 Indices []uint32 Composites []Composite }
CompositeMaterials defines materials derived by mixing 2 or more base materials in defined ratios.
func (*CompositeMaterials) Identify ¶
func (c *CompositeMaterials) Identify() uint32
Identify returns the unique ID of the resource.
func (*CompositeMaterials) Len ¶
func (r *CompositeMaterials) Len() int
Len returns the materials count.
func (*CompositeMaterials) Marshal3MF ¶
func (r *CompositeMaterials) Marshal3MF(x spec.Encoder) error
Marshal3MF encodes the resource.
type Multi ¶
type Multi struct {
PIndices []uint32
}
The Multi element combines the constituent materials and properties.
type MultiProperties ¶
type MultiProperties struct { ID uint32 PIDs []uint32 BlendMethods []BlendMethod Multis []Multi }
A MultiProperties element acts as a container for Multi elements which are indexable groups of property indices.
func (*MultiProperties) Identify ¶
func (c *MultiProperties) Identify() uint32
Identify returns the unique ID of the resource.
func (*MultiProperties) Marshal3MF ¶
func (r *MultiProperties) Marshal3MF(x spec.Encoder) error
Marshal3MF encodes the resource.
type Spec ¶
type Spec struct{}
func (Spec) CreateElementDecoder ¶
func (Spec) CreateElementDecoder(parent interface{}, name string) (child spec.ElementDecoder)
type Texture2D ¶
type Texture2D struct { ID uint32 Path string ContentType Texture2DType TileStyleU TileStyle TileStyleV TileStyle Filter TextureFilter }
Texture2D defines the Model Texture 2D.
type Texture2DGroup ¶
type Texture2DGroup struct { ID uint32 TextureID uint32 Coords []TextureCoord }
Texture2DGroup acts as a container for texture coordinate properties.
func (*Texture2DGroup) Identify ¶
func (r *Texture2DGroup) Identify() uint32
Identify returns the unique ID of the resource.
func (*Texture2DGroup) Marshal3MF ¶
func (r *Texture2DGroup) Marshal3MF(x spec.Encoder) error
Marshal3MF encodes the resource.
type Texture2DType ¶
type Texture2DType uint8
Texture2DType defines the allowed texture 2D types.
const ( TextureTypePNG Texture2DType = iota + 1 TextureTypeJPEG )
Supported texture types.
func (Texture2DType) String ¶
func (t Texture2DType) String() string
type TextureCoord ¶
type TextureCoord [2]float32
TextureCoord map a vertex of a triangle to a position in image space (U, V coordinates)
type TextureFilter ¶
type TextureFilter uint8
TextureFilter defines the allowed texture filters.
const ( TextureFilterAuto TextureFilter = iota TextureFilterLinear TextureFilterNearest )
Supported texture filters.
func (TextureFilter) String ¶
func (t TextureFilter) String() string