Serializer of JSCAD geometries to 3D manufacturing format (XML)
The serialization of the following geometries are possible.
- serialization of 3D geometry (geom3) to 3MF object (a unique mesh containing both vertices and triangles)
Colors are added to base materials when found on the 3D geometry, i.e. attribute color. Names are added to meshs when found on the 3D geometry, i.e. attribute name.
- Source:
Example
const { serializer, mimeType } = require('@jscad/3mf-serializer')
Methods
(inner) serialize(optionsopt, …objects) → {Array}
Serialize the give objects to 3MF contents (XML) or 3MF packaging (OPC).
Example
const geometry = primitives.cube()
const package = serializer({unit: 'meter'}, geometry) // 3MF package, ZIP format
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
options for serialization Properties
|
|||||||||||||||||||||||||
objects |
Object | Array |
<repeatable> |
objects to serialize into 3D manufacturing format |
Returns:
serialized contents, 3MF contents (XML) or 3MF packaging (ZIP)
- Type
- Array