Load and Save Options — Aspose.3D FOSS for Java
Properties
Visas importēšanas un eksportēšanas operācijas pieņem izvēles options object, kas izvedams no LoadOptions vai SaveOptions. Pārsūtiet atbilstošo apakšklasi uz Scene.open() vai Scene.save() lai kontrolētu formāta specifisku uzvedību.
Properties: com.aspose.threed
import com.aspose.threed.*;LoadOptions
Bāzes klase visiem load-option objektiem. Paplašina A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Formāts, ar ko šis config ir saistīts (tikai lasāms) |
SaveOptions
Bāzes klase visiem save-option objektiem. Paplašina A3DObject.
| Properties | Properties | Properties | Properties |
|---|---|---|---|
fileFormat | FileFormat | getFileFormat() | Formāts, ar ko šī konfigurācija ir saistīta (tikai lasāma) |
ObjLoadOptions
Ielādēt opcijas Wavefront OBJ failiem (.obj).
import com.aspose.threed.*;
ObjLoadOptions opts = new ObjLoadOptions();
opts.setFlipCoordinateSystem(true);
opts.setScale(0.01);
Scene scene = new Scene();
scene.open("model.obj", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu importēšanas laikā |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Ielādēt pievienoto .mtl materiāla fails |
scale | double | getScale() | setScale(double) | 1.0 | Vienota skalēšana, kas piemērota visai importētajai ģeometrijai |
normalizeNormal | boolean | getNormalizeNormal() | setNormalizeNormal(boolean) | true | Normalizēt importētos normālos vektorus līdz vienības garumam |
ObjSaveOptions
Saglabāšanas opcijas Wavefront OBJ failiem.
import com.aspose.threed.*;
ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
applyUnitScale | boolean | getApplyUnitScale() | setApplyUnitScale(boolean) | false | Pielietot ainas vienības mēroga koeficientu eksportētajām koordinātēm |
pointCloud | boolean | getPointCloud() | setPointCloud(boolean) | false | Eksportēt tikai virsotnes (bez daudzstūru seju) |
verbose | boolean | getVerbose() | setVerbose(boolean) | false | Iekļaut papildu OBJ komentārus izvadē |
serializeW | boolean | getSerializeW() | setSerializeW(boolean) | false | Rakstīt kontroles punktu W komponenti |
enableMaterials | boolean | getEnableMaterials() | setEnableMaterials(boolean) | true | Rakstīt a .mtl materiāla fails un atsauce uz to no .obj |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu eksportēšanas laikā |
GltfLoadOptions
Ielādēt opcijas glTF 2.0 un GLB failiem (.gltf, .glb).
import com.aspose.threed.*;
GltfLoadOptions opts = new GltfLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("model.gltf", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu importēšanas laikā |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formatēt izvades JSON ar atkāpēm lasāmības uzlabošanai |
GltfSaveOptions
Saglabāšanas iespējas glTF 2.0 un GLB izvadei.
import com.aspose.threed.*;
import com.aspose.threed.FileContentType;
// Save as glTF JSON
GltfSaveOptions opts = new GltfSaveOptions();
scene.save("output.gltf", opts);
// Save as GLB (binary glTF)
GltfSaveOptions glbOpts = new GltfSaveOptions();
glbOpts.setContentType(FileContentType.BINARY);
scene.save("output.glb", glbOpts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.ASCII | Iestatīt uz FileContentType.BINARY lai izveidotu pašpietiekamu GLB failu; iestatīt uz FileContentType.ASCII JSON .gltf ar ārēju buferi |
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu eksportēšanas laikā |
prettyPrint | boolean | getPrettyPrint() | setPrettyPrint(boolean) | false | Formatējiet izvades JSON ar atkāpēm, lai uzlabotu lasāmību |
bufferFilePrefix | String | getBufferFilePrefix() | setBufferFilePrefix(String) | null | Prefikss ārējo bufera failu nosaukumiem |
saveExtras | String | getSaveExtras() | setSaveExtras(String) | null | Pielāgoti papildu dati, ko iekļaut glTF izvadē |
StlLoadOptions
Ielādes iespējas STL failiem (.stl).
import com.aspose.threed.*;
StlLoadOptions opts = new StlLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("part.stl", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu importēšanas laikā |
recalculateNormal | boolean | getRecalculateNormal() | setRecalculateNormal(boolean) | false | Pārrēķināt normāles no ģeometrijas importēšanas laikā |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | – | Padoms binārā un ASCII STL noteikšanai |
StlSaveOptions
Saglabāšanas iespējas STL izvadei.
import com.aspose.threed.*;
StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu eksportēšanas laikā |
axisSystem | AxisSystem | getAxisSystem() | setAxisSystem(AxisSystem) | – | Pārrakstīt mērķa ass sistēmu eksportēšanas laikā |
contentType | FileContentType | getContentType() | setContentType(FileContentType) | FileContentType.BINARY | Iestatīt uz BINARY vai ASCII lai kontrolētu izvades formātu |
FbxLoadOptions
Ielādēt opcijas FBX failiem (.fbx).
import com.aspose.threed.*;
FbxLoadOptions opts = new FbxLoadOptions();
opts.setFlipCoordinateSystem(true);
Scene scene = new Scene();
scene.open("animation.fbx", opts);| Properties | Properties | Properties | Properties | Properties | Properties |
|---|---|---|---|---|---|
flipCoordinateSystem | boolean | getFlipCoordinateSystem() | setFlipCoordinateSystem(boolean) | false | Apgriezt koordinātu sistēmu importēšanas laikā |
FbxSaveOptions
Piezīme: FBX eksports ir nav pieejams šajā Java FOSS izdevumā. FBX tiek atbalstīts tikai importam. Šī FbxSaveOptions klase pastāv API, bet radīs kļūdu, ja to izmantos saglabāšanai. Izmantojiet OBJ, STL, glTF vai GLB eksportam.