Package Exports
- @xhymf1992/3dtiles-sdk
- @xhymf1992/3dtiles-sdk/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@xhymf1992/3dtiles-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
3dtiles-sdk
介绍
基于node.js编写的3dtiles相关的开发工具包,可用于生成b3dm、i3dm等文件
安装教程
yarn add 3dtiles-sdk
使用说明
导出b3dm,glbBuffer可借助gltf-pipeline生成
import { Batched3DModel } from "@xhymf1992/3dtiles-sdk";
const batchLength = 3; // bactch 长度
const propertyData = new Int32Array(batchLength).fill(0); // batch table 属性
// 构建Batched3DModel类,需传入batch长度和glb数据
const b3dm = new Batched3DModel({
batchLength,
gltf: Buffer.from("")
});
// 添加属性,传入属性名和属性数组
b3dm.addProperty("propertyName", propertyData);
// 导出b3dm buffer
const b3dmBuffer = b3dm.exportBuffer();
// 异步导出文件
let b3dmPath = `./fileName.b3dm`;
await b3dm.exportFile(b3dmPath);