File Format — Aspose.3D FOSS for Java
General
El FileFormat class és un registre estàtic de tots els formats de fitxer suportats per Aspose.3D FOSS for Java. Les instàncies són constants predefinides com ara: FileFormat.WAVEFRONTOBJ, FileFormat.GLTF2, o FileFormat.FBX7400ASCII.Passar un FileFormat instància a Scene.save() seleccionar explícitament el format de sortida.
Package: com.aspose.threed
Classes i enumeracions
| Tipus de productes | Descripció |
|---|---|
FileFormat | Registre estàtic de formats de fitxer suportats. Conté constants com ara: WAVEFRONTOBJ, GLTF2, GLTF2_BINARY, FBX7400ASCII, FBX7600_BINARY, STL, STL_BINARY. |
FileFormatType | Categoria general d’un format de fitxer: GEOMETRY, POINT_CLOUD, etc. Accés a través de: FileFormat.getFormatType(). |
FileContentType | Controla si la sortida s’escriu com a binari o ASCII. Passat a StlSaveOptions.setContentType() i de la GltfSaveOptions.setContentType(). |
Formats suportats
| Constants de format | Extensió | Carrega | Salvar |
|---|---|---|---|
FileFormat.WAVEFRONTOBJ | .obj | ✓ | ✓ |
FileFormat.GLTF2 | .gltf | ✓ | ✓ |
FileFormat.GLTF2_BINARY | .glb | ✓ | ✓ |
FileFormat.FBX7400ASCII | .fbx | ✓ | ✓ |
FileFormat.FBX7600_BINARY | .fbx | ✓ | ✓ |
FileFormat.STL | .stl | ✓ | ✓ |
FileFormat.STL_BINARY | .stl | ✓ | ✓ |
Exemple ràpid
import com.aspose.threed.Scene;
import com.aspose.threed.FileFormat;
Scene scene = Scene.fromFile("model.obj");
// Save as binary FBX explicitly
scene.save("output.fbx", FileFormat.FBX7600_BINARY);
// Or save using the file extension for auto-detection
scene.save("output.gltf");