Class ThreeMfMeshBuilder
Hierarchy (View Summary)
- ThreeMfObjectBuilder
- ThreeMfMeshBuilder
Constructors
constructor
-
Creates a new mesh object builder.
Parameters
- id: number
The unique resource id of the object within the model.
Returns ThreeMfMeshBuilder
- id: number
Properties
Optional_ th
Optional handler invoked for every triangle before it is added to the mesh.
Optional_ vh
Optional handler invoked for every vertex before it is added to the mesh.
Methods
build
reset
-
Discards the current object and starts building a new one.
Parameters
- id: number
The unique resource id of the new object.
- type: ST_ObjectType
The 3MF object type of the new object.
Returns void
- id: number
with Data
-
Builds the mesh content of the object from the provided vertex data.
Parameters
- data: I3mfVertexData
The positions and indices used to generate the mesh.
Returns ThreeMfMeshBuilder
This builder, to allow chaining.
- data: I3mfVertexData
with Material
-
Assigns the material used by the mesh.
Parameters
- id: number
The resource id of the base materials group.
- i: number
The zero based index of the material within the group.
Returns ThreeMfMeshBuilder
This builder, to allow chaining.
- id: number
with Name
-
Sets the human readable name of the object.
Parameters
- name: string
The name to assign to the object.
Returns ThreeMfObjectBuilder
This builder, to allow chaining.
- name: string
with Post Process Handlers
-
Registers the handlers used to post process the generated geometry.
Parameters
- vertex: VertexHandler
The handler invoked for every generated vertex.
Optionaltriangle: TriangleHandlerThe optional handler invoked for every generated triangle.
Returns ThreeMfMeshBuilder
This builder, to allow chaining.
- vertex: VertexHandler
with Property
-
Assigns the property resource used by the object.
Parameters
- id: number
The resource id of the property group (for example a base materials group).
- index: number = 0
The zero based index of the property within the group. Defaults to 0.
Returns ThreeMfObjectBuilder
This builder, to allow chaining.
- id: number
with Thumbnail
-
Sets the thumbnail of the object.
Parameters
- thumbnail: string
The package relative path of the thumbnail part.
Returns ThreeMfObjectBuilder
This builder, to allow chaining.
- thumbnail: string
Fluent builder for a 3MF object holding a mesh. Vertices and triangles are generated from Babylon vertex data and can be post processed through handlers.