Load and Save Options

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.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formāts, ar ko šis config ir saistīts (tikai lasāms)

SaveOptions

Bāzes klase visiem save-option objektiem. Paplašina A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu importēšanas laikā
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueIelādēt pievienoto .mtl materiāla fails
scaledoublegetScale()setScale(double)1.0Vienota skalēšana, kas piemērota visai importētajai ģeometrijai
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormalizē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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falsePielietot ainas vienības mēroga koeficientu eksportētajām koordinātēm
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseEksportēt tikai virsotnes (bez daudzstūru seju)
verbosebooleangetVerbose()setVerbose(boolean)falseIekļaut papildu OBJ komentārus izvadē
serializeWbooleangetSerializeW()setSerializeW(boolean)falseRakstīt kontroles punktu W komponenti
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueRakstīt a .mtl materiāla fails un atsauce uz to no .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt 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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu importēšanas laikā
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormatē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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.ASCIIIestatīt uz FileContentType.BINARY lai izveidotu pašpietiekamu GLB failu; iestatīt uz FileContentType.ASCII JSON .gltf ar ārēju buferi
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu eksportēšanas laikā
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormatējiet izvades JSON ar atkāpēm, lai uzlabotu lasāmību
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPrefikss ārējo bufera failu nosaukumiem
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullPielā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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu importēšanas laikā
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falsePārrēķināt normāles no ģeometrijas importēšanas laikā
contentTypeFileContentTypegetContentType()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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt koordinātu sistēmu eksportēšanas laikā
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Pārrakstīt mērķa ass sistēmu eksportēšanas laikā
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYIestatī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);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseApgriezt 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.


Skatīt arī

 Latviešu