vim-format
Advanced tools
Comparing version 1.0.6-dev.130 to 1.0.6-dev.131
@@ -65,2 +65,3 @@ /** | ||
getLocalBfast(name: string, unzip?: boolean): Promise<BFast | undefined>; | ||
getLocalBfastRaw(name: string, unzip?: boolean): Promise<BFast | undefined>; | ||
/** | ||
@@ -67,0 +68,0 @@ * Returns the raw buffer associated with a name |
@@ -229,2 +229,11 @@ "use strict"; | ||
} | ||
async getLocalBfastRaw(name, unzip = false) { | ||
let buffer = await this.getBuffer(name); | ||
if (!buffer) | ||
return undefined; | ||
if (unzip) { | ||
buffer = pako.inflateRaw(buffer).buffer; | ||
} | ||
return new BFast(buffer, 0, name); | ||
} | ||
/** | ||
@@ -231,0 +240,0 @@ * Returns the raw buffer associated with a name |
@@ -29,2 +29,11 @@ import { BFast } from "./bfast"; | ||
getMesh(mesh: number): Promise<G3dMesh>; | ||
getIndexRaw(): Promise<G3dMeshIndex>; | ||
/** | ||
* Fetches and returns the vimx G3dMaterials | ||
*/ | ||
getMaterialsRaw(): Promise<G3dMaterials>; | ||
/** | ||
* Fetches and returns the vimx G3dMesh with given index | ||
*/ | ||
getMeshRaw(mesh: number): Promise<G3dMesh>; | ||
} |
@@ -51,3 +51,21 @@ "use strict"; | ||
} | ||
async getIndexRaw() { | ||
const index = await this.bfast.getLocalBfastRaw('index', true); | ||
return g3dMeshIndex_1.G3dMeshIndex.createFromBfast(index); | ||
} | ||
/** | ||
* Fetches and returns the vimx G3dMaterials | ||
*/ | ||
async getMaterialsRaw() { | ||
const mat = await this.bfast.getLocalBfastRaw('materials', true); | ||
return g3dMaterials_1.G3dMaterial.createFromBfast(mat); | ||
} | ||
/** | ||
* Fetches and returns the vimx G3dMesh with given index | ||
*/ | ||
async getMeshRaw(mesh) { | ||
const m = await this.bfast.getLocalBfastRaw(`mesh_${mesh}`, true); | ||
return g3dMesh_1.G3dMesh.createFromBfast(m); | ||
} | ||
} | ||
exports.RemoteGeometry = RemoteGeometry; |
@@ -65,2 +65,3 @@ /** | ||
getLocalBfast(name: string, unzip?: boolean): Promise<BFast | undefined>; | ||
getLocalBfastRaw(name: string, unzip?: boolean): Promise<BFast | undefined>; | ||
/** | ||
@@ -67,0 +68,0 @@ * Returns the raw buffer associated with a name |
@@ -29,2 +29,11 @@ import { BFast } from "./bfast"; | ||
getMesh(mesh: number): Promise<G3dMesh>; | ||
getIndexRaw(): Promise<G3dMeshIndex>; | ||
/** | ||
* Fetches and returns the vimx G3dMaterials | ||
*/ | ||
getMaterialsRaw(): Promise<G3dMaterials>; | ||
/** | ||
* Fetches and returns the vimx G3dMesh with given index | ||
*/ | ||
getMeshRaw(mesh: number): Promise<G3dMesh>; | ||
} |
{ | ||
"name": "vim-format", | ||
"version": "1.0.6-dev.130", | ||
"version": "1.0.6-dev.131", | ||
"description": "The VIM format is a modern and efficient open 3D data interchange format designed for BIM and manufacturing data optimized for efficient loading and rendering on low-power devices.", | ||
@@ -5,0 +5,0 @@ "directories": { |
801063
18205