PlyFormat

Inheritance: java.lang.Object, com.aspose.threed.FileFormat

public class PlyFormat extends FileFormat

PLY 格式。 示例: 以下代码展示了如何从 PLY 文件解码网格:

//Generate a test file for decoding
             FileFormat.PLY.encode(new Sphere(), "sphere.ply");
             //Decode the file
             var mesh = (Mesh)FileFormat.PLY.decode("sphere.ply")

字段

字段描述
AMF增材制造文件格式
ASE3D Studio Max 的 ASCII 场景导出器格式。
ASPOSE3D_WEBAspose.3D Web 格式。
BLENDERBlender 的 3D 文件格式
COLLADACollada 文件格式
DISCREET3DS3D Studio 的文件格式
DRACOGoogle Draco 网格
DXFAutoCAD DXF
FBX6100ASCIIASCII FBX 文件格式,版本 6.1.0
FBX6100_BINARY二进制 FBX 文件格式,版本 6.1.0
FBX7200ASCIIASCII FBX 文件格式,版本 7.2.0
FBX7200_BINARY二进制 FBX 文件格式,版本 7.2.0
FBX7300ASCIIASCII FBX 文件格式,版本 7.3.0
FBX7300_BINARY二进制 FBX 文件格式,版本 7.3.0
FBX7400ASCIIASCII FBX 文件格式,版本 7.4.0
FBX7400_BINARY二进制 FBX 文件格式,版本 7.4.0
FBX7500ASCIIASCII FBX 文件格式,版本为 7.5.0
FBX7500_BINARYBinary FBX 文件格式,版本为 7.5.0
FBX7600ASCIIASCII FBX 文件格式,版本为 7.6.0
FBX7600_BINARYBinary FBX 文件格式,版本为 7.6.0
FBX7700ASCIIASCII FBX 文件格式,版本为 7.7.0
FBX7700_BINARYBinary FBX 文件格式,版本为 7.7.0
GLTFKhronos Group 的 glTF
GLTF2Khronos Group 的 glTF 2.0 版
GLTF2_BINARYKhronos Group 的 glTF 2.0 版
GLTF_BINARYKhronos Group 的 glTF(二进制格式)
HTML5HTML5 文件
IFCISO 16739-1 行业基础类数据模型。
MAYAASCIIAutodesk Maya(ASCII 格式)
MAYA_BINARYAutodesk Maya(Binary 格式)
MICROSOFT3MFMicrosoft 3D 制造格式
PCDPCL 点云数据文件(ASCII 模式)
PCD_BINARYPCL 点云数据文件(Binary 模式)
PDFAdobe 的可移植文档格式
PLY多边形文件格式或 Stanford 三角形格式
RVM_BINARYAVEVA Plant Design Management System 模型(二进制格式)
RVM_TEXTAVEVA Plant Design Management System 模型(文本格式)
SIEMENSJT8Siemens JT 文件版本 8
SIEMENSJT9Siemens JT 文件版本 9
STLASCIIASCII STL 文件格式
STL_BINARYBinary STL 文件格式
UNIVERSAL3DUniversal3D 文件格式
USD通用场景描述
USDAASCII 格式的通用场景描述。
USDZ压缩的通用场景描述
VRML虚拟现实建模语言
WAVEFRONTOBJWavefront 的 Obj 文件格式
XYZXyz 点云文件
X_BINARY二进制格式的 DirectX X 文件
X_TEXT二进制格式的 DirectX X 文件
ZIP包含其他 3D 文件格式的 Zip 存档。

方法

方法描述
createLoadOptions()为此文件格式创建默认加载选项
createSaveOptions()为此文件格式创建默认保存选项
decode(Stream stream)从指定的流中解码点云或网格。
decode(Stream stream, PlyLoadOptions opt)从指定的流中解码点云或网格。
decode(String fileName)从指定的流中解码点云或网格。
decode(String fileName, PlyLoadOptions opt)从指定的流中解码点云或网格。
detect(Stream stream, String fileName)从数据流检测文件格式,文件名是可选的,用于猜测没有魔术头的类型。
detect(String fileName)从文件名检测文件格式,文件必须可读,以便 Aspose.3D 能通过文件头检测文件格式。
encode(Entity entity, Stream stream)对实体进行编码并将结果保存到流中。
encode(Entity entity, Stream stream, PlySaveOptions opt)对实体进行编码并将结果保存到流中。
encode(Entity entity, String fileName)对实体进行编码并将结果保存到外部文件中。
encode(Entity entity, String fileName, PlySaveOptions opt)对实体进行编码并将结果保存到外部文件中。
equals(Object arg0)
getCanExport()获取 Aspose.3D 是否支持将场景导出为当前文件格式。
getCanImport()获取 Aspose.3D 是否支持从当前文件格式导入场景。
getClass()
getContentType()获取文件格式的内容类型
getExtension()获取此类型的扩展名。
getExtensions()获取此类型的扩展名列表。
getFileFormatType()获取文件格式类型
getFormatByExtension(String extensionName)根据文件扩展名获取首选文件格式,扩展名应以点(’.’)开头。
getFormats()访问所有受支持的格式
getVersion()获取文件格式版本
hashCode()
notify()
notifyAll()
toString()将格式转换为字符串
wait()
wait(long arg0)
wait(long arg0, int arg1)

AMF

public static final FileFormat AMF

增材制造文件格式

ASE

public static final FileFormat ASE

3D Studio Max 的 ASCII 场景导出器格式。

ASPOSE3D_WEB

public static final FileFormat ASPOSE3D_WEB

Aspose.3D Web 格式。

BLENDER

public static final FileFormat BLENDER

Blender 的 3D 文件格式

COLLADA

public static final FileFormat COLLADA

Collada 文件格式

DISCREET3DS

public static final FileFormat DISCREET3DS

3D Studio 的文件格式

DRACO

public static final DracoFormat DRACO

Google Draco 网格

DXF

public static final FileFormat DXF

AutoCAD DXF

FBX6100ASCII

public static final FileFormat FBX6100ASCII

ASCII FBX 文件格式,版本 6.1.0

FBX6100_BINARY

public static final FileFormat FBX6100_BINARY

二进制 FBX 文件格式,版本 6.1.0

FBX7200ASCII

public static final FileFormat FBX7200ASCII

ASCII FBX 文件格式,版本 7.2.0

FBX7200_BINARY

public static final FileFormat FBX7200_BINARY

二进制 FBX 文件格式,版本 7.2.0

FBX7300ASCII

public static final FileFormat FBX7300ASCII

ASCII FBX 文件格式,版本 7.3.0

FBX7300_BINARY

public static final FileFormat FBX7300_BINARY

二进制 FBX 文件格式,版本 7.3.0

FBX7400ASCII

public static final FileFormat FBX7400ASCII

ASCII FBX 文件格式,版本 7.4.0

FBX7400_BINARY

public static final FileFormat FBX7400_BINARY

二进制 FBX 文件格式,版本 7.4.0

FBX7500ASCII

public static final FileFormat FBX7500ASCII

ASCII FBX 文件格式,版本为 7.5.0

FBX7500_BINARY

public static final FileFormat FBX7500_BINARY

Binary FBX 文件格式,版本为 7.5.0

FBX7600ASCII

public static final FileFormat FBX7600ASCII

ASCII FBX 文件格式,版本为 7.6.0

FBX7600_BINARY

public static final FileFormat FBX7600_BINARY

Binary FBX 文件格式,版本为 7.6.0

FBX7700ASCII

public static final FileFormat FBX7700ASCII

ASCII FBX 文件格式,版本为 7.7.0

FBX7700_BINARY

public static final FileFormat FBX7700_BINARY

Binary FBX 文件格式,版本为 7.7.0

GLTF

public static final FileFormat GLTF

Khronos Group 的 glTF

GLTF2

public static final FileFormat GLTF2

Khronos Group 的 glTF 2.0 版

GLTF2_BINARY

public static final FileFormat GLTF2_BINARY

Khronos Group 的 glTF 2.0 版

GLTF_BINARY

public static final FileFormat GLTF_BINARY

Khronos Group 的 glTF(二进制格式)

HTML5

public static final FileFormat HTML5

HTML5 文件

IFC

public static final FileFormat IFC

ISO 16739-1 行业基础类数据模型。

MAYAASCII

public static final FileFormat MAYAASCII

Autodesk Maya(ASCII 格式)

MAYA_BINARY

public static final FileFormat MAYA_BINARY

Autodesk Maya(Binary 格式)

MICROSOFT3MF

public static final Microsoft3MFFormat MICROSOFT3MF

Microsoft 3D 制造格式

PCD

public static final FileFormat PCD

PCL 点云数据文件(ASCII 模式)

PCD_BINARY

public static final FileFormat PCD_BINARY

PCL 点云数据文件(Binary 模式)

PDF

public static final PdfFormat PDF

Adobe 的可移植文档格式

PLY

public static final PlyFormat PLY

多边形文件格式或 Stanford 三角形格式

RVM_BINARY

public static final RvmFormat RVM_BINARY

AVEVA Plant Design Management System 模型(二进制格式)

RVM_TEXT

public static final RvmFormat RVM_TEXT

AVEVA Plant Design Management System 模型(文本格式)

SIEMENSJT8

public static final FileFormat SIEMENSJT8

Siemens JT 文件版本 8

SIEMENSJT9

public static final FileFormat SIEMENSJT9

Siemens JT 文件版本 9

STLASCII

public static final FileFormat STLASCII

ASCII STL 文件格式

STL_BINARY

public static final FileFormat STL_BINARY

Binary STL 文件格式

UNIVERSAL3D

public static final FileFormat UNIVERSAL3D

Universal3D 文件格式

USD

public static final FileFormat USD

通用场景描述

USDA

public static final FileFormat USDA

ASCII 格式的通用场景描述。

USDZ

public static final FileFormat USDZ

压缩的通用场景描述

VRML

public static final FileFormat VRML

虚拟现实建模语言

WAVEFRONTOBJ

public static final FileFormat WAVEFRONTOBJ

Wavefront 的 Obj 文件格式

XYZ

public static final FileFormat XYZ

Xyz 点云文件

X_BINARY

public static final FileFormat X_BINARY

二进制格式的 DirectX X 文件

X_TEXT

public static final FileFormat X_TEXT

二进制格式的 DirectX X 文件

ZIP

public static final FileFormat ZIP

包含其他 3D 文件格式的 Zip 存档。

createLoadOptions()

public LoadOptions createLoadOptions()

为此文件格式创建默认加载选项

Returns: LoadOptions - A default load option for current format

createSaveOptions()

public SaveOptions createSaveOptions()

为此文件格式创建默认保存选项

Returns: SaveOptions - A default save option for current format

decode(Stream stream)

public Geometry decode(Stream stream)

从指定的流中解码点云或网格。

Parameters:

参数类型描述
streamStream输入流

Returns: Geometry - A Mesh or PointCloud instance Example: The following code shows how to decode a mesh from a PLY file:

//Generate a test file for decoding
             FileFormat.PLY.encode(new Sphere(), "sphere.ply");
             //Decode the file
             var mesh = (Mesh)FileFormat.PLY.decode("sphere.ply")

decode(Stream stream, PlyLoadOptions opt)

public Geometry decode(Stream stream, PlyLoadOptions opt)

从指定的流中解码点云或网格。

Parameters:

参数类型描述
streamStream输入流
optPlyLoadOptionsPLY 格式的加载选项

Returns: Geometry - A Mesh or PointCloud instance Example: The following code shows how to decode a mesh from a PLY file:

//Generate a test file for decoding
             FileFormat.PLY.encode(new Sphere(), "sphere.ply");
             //Decode the file
             var mesh = (Mesh)FileFormat.PLY.decode("sphere.ply")

decode(String fileName)

public Geometry decode(String fileName)

从指定的流中解码点云或网格。

Parameters:

参数类型描述
文件名java.lang.String输入流

Returns: Geometry - A Mesh or PointCloud instance Example: The following code shows how to decode a mesh from a PLY file:

//Generate a test file for decoding
             FileFormat.PLY.encode(new Sphere(), "sphere.ply");
             //Decode the file
             var mesh = (Mesh)FileFormat.PLY.decode("sphere.ply")

decode(String fileName, PlyLoadOptions opt)

public Geometry decode(String fileName, PlyLoadOptions opt)

从指定的流中解码点云或网格。

Parameters:

参数类型描述
文件名java.lang.String输入流
optPlyLoadOptionsPLY 格式的加载选项

Returns: Geometry - A Mesh or PointCloud instance Example: The following code shows how to decode a mesh from a PLY file:

//Generate a test file for decoding
             FileFormat.PLY.encode(new Sphere(), "sphere.ply");
             //Decode the file
             var mesh = (Mesh)FileFormat.PLY.decode("sphere.ply")

detect(Stream stream, String fileName)

public static FileFormat detect(Stream stream, String fileName)

从数据流检测文件格式,文件名是可选的,用于猜测没有魔术头的类型。

Parameters:

参数类型描述
streamStream包含用于检测的数据流
文件名java.lang.String数据的原始文件名,用作提示。

Returns: FileFormat - The FileFormat instance of the detected type or null if failed.

detect(String fileName)

public static FileFormat detect(String fileName)

从文件名检测文件格式,文件必须可读,以便 Aspose.3D 能通过文件头检测文件格式。

Parameters:

参数类型描述
文件名java.lang.String用于检测文件格式的文件路径。

Returns: FileFormat - The FileFormat instance of the detected type or null if failed.

encode(Entity entity, Stream stream)

public void encode(Entity entity, Stream stream)

对实体进行编码并将结果保存到流中。

Parameters:

参数类型描述
entityEntity要编码的实体
streamStream
Mesh mesh = (new Sphere()).toMesh();
             //encode mesh into PLY format
             FileFormat.PLY.encode(mesh, "sphere.ply");
``` |

### encode(Entity entity, Stream stream, PlySaveOptions opt) {#encode-com.aspose.threed.Entity-com.aspose.threed.Stream-com.aspose.threed.PlySaveOptions-}

public void encode(Entity entity, Stream stream, PlySaveOptions opt)



对实体进行编码并将结果保存到流中。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| entity | [Entity](../../com.aspose.threed/entity) | 要编码的实体 |
| stream | [Stream](../../com.aspose.threed/stream) | 写入的流,此方法不会关闭此流 |
|  | opt | [PlySaveOptions](../../com.aspose.threed/plysaveoptions) | 保存选项 **Example:** 以下代码展示了如何将网格编码为 PLY 文件: |

Mesh mesh = (new Sphere()).toMesh(); //encode mesh into PLY format FileFormat.PLY.encode(mesh, “sphere.ply”);


### encode(Entity entity, String fileName) {#encode-com.aspose.threed.Entity-java.lang.String-}

public void encode(Entity entity, String fileName)



对实体进行编码并将结果保存到外部文件中。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| entity | [Entity](../../com.aspose.threed/entity) | 要编码的实体 |
|  | 文件名 | java.lang.String | 写入的文件 **Example:** 以下代码展示了如何将网格编码为 PLY 文件: |

Mesh mesh = (new Sphere()).toMesh(); //encode mesh into PLY format FileFormat.PLY.encode(mesh, “sphere.ply”);


### encode(Entity entity, String fileName, PlySaveOptions opt) {#encode-com.aspose.threed.Entity-java.lang.String-com.aspose.threed.PlySaveOptions-}

public void encode(Entity entity, String fileName, PlySaveOptions opt)



对实体进行编码并将结果保存到外部文件中。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| entity | [Entity](../../com.aspose.threed/entity) | 要编码的实体 |
| 文件名 | java.lang.String | 写入的文件 |
|  | opt | [PlySaveOptions](../../com.aspose.threed/plysaveoptions) | 保存选项 **Example:** 以下代码展示了如何将网格编码为 PLY 文件: |

Mesh mesh = (new Sphere()).toMesh(); //encode mesh into PLY format FileFormat.PLY.encode(mesh, “sphere.ply”);


### equals(Object arg0) {#equals-java.lang.Object-}

public boolean equals(Object arg0)





**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| arg0 | java.lang.Object |  |

**Returns:**
布尔
### getCanExport() {#getCanExport--}

public boolean getCanExport()



获取 Aspose.3D 是否支持将场景导出为当前文件格式。

**Returns:**
boolean - 是否 Aspose.3D 支持将场景导出为当前文件格式。**Example:** 以下代码展示了如何检查是否支持导出到指定格式。

var outputFormat = “.glb”; var format = FileFormat.getFormatByExtension(outputFormat); if (format.getCanExport()) System.out.printf(“Can export to %s”, outputFormat);

### getCanImport() {#getCanImport--}

public boolean getCanImport()



获取 Aspose.3D 是否支持从当前文件格式导入场景。

**Returns:**
boolean - 是否 Aspose.3D 支持从当前文件格式导入场景。**Example:** 以下代码展示了如何检查是否支持从指定格式导入。

var outputFormat = “.glb”; var format = FileFormat.getFormatByExtension(outputFormat); if (format.getCanImport()) System.out.printf(“Can import from %s”, outputFormat);

### getClass() {#getClass--}

public final native Class getClass()





**Returns:**
java.lang.Class<?>
### getContentType() {#getContentType--}

public FileContentType getContentType()



获取文件格式的内容类型

**Returns:**
[FileContentType](../../com.aspose.threed/filecontenttype) - file format content type **Example:**

var format = FileFormat.MAYA_BINARY; if (format.getContentType() == FileContentType.BINARY) System.out.printf("%s is binary format", format); else System.out.printf("%s is text-based format", format);

### getExtension() {#getExtension--}

public String getExtension()



获取此类型的扩展名。

**Returns:**
java.lang.String - 此类型的扩展名。**Example:**

var format = FileFormat.MAYA_BINARY; System.out.printf(“Extension of %s is %s”, format, format.getExtension());

### getExtensions() {#getExtensions--}

public String[] getExtensions()



获取此类型的扩展名列表。

**Returns:**
java.lang.String[] - 此类型的扩展名列表。
### getFileFormatType() {#getFileFormatType--}

public FileFormatType getFileFormatType()



获取文件格式类型

**Returns:**
[FileFormatType](../../com.aspose.threed/fileformattype) - file format type
### getFormatByExtension(String extensionName) {#getFormatByExtension-java.lang.String-}

public static FileFormat getFormatByExtension(String extensionName)



根据文件扩展名获取首选文件格式,扩展名应以点('.')开头。

**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| extensionName | java.lang.String | 扩展名以 '.' 开头以进行查询。 |

**Returns:**
[FileFormat](../../com.aspose.threed/fileformat) - Instance of [FileFormat](../../com.aspose.threed/fileformat), otherwise null returned. **Example:** The following code shows how to save scene to memory using specified format

Scene scene = new Scene(new Box()); var outputFormat = “.glb”; var format = FileFormat.getFormatByExtension(outputFormat); var output = new ByteArrayOutputStream(); scene.save(output);

### getFormats() {#getFormats--}

public static List getFormats()



访问所有受支持的格式

**Returns:**
java.util.List<com.aspose.threed.FileFormat> - 访问所有受支持的格式
### getVersion() {#getVersion--}

public Version getVersion()



获取文件格式版本

**Returns:**
[Version](../../com.aspose.threed/version) - file format version
### hashCode() {#hashCode--}

public native int hashCode()





**Returns:**
int
### notify() {#notify--}

public final native void notify()





### notifyAll() {#notifyAll--}

public final native void notifyAll()





### toString() {#toString--}

public String toString()



将格式转换为字符串

**Returns:**
java.lang.String - 对象字符串
### wait() {#wait--}

public final void wait()





### wait(long arg0) {#wait-long-}

public final void wait(long arg0)





**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| arg0 | long |  |

### wait(long arg0, int arg1) {#wait-long-int-}

public final void wait(long arg0, int arg1)





**Parameters:**
| 参数 | 类型 | 描述 |
| --- | --- | --- |
| arg0 | long |  |
| arg1 | int |  |