beamlattice

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/beamlattice/2017/02"

Namespace is the canonical name of this extension.

Variables

View Source
var (
	ErrLatticeObjType       = errors.New("MUST only be added to a mesh object of type model or solidsupport")
	ErrLatticeClippedNoMesh = errors.New("if clipping mode is not equal to none, a clippingmesh resource MUST be specified")
	ErrLatticeInvalidMesh   = errors.New("the clippingmesh and representationmesh MUST be a mesh object of type model and MUST NOT contain a beamlattice")
	ErrLatticeSameVertex    = errors.New("a beam MUST consist of two distinct vertex indices")
	ErrLatticeBeamR2        = errors.New("r2 MUST not be defined, if r1 is not defined")
)
View Source
var DefaultExtension = go3mf.Extension{
	Namespace:  Namespace,
	LocalName:  "b",
	IsRequired: false,
}

Functions

This section is empty.

Types

type Beam

type Beam struct {
	Indices [2]uint32  // Indices of the two nodes that defines the beam.
	Radius  [2]float32 // Radius of both ends of the beam.
	CapMode [2]CapMode // Capping mode.
}

Beam defines a single beam.

type BeamLattice

type BeamLattice struct {
	ClipMode             ClipMode
	ClippingMeshID       uint32
	RepresentationMeshID uint32
	Beams                []Beam
	BeamSets             []BeamSet
	MinLength, Radius    float32
	CapMode              CapMode
}

BeamLattice defines the Model Mesh BeamLattice Attributes class and is part of the BeamLattice extension to 3MF.

func GetBeamLattice

func GetBeamLattice(mesh *go3mf.Mesh) *BeamLattice

func (*BeamLattice) Marshal3MF

func (m *BeamLattice) Marshal3MF(x spec.Encoder) error

Marshal3MF encodes the resource.

type BeamSet

type BeamSet struct {
	Refs       []uint32
	Name       string
	Identifier string
}

BeamSet defines a set of beams.

type CapMode

type CapMode uint8

A CapMode is an enumerable for the different capping modes.

const (
	CapModeSphere CapMode = iota
	CapModeHemisphere
	CapModeButt
)

Supported cap modes.

func (CapMode) String

func (b CapMode) String() string

type ClipMode

type ClipMode uint8

ClipMode defines the clipping modes for the beam lattices.

const (
	ClipNone ClipMode = iota
	ClipInside
	ClipOutside
)

Supported clip modes.

func (ClipMode) String

func (c ClipMode) String() string

type Spec

type Spec struct{}

func (Spec) CreateElementDecoder

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

func (Spec) DecodeAttribute

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

func (Spec) Validate

func (Spec) Validate(m interface{}, path string, obj interface{}) error

Jump to

Keyboard shortcuts

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