@ae-studio/dxf-viewer
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "@ae-studio/dxf-viewer", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "JavaScript DXF file viewer", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -275,4 +275,73 @@ import * as three from "three" | ||
this.objects.set(key, handledObjects) | ||
} | ||
} | ||
for (const [key, { batches }] of this.blocks.entries()) { | ||
if (this.objects.has(key)) { | ||
continue | ||
} | ||
const block = sceneData.blocks.get(key); | ||
const handledObjects = [] | ||
for (const batch of batches) { | ||
if (batch.chunks) { | ||
for (const chunk of batch.chunks) { | ||
const object = this.CreateViewerObject({ | ||
batch, | ||
indices: chunk.indices, | ||
vertices: chunk.vertices, | ||
}) | ||
object.userData.block = block; | ||
handledObjects.push(object) | ||
} | ||
} else { | ||
if (batch.positions.size === 0) { | ||
const object = this.CreateViewerObject({ | ||
batch, | ||
indices: null, | ||
vertices: batch.vertices, | ||
}) | ||
object.userData.block = block; | ||
handledObjects.push(object) | ||
continue; | ||
} | ||
const [key, { block: positionBlock }] = Array.from(batch.positions)[0]; | ||
const blockBatch = positionBlock.batches[0]; | ||
if (blockBatch.chunks) { | ||
for (const chunk of blockBatch.chunks) { | ||
const object = this.CreateViewerObject({ | ||
batch, | ||
indices: chunk.indices, | ||
vertices: chunk.vertices, | ||
}) | ||
object.userData.block = block; | ||
handledObjects.push(object) | ||
} | ||
} else { | ||
const object = this.CreateViewerObject({ | ||
batch, | ||
indices: null, | ||
vertices: blockBatch.vertices, | ||
}) | ||
object.userData.block = block; | ||
handledObjects.push(object) | ||
} | ||
} | ||
} | ||
this.objects.set(key, handledObjects) | ||
} | ||
this._Emit("loaded") | ||
@@ -279,0 +348,0 @@ |
874840
19498