@jfk-solutions/demo3d-file-format 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/dist/binary.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/fast-xml.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/parser.js.map +1 -1
- package/dist/raw3d.d.ts +107 -0
- package/dist/raw3d.d.ts.map +1 -0
- package/dist/raw3d.js +281 -0
- package/dist/raw3d.js.map +1 -0
- package/dist/three/index.d.ts +1 -0
- package/dist/three/index.d.ts.map +1 -1
- package/dist/three/index.js +97 -13
- package/dist/three/index.js.map +1 -1
- package/dist/three/raw3d.d.ts +34 -0
- package/dist/three/raw3d.d.ts.map +1 -0
- package/dist/three/raw3d.js +319 -0
- package/dist/three/raw3d.js.map +1 -0
- package/dist/three/renderer.js.map +1 -1
- package/dist/xml.d.ts.map +1 -1
- package/dist/xml.js.map +1 -1
- package/dist/zip.d.ts.map +1 -1
- package/dist/zip.js.map +1 -1
- package/package.json +7 -6
package/dist/raw3d.js
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { decodeText, toUint8Array } from "./binary.js";
|
|
2
|
+
import { Demo3DUnsupportedError, Demo3DZipError } from "./errors.js";
|
|
3
|
+
import { parseDemo3DXmlFast } from "./fast-xml.js";
|
|
4
|
+
import { Demo3DResource } from "./model.js";
|
|
5
|
+
import { defaultParseXml, xmlDocumentToElement } from "./xml.js";
|
|
6
|
+
import { parseZip } from "./zip.js";
|
|
7
|
+
export class Raw3DView {
|
|
8
|
+
name;
|
|
9
|
+
position;
|
|
10
|
+
target;
|
|
11
|
+
constructor(name, position, target) {
|
|
12
|
+
this.name = name;
|
|
13
|
+
this.position = position;
|
|
14
|
+
this.target = target;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class Raw3DNode {
|
|
18
|
+
index;
|
|
19
|
+
name;
|
|
20
|
+
parentIndex;
|
|
21
|
+
meshIndex;
|
|
22
|
+
layerIndex;
|
|
23
|
+
materialIndices;
|
|
24
|
+
location;
|
|
25
|
+
rotation;
|
|
26
|
+
scale;
|
|
27
|
+
castsShadow;
|
|
28
|
+
customAttributes;
|
|
29
|
+
xml;
|
|
30
|
+
constructor(index, name, parentIndex, meshIndex, layerIndex, materialIndices, location, rotation, scale, castsShadow, customAttributes, xml) {
|
|
31
|
+
this.index = index;
|
|
32
|
+
this.name = name;
|
|
33
|
+
this.parentIndex = parentIndex;
|
|
34
|
+
this.meshIndex = meshIndex;
|
|
35
|
+
this.layerIndex = layerIndex;
|
|
36
|
+
this.materialIndices = materialIndices;
|
|
37
|
+
this.location = location;
|
|
38
|
+
this.rotation = rotation;
|
|
39
|
+
this.scale = scale;
|
|
40
|
+
this.castsShadow = castsShadow;
|
|
41
|
+
this.customAttributes = customAttributes;
|
|
42
|
+
this.xml = xml;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class Raw3DLayer {
|
|
46
|
+
name;
|
|
47
|
+
materialIndex;
|
|
48
|
+
xml;
|
|
49
|
+
constructor(name, materialIndex, xml) {
|
|
50
|
+
this.name = name;
|
|
51
|
+
this.materialIndex = materialIndex;
|
|
52
|
+
this.xml = xml;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export class Raw3DMaterial {
|
|
56
|
+
red;
|
|
57
|
+
green;
|
|
58
|
+
blue;
|
|
59
|
+
transparency;
|
|
60
|
+
reflectivity;
|
|
61
|
+
textureIndex;
|
|
62
|
+
normalTextureIndex;
|
|
63
|
+
normalScale;
|
|
64
|
+
scaleU;
|
|
65
|
+
scaleV;
|
|
66
|
+
xml;
|
|
67
|
+
constructor(red, green, blue, transparency, reflectivity, textureIndex, normalTextureIndex, normalScale, scaleU, scaleV, xml) {
|
|
68
|
+
this.red = red;
|
|
69
|
+
this.green = green;
|
|
70
|
+
this.blue = blue;
|
|
71
|
+
this.transparency = transparency;
|
|
72
|
+
this.reflectivity = reflectivity;
|
|
73
|
+
this.textureIndex = textureIndex;
|
|
74
|
+
this.normalTextureIndex = normalTextureIndex;
|
|
75
|
+
this.normalScale = normalScale;
|
|
76
|
+
this.scaleU = scaleU;
|
|
77
|
+
this.scaleV = scaleV;
|
|
78
|
+
this.xml = xml;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
export class Raw3DTexture {
|
|
82
|
+
path;
|
|
83
|
+
data;
|
|
84
|
+
xml;
|
|
85
|
+
constructor(path, data, xml) {
|
|
86
|
+
this.path = path;
|
|
87
|
+
this.data = data;
|
|
88
|
+
this.xml = xml;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
export class Raw3DVertexAttribute {
|
|
92
|
+
usage;
|
|
93
|
+
type;
|
|
94
|
+
componentCount;
|
|
95
|
+
offset;
|
|
96
|
+
xml;
|
|
97
|
+
constructor(usage, type, componentCount, offset, xml) {
|
|
98
|
+
this.usage = usage;
|
|
99
|
+
this.type = type;
|
|
100
|
+
this.componentCount = componentCount;
|
|
101
|
+
this.offset = offset;
|
|
102
|
+
this.xml = xml;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export class Raw3DVertexBuffer {
|
|
106
|
+
path;
|
|
107
|
+
attributes;
|
|
108
|
+
stride;
|
|
109
|
+
data;
|
|
110
|
+
xml;
|
|
111
|
+
constructor(path, attributes, stride, data, xml) {
|
|
112
|
+
this.path = path;
|
|
113
|
+
this.attributes = attributes;
|
|
114
|
+
this.stride = stride;
|
|
115
|
+
this.data = data;
|
|
116
|
+
this.xml = xml;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export class Raw3DIndexBuffer {
|
|
120
|
+
path;
|
|
121
|
+
data;
|
|
122
|
+
xml;
|
|
123
|
+
constructor(path, data, xml) {
|
|
124
|
+
this.path = path;
|
|
125
|
+
this.data = data;
|
|
126
|
+
this.xml = xml;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
export class Raw3DMesh {
|
|
130
|
+
vertexBufferIndex;
|
|
131
|
+
indexBufferIndices;
|
|
132
|
+
xml;
|
|
133
|
+
constructor(vertexBufferIndex, indexBufferIndices, xml) {
|
|
134
|
+
this.vertexBufferIndex = vertexBufferIndex;
|
|
135
|
+
this.indexBufferIndices = indexBufferIndices;
|
|
136
|
+
this.xml = xml;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
export class Raw3DProject {
|
|
140
|
+
root;
|
|
141
|
+
origin;
|
|
142
|
+
views;
|
|
143
|
+
nodes;
|
|
144
|
+
layers;
|
|
145
|
+
materials;
|
|
146
|
+
textures;
|
|
147
|
+
meshes;
|
|
148
|
+
vertexBuffers;
|
|
149
|
+
indexBuffers;
|
|
150
|
+
constructor(root, origin, views, nodes, layers, materials, textures, meshes, vertexBuffers, indexBuffers) {
|
|
151
|
+
this.root = root;
|
|
152
|
+
this.origin = origin;
|
|
153
|
+
this.views = views;
|
|
154
|
+
this.nodes = nodes;
|
|
155
|
+
this.layers = layers;
|
|
156
|
+
this.materials = materials;
|
|
157
|
+
this.textures = textures;
|
|
158
|
+
this.meshes = meshes;
|
|
159
|
+
this.vertexBuffers = vertexBuffers;
|
|
160
|
+
this.indexBuffers = indexBuffers;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export class Raw3DPackage {
|
|
164
|
+
entries;
|
|
165
|
+
modelEntryName;
|
|
166
|
+
modelXml;
|
|
167
|
+
model;
|
|
168
|
+
thumbnail;
|
|
169
|
+
aspects;
|
|
170
|
+
constructor(entries, modelEntryName, modelXml, model, thumbnail, aspects) {
|
|
171
|
+
this.entries = entries;
|
|
172
|
+
this.modelEntryName = modelEntryName;
|
|
173
|
+
this.modelXml = modelXml;
|
|
174
|
+
this.model = model;
|
|
175
|
+
this.thumbnail = thumbnail;
|
|
176
|
+
this.aspects = aspects;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
export async function parseRaw3D(input, options = {}) {
|
|
180
|
+
const archive = parseZip(toUint8Array(input));
|
|
181
|
+
const entryByPath = new Map(archive.entries.map((entry) => [entry.name.toLowerCase(), entry]));
|
|
182
|
+
const modelEntry = entryByPath.get("model.xml");
|
|
183
|
+
if (!modelEntry) {
|
|
184
|
+
throw new Demo3DZipError('No "Model.xml" scene entry was found in the RAW3D package.');
|
|
185
|
+
}
|
|
186
|
+
if (modelEntry.uncompressedSize === 0) {
|
|
187
|
+
throw new Demo3DUnsupportedError('RAW3D scene entry "Model.xml" is empty.', "RAW3D_EMPTY_MODEL");
|
|
188
|
+
}
|
|
189
|
+
const modelXml = decodeText(await modelEntry.arrayBuffer(), "utf-8");
|
|
190
|
+
const root = options.parseXml || options.xmlParser === "dom"
|
|
191
|
+
? xmlDocumentToElement((options.parseXml ?? defaultParseXml)(modelXml))
|
|
192
|
+
: parseDemo3DXmlFast(modelXml);
|
|
193
|
+
if (root.localName !== "Scene") {
|
|
194
|
+
throw new Demo3DUnsupportedError(`RAW3D Model.xml has unsupported root element "${root.name}".`, "RAW3D_MODEL_ROOT_UNSUPPORTED");
|
|
195
|
+
}
|
|
196
|
+
const loadData = async (path) => {
|
|
197
|
+
const entry = entryByPath.get(path.toLowerCase());
|
|
198
|
+
return entry ? entry.arrayBuffer() : undefined;
|
|
199
|
+
};
|
|
200
|
+
const model = await extractRaw3DProject(root, loadData);
|
|
201
|
+
const thumbnailEntry = entryByPath.get("thumbnail.png");
|
|
202
|
+
const aspectsEntry = entryByPath.get("aspects.json");
|
|
203
|
+
const [thumbnail, aspects] = await Promise.all([
|
|
204
|
+
thumbnailEntry ? toResource(thumbnailEntry) : undefined,
|
|
205
|
+
aspectsEntry ? toResource(aspectsEntry) : undefined
|
|
206
|
+
]);
|
|
207
|
+
return new Raw3DPackage(archive.entries.map(toEntryInfo), modelEntry.name, modelXml, model, thumbnail, aspects);
|
|
208
|
+
}
|
|
209
|
+
async function extractRaw3DProject(root, loadData) {
|
|
210
|
+
const textureElements = root.child("Textures")?.childrenNamed("Texture") ?? [];
|
|
211
|
+
const vertexBufferElements = root.child("VertexBuffers")?.childrenNamed("VertexBuffer") ?? [];
|
|
212
|
+
const indexBufferElements = root.child("IndexBuffers")?.childrenNamed("IndexBuffer") ?? [];
|
|
213
|
+
const [textureData, vertexData, indexData] = await Promise.all([
|
|
214
|
+
Promise.all(textureElements.map((element) => loadData(attribute(element, "Path") ?? ""))),
|
|
215
|
+
Promise.all(vertexBufferElements.map((element) => loadData(attribute(element, "Path") ?? ""))),
|
|
216
|
+
Promise.all(indexBufferElements.map((element) => loadData(attribute(element, "Path") ?? "")))
|
|
217
|
+
]);
|
|
218
|
+
return new Raw3DProject(root, attribute(root, "Origin"), (root.child("Views")?.childrenNamed("View") ?? []).map((element) => new Raw3DView(attribute(element, "Name") ?? "", numberList(attribute(element, "Position")), numberList(attribute(element, "Target")))), (root.child("Nodes")?.childrenNamed("Node") ?? []).map((element, position) => new Raw3DNode(integerAttribute(element, "Index") ?? position, attribute(element, "Name") ?? "", integerAttribute(element, "Parent"), integerAttribute(element, "Mesh"), integerAttribute(element, "Layer"), integerList(attribute(element, "Materials")), numberList(attribute(element, "Location")), numberList(attribute(element, "Rotation")), numberList(attribute(element, "Scale"), [1, 1, 1]), booleanAttribute(element, "CastsShadow", true), parseCustomAttributes(attribute(element, "CustomAttributes")), element)), (root.child("Layers")?.childrenNamed("Layer") ?? []).map((element) => new Raw3DLayer(attribute(element, "Name") ?? "", integerAttribute(element, "Material"), element)), (root.child("Materials")?.childrenNamed("Material") ?? []).map((element) => new Raw3DMaterial(numberAttribute(element, "R", 0), numberAttribute(element, "G", 0), numberAttribute(element, "B", 0), numberAttribute(element, "A", 0), numberAttribute(element, "Reflectivity", 0), integerAttribute(element, "Texture"), integerAttribute(element, "NormalTexture"), numberAttribute(element, "NormalScale", 1), numberAttribute(element, "SU", 1), numberAttribute(element, "SV", 1), element)), textureElements.map((element, index) => new Raw3DTexture(attribute(element, "Path") ?? "", textureData[index], element)), (root.child("Meshes")?.childrenNamed("Mesh") ?? []).map((element) => new Raw3DMesh(integerAttribute(element, "VertexBuffer") ?? -1, integerList(attribute(element, "IndexBuffers")), element)), vertexBufferElements.map((element, index) => {
|
|
219
|
+
let offset = 0;
|
|
220
|
+
const attributes = element.childrenNamed("Attribute").map((attributeElement) => {
|
|
221
|
+
const type = attribute(attributeElement, "Type") ?? "Vector3";
|
|
222
|
+
const componentCount = vectorComponentCount(type);
|
|
223
|
+
const result = new Raw3DVertexAttribute(attribute(attributeElement, "Usage") ?? "", type, componentCount, offset, attributeElement);
|
|
224
|
+
offset += componentCount * 4;
|
|
225
|
+
return result;
|
|
226
|
+
});
|
|
227
|
+
return new Raw3DVertexBuffer(attribute(element, "Path") ?? "", attributes, offset, vertexData[index], element);
|
|
228
|
+
}), indexBufferElements.map((element, index) => new Raw3DIndexBuffer(attribute(element, "Path") ?? "", indexData[index], element)));
|
|
229
|
+
}
|
|
230
|
+
function attribute(element, name) {
|
|
231
|
+
return element.attributes.find((item) => item.localName === name)?.value;
|
|
232
|
+
}
|
|
233
|
+
function numberAttribute(element, name, fallback) {
|
|
234
|
+
const parsed = Number.parseFloat(attribute(element, name) ?? "");
|
|
235
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
236
|
+
}
|
|
237
|
+
function integerAttribute(element, name) {
|
|
238
|
+
const parsed = Number.parseInt(attribute(element, name) ?? "", 10);
|
|
239
|
+
return Number.isFinite(parsed) ? parsed : undefined;
|
|
240
|
+
}
|
|
241
|
+
function booleanAttribute(element, name, fallback) {
|
|
242
|
+
const value = attribute(element, name)?.toLowerCase();
|
|
243
|
+
return value === undefined ? fallback : value !== "false" && value !== "0";
|
|
244
|
+
}
|
|
245
|
+
function numberList(value, fallback = []) {
|
|
246
|
+
if (!value) {
|
|
247
|
+
return [...fallback];
|
|
248
|
+
}
|
|
249
|
+
return value.trim().split(/\s+/).map(Number).filter(Number.isFinite);
|
|
250
|
+
}
|
|
251
|
+
function integerList(value) {
|
|
252
|
+
return numberList(value).map((item) => Math.trunc(item));
|
|
253
|
+
}
|
|
254
|
+
function vectorComponentCount(type) {
|
|
255
|
+
const match = /Vector([1-4])$/i.exec(type);
|
|
256
|
+
return match ? Number.parseInt(match[1], 10) : 3;
|
|
257
|
+
}
|
|
258
|
+
function parseCustomAttributes(value) {
|
|
259
|
+
const attributes = new Map();
|
|
260
|
+
const parts = value?.split("|") ?? [];
|
|
261
|
+
for (let index = 0; index + 1 < parts.length; index += 2) {
|
|
262
|
+
if (parts[index]) {
|
|
263
|
+
attributes.set(parts[index], parts[index + 1]);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return attributes;
|
|
267
|
+
}
|
|
268
|
+
function toEntryInfo(entry) {
|
|
269
|
+
return {
|
|
270
|
+
name: entry.name,
|
|
271
|
+
compressedSize: entry.compressedSize,
|
|
272
|
+
uncompressedSize: entry.uncompressedSize,
|
|
273
|
+
compressionMethod: entry.compressionMethod,
|
|
274
|
+
flags: entry.flags,
|
|
275
|
+
crc32: entry.crc32
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
async function toResource(entry) {
|
|
279
|
+
return new Demo3DResource(entry.name, toEntryInfo(entry), await entry.arrayBuffer());
|
|
280
|
+
}
|
|
281
|
+
//# sourceMappingURL=raw3d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw3d.js","sourceRoot":"","sources":["../src/raw3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAoB,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EA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,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,KAAe;IACvC,OAAO,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACvF,CAAC"}
|
package/dist/three/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as Three from "three";
|
|
2
2
|
import { Demo3DMaterial, Demo3DMesh, Demo3DPackage, Demo3DProject } from "../model.js";
|
|
3
|
+
export { createRaw3DThreeGroup, createRaw3DThreeScene, decodeRaw3DThreeGeometry, type Raw3DThreeModule, type Raw3DThreeOptions, type Raw3DThreeScene, type Raw3DThreeStats, type Raw3DThreeWarning } from "./raw3d.js";
|
|
3
4
|
export { createDemo3DThreeRenderer, type Demo3DThreeCanvasRendererOptions, type Demo3DThreeModule, type Demo3DThreeRendererInstance, type Demo3DThreeRendererFallback, type Demo3DThreeRendererResult, type Demo3DThreeRenderBackend, type Demo3DThreeWebGPUModule } from "./renderer.js";
|
|
4
5
|
export type ThreeModule = typeof Three;
|
|
5
6
|
export interface Demo3DThreeWarning {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/three/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,EAML,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EAKd,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,iBAAiB,EACtB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,WAAW,GAAG,OAAO,KAAK,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,C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Package, Demo3DProject, Demo3DPhotoEye, Demo3DResource, Demo3DSupportStand, Demo3DVisual } from "../model.js";
|
|
2
2
|
import { Demo3DBinaryBlock, Demo3DXmlElement } from "../xml.js";
|
|
3
|
+
export { createRaw3DThreeGroup, createRaw3DThreeScene, decodeRaw3DThreeGeometry } from "./raw3d.js";
|
|
3
4
|
export { createDemo3DThreeRenderer } from "./renderer.js";
|
|
4
5
|
export async function createDemo3DThreeScene(parsed, options = {}) {
|
|
5
6
|
const three = await resolveThree(options);
|
|
@@ -88,6 +89,7 @@ export function decodeDemo3DThreeGeometry(mesh, three) {
|
|
|
88
89
|
if (mesh.indices) {
|
|
89
90
|
geometry.setIndex(new three.BufferAttribute(readIndexBuffer(mesh.indices, mesh.indexFormat), 1));
|
|
90
91
|
}
|
|
92
|
+
addMeshSubsetGroups(geometry, mesh);
|
|
91
93
|
convertTriangleGeometryToThreeCoordinates(geometry);
|
|
92
94
|
if (!normals) {
|
|
93
95
|
geometry.computeVertexNormals();
|
|
@@ -96,6 +98,25 @@ export function decodeDemo3DThreeGeometry(mesh, three) {
|
|
|
96
98
|
geometry.computeBoundingSphere();
|
|
97
99
|
return geometry;
|
|
98
100
|
}
|
|
101
|
+
function addMeshSubsetGroups(geometry, mesh) {
|
|
102
|
+
const subsets = mesh.auxiliary?.toUint8Array();
|
|
103
|
+
const drawCount = geometry.getIndex()?.count ?? geometry.getAttribute("position").count;
|
|
104
|
+
const faceCount = Math.floor(drawCount / 3);
|
|
105
|
+
if (!subsets || subsets.length !== faceCount || faceCount === 0) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
let runStart = 0;
|
|
109
|
+
let materialIndex = subsets[0] ?? 0;
|
|
110
|
+
for (let face = 1; face <= faceCount; face += 1) {
|
|
111
|
+
const nextMaterialIndex = face < faceCount ? subsets[face] : undefined;
|
|
112
|
+
if (face < faceCount && nextMaterialIndex === materialIndex) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
geometry.addGroup(runStart * 3, (face - runStart) * 3, materialIndex);
|
|
116
|
+
runStart = face;
|
|
117
|
+
materialIndex = nextMaterialIndex ?? 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
99
120
|
export function createDemo3DThreeMaterial(material, three) {
|
|
100
121
|
const diffuse = material?.diffuse;
|
|
101
122
|
const color = diffuse === undefined ? 0x9aa0a6 : demo3dColorToHex(diffuse);
|
|
@@ -192,7 +213,7 @@ function createVisualObject(visual, state, inheritedLayer, parentVisual) {
|
|
|
192
213
|
meshes.push(directVisualObject);
|
|
193
214
|
}
|
|
194
215
|
for (const ref of refs) {
|
|
195
|
-
const mesh = createMeshObject(ref, visual, visual.materials
|
|
216
|
+
const mesh = createMeshObject(ref, visual, visual.materials, state);
|
|
196
217
|
if (mesh) {
|
|
197
218
|
if (mesh.userData.demo3d?.kind === "missing-geometry-placeholder") {
|
|
198
219
|
placeholderObjects.push(mesh);
|
|
@@ -281,11 +302,13 @@ function createAspectRenderableObjects(visual, state) {
|
|
|
281
302
|
for (const renderable of renderables.children) {
|
|
282
303
|
const meshIds = findMeshReferenceIds(renderable);
|
|
283
304
|
for (const meshId of meshIds) {
|
|
284
|
-
const
|
|
305
|
+
const serializedMaterials = renderableMaterials(renderable);
|
|
306
|
+
const materials = serializedMaterials.length > 0 ? serializedMaterials : visual.materials;
|
|
307
|
+
const primaryMaterial = materials[0];
|
|
285
308
|
const mesh = state.meshById.has(meshId)
|
|
286
|
-
? createMeshObject(meshId, renderable,
|
|
287
|
-
: createPrimitiveRenderableObject(aspect, renderable, meshId,
|
|
288
|
-
createMeshObject(meshId, renderable,
|
|
309
|
+
? createMeshObject(meshId, renderable, materials, state)
|
|
310
|
+
: createPrimitiveRenderableObject(aspect, renderable, meshId, primaryMaterial, state) ??
|
|
311
|
+
createMeshObject(meshId, renderable, materials, state);
|
|
289
312
|
if (!mesh) {
|
|
290
313
|
continue;
|
|
291
314
|
}
|
|
@@ -1604,6 +1627,7 @@ function getDirectVisualGeometry(visual, state) {
|
|
|
1604
1627
|
properties.textOf("Length") ?? "",
|
|
1605
1628
|
properties.textOf("Radius") ?? "",
|
|
1606
1629
|
properties.textOf("StartAngle") ?? "",
|
|
1630
|
+
properties.textOf("Thickness") ?? "",
|
|
1607
1631
|
properties.textOf("Width") ?? ""
|
|
1608
1632
|
].join("|")}`;
|
|
1609
1633
|
const cached = state.primitiveGeometryCache.get(key);
|
|
@@ -1611,9 +1635,12 @@ function getDirectVisualGeometry(visual, state) {
|
|
|
1611
1635
|
return cached;
|
|
1612
1636
|
}
|
|
1613
1637
|
let geometry;
|
|
1614
|
-
if (visual.typeName === "e3d:BoxVisual"
|
|
1638
|
+
if (visual.typeName === "e3d:BoxVisual") {
|
|
1615
1639
|
geometry = new state.three.BoxGeometry(numberChild(properties, "Width", 1), numberChild(properties, "Height", 1), numberChild(properties, "Depth", 1));
|
|
1616
1640
|
}
|
|
1641
|
+
else if (visual.typeName === "e3d:BoxTubeVisual") {
|
|
1642
|
+
geometry = createBoxTubeGeometry(numberChild(properties, "Width", 0.25), numberChild(properties, "Height", 1), numberChild(properties, "Depth", 0.25), numberChild(properties, "Thickness", 0.015), state);
|
|
1643
|
+
}
|
|
1617
1644
|
else if (visual.typeName === "e3d:CylinderVisual") {
|
|
1618
1645
|
geometry = new state.three.CylinderGeometry(numberChild(properties, "Radius", 0.5), numberChild(properties, "Radius", 0.5), numberChild(properties, "Length", 1), 32, 1, false, degreesToRadians(numberChild(properties, "StartAngle", 0)), degreesToRadians(numberChild(properties, "Angle", 360)));
|
|
1619
1646
|
}
|
|
@@ -1630,6 +1657,37 @@ function getDirectVisualGeometry(visual, state) {
|
|
|
1630
1657
|
state.stats.geometries += 1;
|
|
1631
1658
|
return geometry;
|
|
1632
1659
|
}
|
|
1660
|
+
function createBoxTubeGeometry(width, height, depth, thickness, state) {
|
|
1661
|
+
const halfWidth = Math.max(width, 0) / 2;
|
|
1662
|
+
const halfDepth = Math.max(depth, 0) / 2;
|
|
1663
|
+
const edge = clamp(thickness, 0, Math.min(halfWidth, halfDepth));
|
|
1664
|
+
const shape = new state.three.Shape();
|
|
1665
|
+
shape.moveTo(-halfWidth, -halfDepth);
|
|
1666
|
+
shape.lineTo(-halfWidth, halfDepth);
|
|
1667
|
+
shape.lineTo(halfWidth, halfDepth);
|
|
1668
|
+
shape.lineTo(halfWidth, -halfDepth);
|
|
1669
|
+
shape.closePath();
|
|
1670
|
+
const innerHalfWidth = halfWidth - edge;
|
|
1671
|
+
const innerHalfDepth = halfDepth - edge;
|
|
1672
|
+
if (innerHalfWidth > 0 && innerHalfDepth > 0) {
|
|
1673
|
+
const hole = new state.three.Path();
|
|
1674
|
+
hole.moveTo(-innerHalfWidth, -innerHalfDepth);
|
|
1675
|
+
hole.lineTo(innerHalfWidth, -innerHalfDepth);
|
|
1676
|
+
hole.lineTo(innerHalfWidth, innerHalfDepth);
|
|
1677
|
+
hole.lineTo(-innerHalfWidth, innerHalfDepth);
|
|
1678
|
+
hole.closePath();
|
|
1679
|
+
shape.holes.push(hole);
|
|
1680
|
+
}
|
|
1681
|
+
const geometry = new state.three.ExtrudeGeometry(shape, {
|
|
1682
|
+
depth: Math.max(height, 0),
|
|
1683
|
+
steps: 1,
|
|
1684
|
+
bevelEnabled: false
|
|
1685
|
+
});
|
|
1686
|
+
// ExtrudeGeometry uses Z for its extrusion. Demo3D box tubes extrude along Y.
|
|
1687
|
+
geometry.rotateX(-Math.PI / 2);
|
|
1688
|
+
geometry.translate(0, -Math.max(height, 0) / 2, 0);
|
|
1689
|
+
return geometry;
|
|
1690
|
+
}
|
|
1633
1691
|
function createWedgeGeometry(width, height, length, state) {
|
|
1634
1692
|
const x = width / 2;
|
|
1635
1693
|
const y = height / 2;
|
|
@@ -1696,8 +1754,12 @@ function getDrawingBlockGeometry(blockId, state) {
|
|
|
1696
1754
|
state.stats.geometries += 1;
|
|
1697
1755
|
return geometry;
|
|
1698
1756
|
}
|
|
1699
|
-
function createMeshObject(meshId, source,
|
|
1757
|
+
function createMeshObject(meshId, source, materialSelection, state) {
|
|
1700
1758
|
const mesh = state.meshById.get(meshId);
|
|
1759
|
+
const materials = Array.isArray(materialSelection)
|
|
1760
|
+
? materialSelection
|
|
1761
|
+
: materialSelection ? [materialSelection] : [];
|
|
1762
|
+
const primaryMaterial = materials[0];
|
|
1701
1763
|
const sourceId = source instanceof Demo3DVisual ? source.id : source.textOf("Id");
|
|
1702
1764
|
const sourceType = source instanceof Demo3DVisual ? source.typeName : source.xsiType ?? source.localName;
|
|
1703
1765
|
const xmlPath = source instanceof Demo3DVisual ? source.xml.path : source.path;
|
|
@@ -1710,20 +1772,24 @@ function createMeshObject(meshId, source, material, state) {
|
|
|
1710
1772
|
xmlPath
|
|
1711
1773
|
});
|
|
1712
1774
|
return state.options.showPlaceholders === true
|
|
1713
|
-
? createPlaceholderMesh(sourceId ?? meshId, meshId,
|
|
1775
|
+
? createPlaceholderMesh(sourceId ?? meshId, meshId, primaryMaterial, state)
|
|
1714
1776
|
: undefined;
|
|
1715
1777
|
}
|
|
1716
1778
|
const geometry = getGeometry(mesh, state);
|
|
1717
1779
|
if (!geometry) {
|
|
1718
1780
|
return state.options.showPlaceholders === true
|
|
1719
|
-
? createPlaceholderMesh(sourceId ?? meshId, meshId,
|
|
1781
|
+
? createPlaceholderMesh(sourceId ?? meshId, meshId, primaryMaterial, state)
|
|
1720
1782
|
: undefined;
|
|
1721
1783
|
}
|
|
1722
|
-
const
|
|
1784
|
+
const threeMaterial = materials.length > 1
|
|
1785
|
+
? materials.map((material) => getMaterial(material, state))
|
|
1786
|
+
: getMaterial(primaryMaterial, state);
|
|
1787
|
+
const object = new state.three.Mesh(geometry, threeMaterial);
|
|
1723
1788
|
object.name = source instanceof Demo3DVisual ? source.displayName ?? meshId : meshId;
|
|
1724
1789
|
object.userData.demo3d = {
|
|
1725
1790
|
kind: "mesh",
|
|
1726
1791
|
meshId,
|
|
1792
|
+
materialSlots: materials.length,
|
|
1727
1793
|
sourceId,
|
|
1728
1794
|
sourceType,
|
|
1729
1795
|
xmlPath
|
|
@@ -2217,8 +2283,7 @@ function createSerializedRenderableGroup(state) {
|
|
|
2217
2283
|
}
|
|
2218
2284
|
const meshIds = findMeshReferenceIds(renderable);
|
|
2219
2285
|
for (const meshId of meshIds) {
|
|
2220
|
-
const
|
|
2221
|
-
const mesh = createMeshObject(meshId, renderable, material, state);
|
|
2286
|
+
const mesh = createMeshObject(meshId, renderable, renderableMaterials(renderable), state);
|
|
2222
2287
|
if (!mesh) {
|
|
2223
2288
|
continue;
|
|
2224
2289
|
}
|
|
@@ -2418,6 +2483,23 @@ function findVisualMeshReferenceIds(root) {
|
|
|
2418
2483
|
}
|
|
2419
2484
|
return [...ids];
|
|
2420
2485
|
}
|
|
2486
|
+
function renderableMaterials(renderable) {
|
|
2487
|
+
const materials = [];
|
|
2488
|
+
const materialProperties = renderable.child("MaterialProperties");
|
|
2489
|
+
for (const entry of materialProperties?.children ?? []) {
|
|
2490
|
+
const material = firstMaterial(entry);
|
|
2491
|
+
if (material) {
|
|
2492
|
+
materials.push(material);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
if (materials.length === 0) {
|
|
2496
|
+
const material = firstMaterial(renderable);
|
|
2497
|
+
if (material) {
|
|
2498
|
+
materials.push(material);
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
return materials;
|
|
2502
|
+
}
|
|
2421
2503
|
function firstMaterial(root) {
|
|
2422
2504
|
let found;
|
|
2423
2505
|
visit(root, (node) => {
|
|
@@ -2501,7 +2583,9 @@ function applyDemo3DTransform(object, transformText) {
|
|
|
2501
2583
|
return;
|
|
2502
2584
|
}
|
|
2503
2585
|
object.position.set(values[0] ?? 0, values[1] ?? 0, -(values[2] ?? 0));
|
|
2504
|
-
|
|
2586
|
+
// Demo3D rotation triples are pitch (X), yaw (Y), and roll (Z). Its
|
|
2587
|
+
// RotationYawPitchRoll matrix corresponds to Three's intrinsic YXZ order.
|
|
2588
|
+
object.rotation.set(-(values[3] ?? 0), -(values[4] ?? 0), values[5] ?? 0, "YXZ");
|
|
2505
2589
|
}
|
|
2506
2590
|
function convertTriangleGeometryToThreeCoordinates(geometry) {
|
|
2507
2591
|
geometry.scale(1, 1, -1);
|