public class DracoFormat extends FileFormat
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
AMF, ASE, ASPOSE3D_WEB, BLENDER, COLLADA, DISCREET3DS, DRACO, DXF, FBX6100_BINARY, FBX6100ASCII, FBX7200_BINARY, FBX7200ASCII, FBX7300_BINARY, FBX7300ASCII, FBX7400_BINARY, FBX7400ASCII, FBX7500_BINARY, FBX7500ASCII, FBX7600_BINARY, FBX7600ASCII, FBX7700_BINARY, FBX7700ASCII, GLTF, GLTF_BINARY, GLTF2, GLTF2_BINARY, HTML5, IFC, MAYA_BINARY, MAYAASCII, MICROSOFT3MF, PCD, PCD_BINARY, PDF, PLY, RVM_BINARY, RVM_TEXT, SIEMENSJT8, SIEMENSJT9, STL_BINARY, STLASCII, UNIVERSAL3D, USD, USDA, USDZ, VRML, WAVEFRONTOBJ, X_BINARY, X_TEXT, XYZ, ZIP| Modifier and Type | Method and Description |
|---|---|
Geometry |
decode(byte[] data)
Decode the point cloud or mesh from memory data
|
Geometry |
decode(java.lang.String fileName)
Decode the point cloud or mesh from specified file name
|
byte[] |
encode(Entity entity)
Encode the entity to Draco raw data
|
byte[] |
encode(Entity entity,
DracoSaveOptions options)
Encode the entity to Draco raw data
|
void |
encode(Entity entity,
Stream stream)
Encode the entity to specified stream
|
void |
encode(Entity entity,
Stream stream,
DracoSaveOptions options)
Encode the entity to specified stream
|
void |
encode(Entity entity,
java.lang.String fileName)
Encode the entity to specified file
|
void |
encode(Entity entity,
java.lang.String fileName,
DracoSaveOptions options)
Encode the entity to specified file
|
createLoadOptions, createSaveOptions, detect, detect, getCanExport, getCanImport, getContentType, getExtension, getExtensions, getFileFormatType, getFormatByExtension, getFormats, getVersion, toStringpublic Geometry decode(java.lang.String fileName) throws java.io.IOException
fileName - The file name contains the drc fileMesh or PointCloud instance depends on the file contentjava.io.IOException - Thrown when failed to read from file
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public Geometry decode(byte[] data) throws ImportException
data - The raw drc bytesMesh or PointCloud instance depends on the contentImportException - Thrown when data is malformed.
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public void encode(Entity entity, Stream stream, DracoSaveOptions options) throws java.io.IOException
entity - The entity to be encodedstream - The stream that encoded data will be written tooptions - Extra options for encoding the point cloudjava.io.IOException - Thrown when failed to read from stream
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public void encode(Entity entity, Stream stream) throws java.io.IOException
entity - The entity to be encodedstream - The stream that encoded data will be written tojava.io.IOException - Thrown when failed to read from stream
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public void encode(Entity entity, java.lang.String fileName, DracoSaveOptions options) throws java.io.IOException
entity - The entity to be encodedfileName - The file name to be writtenoptions - Extra options for encoding the point cloudjava.io.IOException - Thrown when failed to read from file
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public void encode(Entity entity, java.lang.String fileName) throws java.io.IOException
entity - The entity to be encodedfileName - The file name to be writtenjava.io.IOException - Thrown when failed to read from file
Example:
The following code shows how to encode and decode a Mesh to/from byte array:
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
public byte[] encode(Entity entity, DracoSaveOptions options) throws com.aspose.threed.DrakoException
entity - The entity to be encodedoptions - Extra options for encoding the point cloud
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
com.aspose.threed.DrakoExceptionpublic byte[] encode(Entity entity) throws com.aspose.threed.DrakoException
entity - The entity to be encoded
Mesh mesh = (new Sphere()).toMesh();
//encode mesh into Draco format
byte[] draco = FileFormat.DRACO.encode(mesh);
//decode mesh from Draco format
Mesh decodedMesh = (Mesh)FileFormat.DRACO.decode(draco);
com.aspose.threed.DrakoException