자주 묻는 질문들
자주 묻는 질문들
@aspose/3d를 어떻게 설치할 수 있나요?
Node.js 18 또는 이후의 설치가 필요합니다 :
asposefoss/3d is not yet published — build from source until it ships. See the project README for build instructions.설치를 확인하십시오 :
import { Scene } from '@aspose/3d';
const scene = new Scene();
console.log('@aspose/3d ready');TypeScript 형식의 정의는 패키지와 연결되어 있습니다.별로 없음 @types/ 패키지가 필요합니다.
어떤 파일 형식이 지원되는가?
| 형식 | 수입 | 수출 |
|---|---|---|
| OBJ | 예 예 | 예 예 |
| GSTF | 예 예 | 예 예 |
| FBX | 아니오* | 아니오* |
| STL | 예 예 | 예 예 |
| 3MF | 예 예 | 예 예 |
| COLLADA | 예 예 | 예 예 |
3D 파일을 어떻게 업로드할 수 있나요?
A를 만드는 것 Scene 그리고 전화 scene.open():
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const scene = new Scene();
scene.open('model.obj', new ObjLoadOptions());특별한 옵션이 필요하지 않은 형식의 경우 두 번째 주장을 놓치십시오 :
const scene = new Scene();
scene.open('model.glb');(이제) 무시무시한가요?
아니오 니. scene.open() 그리고 scene.openFromBuffer() I/O를 차단하지 않으면 Node.js 작업자 스트립 내부에서 실행하거나 삽입하십시오. setImmediate.
어떻게 glTF/GLB에 저장할 수 있습니까?
전화기 scene.save() 파일 경로를 사용하여 형식은 확장에서 자동으로 감지됩니다 :
scene.save('output.glb'); // binary glTF
scene.save('output.gltf'); // JSON glTF
scene.save('output.obj'); // OBJ
scene.save('output.stl'); // STL
내가 어떻게 을 수 있는가?(그림으로)?
사용하기 scene.openFromBuffer():
import * as fs from 'fs';
import { Scene } from '@aspose/3d';
import { ObjLoadOptions } from '@aspose/3d/formats/obj';
const buffer = fs.readFileSync('model.obj');
const scene = new Scene();
scene.openFromBuffer(buffer, new ObjLoadOptions());오류: 모듈 ‘@aspose/3d/formats/obj’을 찾을 수 없습니다.
이것은 Node.js 12.7+ 패키지 수출 해상도를 필요로합니다.Node .js 18+에 있는지 확인하십시오.TypeScript, 설정 "moduleResolution": "node16" 또는 "bundler" 안에 있는 tsconfig.json:
{
"compilerOptions": {
"moduleResolution": "node16",
"target": "ES2020"
}
}node.entity의 종류는 무엇입니까?
node.entity 넓게 인쇄됩니다. 메쉬 특정 속성에 액세스하려면, 그들의 존재를 확인하여 'controlPoints' in node.entity 또는 사용하십시오 Mesh 클래스에서 @aspose/3d/entities:
import { Mesh } from '@aspose/3d/entities';
if (node.entity instanceof Mesh) {
const mesh = node.entity;
console.log(mesh.controlPoints.length);
}도서관이 브라우저에서 실행되고 있습니까?
도서관은 Node.js를 위해 설계되었습니다 브라우저 지원은 팩터 구성 및 파일 시스템 APIs가 메모리에서 대체되는 것에 달려 있습니다.
도서관이 안전한가요?
각각의 Scene 개체는 독립적입니다.별도로 사용하여 Scene 별도의 Node.js 작업자 스트립의 사례는 외부 동기화없이 스트리트를 통해 단 하나의 장면을 공유하지 않는 한 안전합니다.
어떤 Node.js 버전이 지원되는가?
Node.js 18, 20 및 22는 공식적으로 지원됩니다.TypeScript 5.0+ 권장합니다.
@aspose/3d 애니메이션을 지원합니까?
예, 애니메이션 시스템은 포함되어 있습니다. AnimationClip, AnimationChannel, 그리고 키 프레임 커버 유형 접근 가능한 @aspose/3d/animation.