Serializer of JSCAD geometries to AMF source data (XML)
The serialization of the following geometries are possible.
- serialization of 3D geometry (geom3) to AMF object (a unique mesh containing both vertices and volumes)
Colors are added to volumes when found on the 3D geometry. Colors are added to triangles when found on individual polygons.
- Source:
Example
const { serializer, mimeType } = require('@jscad/amf-serializer')
Methods
(static) serialize(options, …objects) → {Array}
- Source:
Serialize the give objects (geometry) to AMF source data (XML).
Example
const geometry = primitives.cube()
const amfData = serializer({unit: 'meter'}, geometry)
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | options for serialization Properties
|
||||||||||||||||
objects |
Object |
<repeatable> |
objects to serialize into AMF source data |
Returns:
serialized contents, AMF source data(XML)
- Type
- Array