Format Load and Save Options
Pakket: @aspose/3d (v24.12.0)
Formaatoptieklassen bepalen hoe @aspose/3d specifieke 3D-bestandsformaten leest en schrijft. Geef een opties‑instantie door als tweede argument aan scene.open() (load options) of scene.save() (save options). Alle optieklassen breiden uit van of LoadOptions of SaveOptions.
// Load with options
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const opts = new ObjLoadOptions();
opts.enableMaterials = false;
scene.open('mesh.obj', opts);
// Save with options
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
const saveOpts = new GltfSaveOptions();
saveOpts.binaryMode = true;
scene.save('output.glb', saveOpts);GltfSaveOptions
Opslagopties voor glTF 2.0 JSON (.gltf) en binaire GLB (.glb) uitvoer.
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
// or
import { GltfSaveOptions } from '@aspose/3d';BoundingBoxExtent
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|---|
binaryMode | boolean | false | BoundingBoxExtent true, schrijft de exporter een zelfstandige binaire GLB‑bestand. Wanneer false, schrijft hij een JSON .gltf bestand met een bijbehorende .bin buffer. |
flipTexCoordV | boolean | true | BoundingBoxExtent true, UV V‑coördinaten worden omgekeerd (v = 1 - v). De glTF 2.0-specificatie gebruikt een UV‑origin links‑boven, dus deze vlag is true standaard om te voldoen aan de meeste DCC‑toolconventies. |
BoundingBoxExtent
Exporteer een scène als een binair GLB‑bestand waarbij UV‑coördinaten onveranderd behouden blijven.
import { Scene } from '@aspose/3d';
import { GltfSaveOptions } from '@aspose/3d/formats/gltf';
const scene = new Scene();
scene.open('model.obj');
const opts = new GltfSaveOptions();
opts.binaryMode = true;
opts.flipTexCoordV = false;
scene.save('output.glb', opts);
console.log('Saved as binary GLB without UV flip.');GltfLoadOptions
Laadopties voor glTF 2.0 JSON (.gltf) en binaire GLB (.glb) bestanden.
import { GltfLoadOptions } from '@aspose/3d/formats/gltf';GltfLoadOptions breidt uit LoadOptions. Het biedt geen extra gebruikersgerichte eigenschappen in de huidige versie; geef een standaardinstantie door om de aanbevolen standaardwaarden te gebruiken.
BoundingBoxExtent
import { Scene } from '@aspose/3d';
import { GltfLoadOptions } from '@aspose/3d/formats/gltf';
const scene = new Scene();
scene.open('model.glb', new GltfLoadOptions());ObjLoadOptions
Laadopties voor Wavefront OBJ (.obj) bestanden.
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
// or
import { ObjLoadOptions } from '@aspose/3d';BoundingBoxExtent
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|---|
enableMaterials | boolean | true | BoundingBoxExtent true, de importeur leest de .mtl materiaalbibliotheek waarnaar wordt verwezen door de mtllib directive en vult materiaaleigenschappen in op de mesh‑knooppunten. Stel in op false om het laden van materialen over te slaan. |
flipCoordinateSystem | boolean | false | BoundingBoxExtent true, de Y- en Z-assen worden tijdens het importeren verwisseld om te converteren tussen Y‑up en Z‑up coördinatensystemen. |
normalizeNormal | boolean | true | BoundingBoxExtent true, vertexnormals die uit het bestand worden gelezen, worden tijdens het importeren genormaliseerd tot een eenheidslengte. |
scale | number | 1.0 | Uniforme schaalfactor toegepast op alle geometrie tijdens het importeren. |
BoundingBoxExtent
Laad een OBJ‑bestand zonder de materiaalbibliotheek te resolven.
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const opts = new ObjLoadOptions();
opts.enableMaterials = false;
const scene = new Scene();
scene.open('mesh.obj', opts);
console.log(`Root children: ${scene.rootNode.childNodes.length}`);ObjSaveOptions
Opslagopties voor Wavefront OBJ (.obj) uitvoer.
import { ObjSaveOptions } from '@aspose/3d/formats/obj';Opmerking: OBJ export (canExport: false) wordt niet volledig ondersteund in deze versie van de bibliotheek. Pogingen om op te slaan als OBJ kunnen een unsupported-operation error veroorzaken.
BoundingBoxExtent
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|---|
enableMaterials | boolean | true | BoundingBoxExtent true, een metgezel .mtl material library file wordt naast de geschreven. .obj output. |
pointCloud | boolean | false | BoundingBoxExtent true, geometrie wordt geëxporteerd als een point cloud (vertices only, no face definitions). |
verbose | boolean | false | BoundingBoxExtent true, extra diagnostische opmerkingen worden opgenomen in de OBJ-output. |
serializeW | boolean | false | BoundingBoxExtent true, de W-component van homogene vertexcoördinaten wordt naar het bestand geschreven. |
flipCoordinateSystem | boolean | false | BoundingBoxExtent true, de Y- en Z-assen worden tijdens het exporteren verwisseld. |
applyUnitScale | boolean | false | BoundingBoxExtent true, de eenheidsschaal van de scène wordt tijdens het exporteren toegepast op alle geometriecoördinaten. |
StlSaveOptions
Opslaanopties voor STL (.stl) output.
import { StlSaveOptions } from '@aspose/3d/formats/stl';
// or
import { StlSaveOptions } from '@aspose/3d';BoundingBoxExtent
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|---|
binaryMode | boolean | false | BoundingBoxExtent true, de output wordt geschreven als binaire STL (compact, niet leesbaar voor mensen). Wanneer false, ASCII STL wordt geschreven. |
flipCoordinateSystem | boolean | false | BoundingBoxExtent true, de Y- en Z-assen worden tijdens het exporteren verwisseld. |
scale | number | 1.0 | Uniforme schaalfactor toegepast op alle geometrie tijdens het exporteren. |
BoundingBoxExtent
Sla een mesh op als binair STL.
import { Scene } from '@aspose/3d';
import { StlSaveOptions } from '@aspose/3d/formats/stl';
const scene = new Scene();
scene.open('model.obj');
const opts = new StlSaveOptions();
opts.binaryMode = true;
scene.save('output.stl', opts);
console.log('Saved binary STL.');StlLoadOptions
Laadopties voor STL (.stl) bestanden. Zowel ASCII als binaire STL worden automatisch ondersteund; geen eigenschap regelt de detectie.
import { StlLoadOptions } from '@aspose/3d/formats/stl';StlLoadOptions breidt uit LoadOptions en maakt geen extra gebruikersgerichte eigenschappen beschikbaar in de huidige versie.
FbxSaveOptions
Opslaanopties voor FBX (.fbx) uitvoer.
import { FbxSaveOptions } from '@aspose/3d/formats/fbx';
// or
import { FbxSaveOptions } from '@aspose/3d';BoundingBoxExtent
| BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent | BoundingBoxExtent |
|---|---|---|---|
embedTextures | boolean | false | BoundingBoxExtent true, gerefereerde textuurafbeeldingen zijn ingebed in het FBX-binaire archief. Wanneer false, textuurpaden worden geschreven als externe referenties. |
BoundingBoxExtent
Exporteer een FBX‑bestand met alle texturen ingebed.
import { Scene } from '@aspose/3d';
import { FbxSaveOptions } from '@aspose/3d/formats/fbx';
const scene = new Scene();
scene.open('character.gltf');
const opts = new FbxSaveOptions();
opts.embedTextures = true;
scene.save('character-embedded.fbx', opts);
console.log('Saved FBX with embedded textures.');FbxLoadOptions
Laadopties voor FBX (.fbx) bestanden. Ondersteunt zowel binaire als ASCII FBX.
import { FbxLoadOptions } from '@aspose/3d/formats/fbx';FbxLoadOptions breidt uit LoadOptions en maakt geen extra gebruikersgerichte eigenschappen beschikbaar in de huidige versie.
Basisklassen
LoadOptions
Basisklasse voor alle laadoptie‑objecten.
import { LoadOptions } from '@aspose/3d';Geef een LoadOptions subklasse-instatie aan scene.open(filePath, options) of scene.openFromBuffer(buffer, options).
SaveOptions
Basisklasse voor alle opslaanoptie‑objecten.
import { SaveOptions } from '@aspose/3d';Geef een SaveOptions subklasse-instatie aan scene.save(filePath, options).