DracoFormat.Decode
内容
[
隐藏
]Decode(string)
从指定的文件名解码点云或网格
public Geometry Decode(string fileName)
| 参数 | 类型 | 描述 |
|---|---|---|
| fileName | 字符串 | 文件名包含 drc 文件 |
返回值
一个基于文件内容的 Mesh 或 PointCloud 实例
异常
| 异常 | 条件 |
|---|---|
| IOException | 当从文件读取失败时抛出 |
示例
以下代码展示了如何对 Mesh 进行编码和解码为/从字节数组:
Mesh mesh = (new Sphere()).ToMesh();
//将网格编码为 Draco 格式
byte[] draco = FileFormat.Draco.Encode(mesh);
//从 Draco 格式解码网格
Mesh decodedMesh = (Mesh)FileFormat.Draco.Decode(draco);
另请参见
- class Geometry
- class DracoFormat
- namespace Aspose.ThreeD.Formats
- assembly Aspose.3D
Decode(byte[])
从内存数据解码点云或网格
public Geometry Decode(byte[] data)
| 参数 | 类型 | 描述 |
|---|---|---|
| 数据 | Byte[] | 原始 drc 字节 |
返回值
一个基于内容的 Mesh 或 PointCloud 实例
异常
| 异常 | 条件 |
|---|---|
| ImportException | 当数据格式错误时抛出。 |
示例
以下代码展示了如何对 Mesh 进行编码和解码为/从字节数组:
Mesh mesh = (new Sphere()).ToMesh();
//将网格编码为 Draco 格式
byte[] draco = FileFormat.Draco.Encode(mesh);
//从 Draco 格式解码网格
Mesh decodedMesh = (Mesh)FileFormat.Draco.Decode(draco);
另请参见
- class Geometry
- class DracoFormat
- namespace Aspose.ThreeD.Formats
- assembly Aspose.3D