func (c *CompositeMaterials) Identify() uint32 {
	return c.ID
}
Identify returns the unique ID of the resource.
package materials
import (
	"encoding/xml"
	"errors"
	"image/color"
	"github.com/hpinc/go3mf"
	"github.com/hpinc/go3mf/spec"
)
const (
	Namespace = "http://schemas.microsoft.com/3dmanufacturing/material/2015/02"
	RelTypeTexture3D = "http://schemas.microsoft.com/3dmanufacturing/2013/01/3dtexture"
)
var DefaultExtension = go3mf.Extension{
	Namespace:  Namespace,
	LocalName:  "m",
	IsRequired: false,
}
func init() {
	spec.Register(Namespace, Spec{})
}
type Spec struct{}
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")
)
type Texture2DType uint8
const (
	TextureTypePNG Texture2DType = iota + 1
	TextureTypeJPEG
)
func (t Texture2DType) String() string {
	return map[Texture2DType]string{
		TextureTypePNG:  "image/png",
		TextureTypeJPEG: "image/jpeg",
	}[t]
}
type TileStyle uint8
const (
	TileWrap TileStyle = iota
	TileMirror
	TileClamp
	TileNone
)
func (t TileStyle) String() string {
	return map[TileStyle]string{
		TileWrap:   "wrap",
		TileMirror: "mirror",
		TileClamp:  "clamp",
		TileNone:   "none",
	}[t]
}
type TextureFilter uint8
const (
	TextureFilterAuto TextureFilter = iota
	TextureFilterLinear
	TextureFilterNearest
)
func (t TextureFilter) String() string {
	return map[TextureFilter]string{
		TextureFilterAuto:    "auto",
		TextureFilterLinear:  "linear",
		TextureFilterNearest: "nearest",
	}[t]
}
type BlendMethod uint8
const (
	BlendMix BlendMethod = iota
	BlendMultiply
)
func (b BlendMethod) String() string {
	return map[BlendMethod]string{
		BlendMix:      "mix",
		BlendMultiply: "multiply",
	}[b]
}
type Texture2D struct {
	ID          uint32
	Path        string
	ContentType Texture2DType
	TileStyleU  TileStyle
	TileStyleV  TileStyle
	Filter      TextureFilter
}
func (t *Texture2D) Identify() uint32 {
	return t.ID
}
func (Texture2D) XMLName() xml.Name {
	return xml.Name{Space: Namespace, Local: attrTexture2D}
}
type TextureCoord [2]float32
func (t TextureCoord) U() float32 {
	return t[0]
}
func (t TextureCoord) V() float32 {
	return t[1]
}
type Texture2DGroup struct {
	ID        uint32
	TextureID uint32
	Coords    []TextureCoord
}
func (r *Texture2DGroup) Len() int {
	return len(r.Coords)
}
func (r *Texture2DGroup) Identify() uint32 {
	return r.ID
}
func (Texture2DGroup) XMLName() xml.Name {
	return xml.Name{Space: Namespace, Local: attrTexture2DGroup}
}
type ColorGroup struct {
	ID     uint32
	Colors []color.RGBA
}
func (r *ColorGroup) Len() int {
	return len(r.Colors)
}
func (c *ColorGroup) Identify() uint32 {
	return c.ID
}
func (ColorGroup) XMLName() xml.Name {
	return xml.Name{Space: Namespace, Local: attrColorGroup}
}
type Composite struct {
	Values []float32
}
type CompositeMaterials struct {
	ID         uint32
	MaterialID uint32
	Indices    []uint32
	Composites []Composite
}
func (r *CompositeMaterials) Len() int {
	return len(r.Composites)
}