new ExportOptions( [config])
Creates a new export options object.
Export options allow the host application some control over the exported geometry, such as the format, filename, whether to use opacities, include outlines, swap Y/Z axes, and set a scale.
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object |
<optional> |
A configuration object with export options. |
||||||||||||||||||||||||||||
Properties of
|
|||||||||||||||||||||||||||||||
| Name | Type | Argument | Description |
|---|---|---|---|
format |
string |
<optional> |
The format to export to (e.g., 'glb', 'gltf', 'usdz', 'obj', 'stl', 'ply'). |
filename |
string |
<optional> |
The base name of the file to save when the export object is generated. |
includeOpacity |
boolean |
<optional> |
Whether to make all surface and outline meshes opaque when exporting a |
includeOutlines |
boolean |
<optional> |
Whether to include the outline meshes within each |
swapYZ |
boolean |
<optional> |
Whether to swap the Y and Z axis during export, defaults to false. |
scale |
number |
<optional> |
The scale multiplier to apply, defaults to 1. |
Methods
-
copyFrom(data)
-
Copy properties to this instance from a source object.
Parameters:
Name Type Description dataobject A configuration object with export options.
Properties of
data:Name Type Argument Description formatstring <optional>
The format to export to (e.g., 'glb', 'gltf', 'usdz', 'obj', 'stl', 'ply').
filenamestring <optional>
The base name of the file to save.
includeOpacityboolean <optional>
Whether to respect current PD.PolyMesh transparency values.
includeOutlinesboolean <optional>
Whether to include the PD.PolyMesh outline meshes.
swapYZboolean <optional>
Whether to swap the Y and Z axis during export.
scalenumber <optional>
The scale multiplier to apply.
Returns:
Returns this options instance to support method chaining.
-
fromJSON(data)
-
Safely copy properties from a source object.
See the
PD.Base#fromJSONmethod for more details.Parameters:
Name Type Description dataobject A configuration object with export options.
Properties of
data:Name Type Argument Description formatstring <optional>
The format to export to (e.g., 'glb', 'gltf', 'usdz', 'obj', 'stl', 'ply').
filenamestring <optional>
The base name of the file to save.
includeOpacityboolean <optional>
Whether to respect current PD.PolyMesh transparency values.
includeOutlinesboolean <optional>
Whether to include the PD.PolyMesh outline meshes.
swapYZboolean <optional>
Whether to swap the Y and Z axis during export.
scalenumber <optional>
The scale multiplier to apply.
Returns:
Returns this options instance to support method chaining.
-
toJSON( [data])
-
Converts export options to a simple POJO for conversion to JSON.
This method is used to copy, store and save export options data, so the returned object must have all the properties required be able to rebuild this instance in its entirety when passed to the class constructor.
Parameters:
Name Type Argument Description dataobject <optional>
An optional parent object to append this data to.
Returns:
Returns a Plain Old Javascript Object (POJO).
- Type
- object