Load and Save Options

Load and Save Options — Aspose.3D FOSS for Java

Properties

Toate operaţiunile de import şi export acceptă un obiect opţiuni opţional derivat din LoadOptions sau SaveOptions. Transmite subclasa corespunzătoare către Scene.open() sau Scene.save() pentru a controla comportamentul format-specific.

Properties: com.aspose.threed

import com.aspose.threed.*;

LoadOptions

Clasă de bază pentru toate obiectele load‑option. Extinde A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formatul cu care este asociat acest config (doar citire)

SaveOptions

Clasă de bază pentru toate obiectele save‑option. Extinde A3DObject.

PropertiesPropertiesPropertiesProperties
fileFormatFileFormatgetFileFormat()Formatul cu care este asociată această configurație (doar citire)

ObjLoadOptions

Opțiuni de încărcare pentru fișiere Wavefront OBJ (.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)falseInversează sistemul de coordonate la import
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueÎncarcă fișierul însoțitor .mtl fișier de material
scaledoublegetScale()setScale(double)1.0Scalare uniformă aplicată tuturor geometriei importate
normalizeNormalbooleangetNormalizeNormal()setNormalizeNormal(boolean)trueNormalizează vectorii normali importați la lungime unitară

ObjSaveOptions

Opțiuni de salvare pentru fișiere Wavefront OBJ.

import com.aspose.threed.*;

ObjSaveOptions opts = new ObjSaveOptions();
opts.setEnableMaterials(false);
scene.save("output.obj", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
applyUnitScalebooleangetApplyUnitScale()setApplyUnitScale(boolean)falseAplică factorul de scară al unității scenei la coordonatele exportate
pointCloudbooleangetPointCloud()setPointCloud(boolean)falseExportă doar vârfurile (fără fețe poligonale)
verbosebooleangetVerbose()setVerbose(boolean)falseInclude comentarii suplimentare OBJ în ieșire
serializeWbooleangetSerializeW()setSerializeW(boolean)falseScrie componenta W a punctelor de control
enableMaterialsbooleangetEnableMaterials()setEnableMaterials(boolean)trueScrie un .mtl fișier material și referențiază-l din .obj
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInversează sistemul de coordonate la export

GltfLoadOptions

Încarcă opțiunile pentru fișiere glTF 2.0 și GLB (.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)falseInversează sistemul de coordonate la import
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormatează JSON-ul de ieșire cu indentare pentru lizibilitate

GltfSaveOptions

Opțiuni de salvare pentru ieșirea glTF 2.0 și GLB.

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.ASCIISetează la FileContentType.BINARY pentru a produce un fișier GLB autonom; setează la FileContentType.ASCII pentru JSON .gltf cu un buffer extern
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInversează sistemul de coordonate la export
prettyPrintbooleangetPrettyPrint()setPrettyPrint(boolean)falseFormatați JSON-ul de ieșire cu indentare pentru lizibilitate
bufferFilePrefixStringgetBufferFilePrefix()setBufferFilePrefix(String)nullPrefix pentru numele fișierelor de buffer externe
saveExtrasStringgetSaveExtras()setSaveExtras(String)nullDate suplimentare personalizate de inclus în ieșirea glTF

StlLoadOptions

Încărcați opțiunile pentru fișiere STL (.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)falseInversează sistemul de coordonate la import
recalculateNormalbooleangetRecalculateNormal()setRecalculateNormal(boolean)falseRecalculează normalele din geometrie la import
contentTypeFileContentTypegetContentType()setContentType(FileContentType)Sugestie pentru detectarea STL binar vs ASCII

StlSaveOptions

Opțiuni de salvare pentru ieșirea STL.

import com.aspose.threed.*;

StlSaveOptions opts = new StlSaveOptions();
opts.setContentType(FileContentType.BINARY);
scene.save("output.stl", opts);
PropertiesPropertiesPropertiesPropertiesPropertiesProperties
flipCoordinateSystembooleangetFlipCoordinateSystem()setFlipCoordinateSystem(boolean)falseInversează sistemul de coordonate la export
axisSystemAxisSystemgetAxisSystem()setAxisSystem(AxisSystem)Suprascrie sistemul de axe țintă la export
contentTypeFileContentTypegetContentType()setContentType(FileContentType)FileContentType.BINARYSetează la BINARY sau ASCII pentru a controla formatul de ieșire

FbxLoadOptions

Încarcă opțiunile pentru fișiere FBX (.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)falseInversează sistemul de coordonate la import

FbxSaveOptions

Notă: Exportul FBX este nu este disponibil în ediția Java FOSS. FBX este acceptat doar pentru import. The FbxSaveOptions clasa există în API, dar va genera o eroare dacă este folosită pentru salvare. Folosiți OBJ, STL, glTF sau GLB pentru export în schimb.


Vezi și

 Română