Class ThreeMfModelBuilder
Constructors
constructor
-
Returns ThreeMfModelBuilder
Properties
_ model
The 3MF model currently being built.
_ objects
The object resources added to the model, indexed by resource id.
StaticKnown Meta Set
The lower cased set of the metadata names defined by the 3MF specification.
Methods
build
reset
-
Discards the current model and starts building a new one.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
with Build
-
Adds a build item, which places an object resource in the build plate.
Parameters
- objectid: number
The resource id of the object to place.
Optionaltransform: Matrix3dThe optional transform applied to the object.
Optionalpartnumber: stringThe optional part number identifying the produced part.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- objectid: number
with Components
-
Adds a components object to the model resources.
Parameters
- components: I3mfObject | ThreeMfComponentsBuilder
The object resource, or a builder that produces one.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- components: I3mfObject | ThreeMfComponentsBuilder
with Material
-
Adds a base materials group to the model resources.
Parameters
- material: I3mfBaseMaterials | ThreeMfMaterialBuilder
The base materials resource, or a builder that produces one.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- material: I3mfBaseMaterials | ThreeMfMaterialBuilder
with Mesh
-
Adds a mesh object to the model resources.
Parameters
- object: I3mfObject | ThreeMfMeshBuilder
The object resource, or a builder that produces one.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- object: I3mfObject | ThreeMfMeshBuilder
with Meta Data
-
Adds a metadata entry to the model.
Parameters
- name: string
The metadata name. Names outside of the 3MF specification must be namespace qualified.
- value: string
The metadata value.
Optionalpreserve: booleanWhether consumers must preserve this entry when editing the document.
Optionaltype: stringThe XML schema type of the value. Defaults to
xs:string.
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- name: string
with Unit
-
Sets the unit in which the model coordinates are expressed.
Parameters
- unit: ST_Unit
The 3MF unit (micron, millimeter, centimeter, inch, foot or meter).
Returns ThreeMfModelBuilder
This builder, to allow chaining.
- unit: ST_Unit
Fluent builder for a 3MF model, the root part of a 3MF document. It aggregates the resources (materials, meshes and components) and the build items that reference them.