@onerjs/core 8.42.8 → 8.43.1

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.
Files changed (41) hide show
  1. package/AudioV2/audioUtils.d.ts +23 -0
  2. package/AudioV2/audioUtils.js +37 -0
  3. package/AudioV2/audioUtils.js.map +1 -1
  4. package/AudioV2/webAudio/webAudioStaticSound.js +3 -2
  5. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  6. package/AudioV2/webAudio/webAudioStreamingSound.js +10 -3
  7. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  8. package/Engines/WebGPU/webgpuTextureManager.js +10 -1
  9. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  10. package/Engines/abstractEngine.js +2 -2
  11. package/Engines/abstractEngine.js.map +1 -1
  12. package/Layers/selectionOutlineLayer.js +8 -0
  13. package/Layers/selectionOutlineLayer.js.map +1 -1
  14. package/Layers/thinSelectionOutlineLayer.js +15 -0
  15. package/Layers/thinSelectionOutlineLayer.js.map +1 -1
  16. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js +3 -3
  17. package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.js.map +1 -1
  18. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +16 -0
  19. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +30 -5
  20. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  21. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js +4 -4
  22. package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.js.map +1 -1
  23. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -2
  24. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +46 -36
  25. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  26. package/Meshes/Node/Blocks/extrudeGeometryBlock.d.ts +61 -0
  27. package/Meshes/Node/Blocks/extrudeGeometryBlock.js +297 -0
  28. package/Meshes/Node/Blocks/extrudeGeometryBlock.js.map +1 -0
  29. package/Meshes/Node/index.d.ts +1 -0
  30. package/Meshes/Node/index.js +1 -0
  31. package/Meshes/Node/index.js.map +1 -1
  32. package/Misc/tools.js +9 -5
  33. package/Misc/tools.js.map +1 -1
  34. package/Misc/webRequest.d.ts +34 -3
  35. package/Misc/webRequest.js +107 -24
  36. package/Misc/webRequest.js.map +1 -1
  37. package/Physics/v2/characterController.d.ts +1 -1
  38. package/Physics/v2/characterController.js.map +1 -1
  39. package/ShadersWGSL/lightingVolume.compute.js +1 -1
  40. package/ShadersWGSL/lightingVolume.compute.js.map +1 -1
  41. package/package.json +1 -1
@@ -0,0 +1,61 @@
1
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
2
+ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint.js";
3
+ import type { NodeGeometryBuildState } from "../nodeGeometryBuildState.js";
4
+ /**
5
+ * Cap mode for the extrusion
6
+ */
7
+ export declare enum ExtrudeGeometryCap {
8
+ /** No caps — only the extruded side walls are generated */
9
+ NoCap = 0,
10
+ /** Cap the bottom face (the original input geometry face) */
11
+ CapStart = 1,
12
+ /** Cap the top face (the offset/extruded geometry face) */
13
+ CapEnd = 2,
14
+ /** Cap both the bottom and top faces (default). Creates a solid */
15
+ CapAll = 3
16
+ }
17
+ /**
18
+ * Block used to extrude a geometry along its face normals
19
+ */
20
+ export declare class ExtrudeGeometryBlock extends NodeGeometryBlock {
21
+ /**
22
+ * Gets or sets a boolean indicating that this block can evaluate context
23
+ * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
24
+ */
25
+ evaluateContext: boolean;
26
+ /**
27
+ * Gets or sets the cap mode for the extrusion
28
+ */
29
+ cap: ExtrudeGeometryCap;
30
+ /**
31
+ * Create a new ExtrudeGeometryBlock
32
+ * @param name defines the block name
33
+ */
34
+ constructor(name: string);
35
+ /**
36
+ * Gets the current class name
37
+ * @returns the class name
38
+ */
39
+ getClassName(): string;
40
+ /**
41
+ * Gets the geometry input component
42
+ */
43
+ get geometry(): NodeGeometryConnectionPoint;
44
+ /**
45
+ * Gets the depth input component
46
+ */
47
+ get depth(): NodeGeometryConnectionPoint;
48
+ /**
49
+ * Gets the geometry output component
50
+ */
51
+ get output(): NodeGeometryConnectionPoint;
52
+ protected _buildBlock(state: NodeGeometryBuildState): void;
53
+ protected _dumpPropertiesCode(): string;
54
+ /**
55
+ * Serializes this block in a JSON representation
56
+ * @returns the serialized block object
57
+ */
58
+ serialize(): any;
59
+ /** @internal */
60
+ _deserialize(serializationObject: any): void;
61
+ }
@@ -0,0 +1,297 @@
1
+ import { __decorate } from "../../../tslib.es6.js";
2
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
3
+ import { RegisterClass } from "../../../Misc/typeStore.js";
4
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
5
+ import { editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
6
+ import { Vector3 } from "../../../Maths/math.vector.js";
7
+ import { VertexData } from "../../mesh.vertexData.js";
8
+ /**
9
+ * Cap mode for the extrusion
10
+ */
11
+ export var ExtrudeGeometryCap;
12
+ (function (ExtrudeGeometryCap) {
13
+ /** No caps — only the extruded side walls are generated */
14
+ ExtrudeGeometryCap[ExtrudeGeometryCap["NoCap"] = 0] = "NoCap";
15
+ /** Cap the bottom face (the original input geometry face) */
16
+ ExtrudeGeometryCap[ExtrudeGeometryCap["CapStart"] = 1] = "CapStart";
17
+ /** Cap the top face (the offset/extruded geometry face) */
18
+ ExtrudeGeometryCap[ExtrudeGeometryCap["CapEnd"] = 2] = "CapEnd";
19
+ /** Cap both the bottom and top faces (default). Creates a solid */
20
+ ExtrudeGeometryCap[ExtrudeGeometryCap["CapAll"] = 3] = "CapAll";
21
+ })(ExtrudeGeometryCap || (ExtrudeGeometryCap = {}));
22
+ /**
23
+ * Block used to extrude a geometry along its face normals
24
+ */
25
+ export class ExtrudeGeometryBlock extends NodeGeometryBlock {
26
+ /**
27
+ * Create a new ExtrudeGeometryBlock
28
+ * @param name defines the block name
29
+ */
30
+ constructor(name) {
31
+ super(name);
32
+ /**
33
+ * Gets or sets a boolean indicating that this block can evaluate context
34
+ * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
35
+ */
36
+ this.evaluateContext = false;
37
+ /**
38
+ * Gets or sets the cap mode for the extrusion
39
+ */
40
+ this.cap = ExtrudeGeometryCap.CapAll;
41
+ this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
42
+ this.registerInput("depth", NodeGeometryBlockConnectionPointTypes.Float, true, 1.0);
43
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
44
+ }
45
+ /**
46
+ * Gets the current class name
47
+ * @returns the class name
48
+ */
49
+ getClassName() {
50
+ return "ExtrudeGeometryBlock";
51
+ }
52
+ /**
53
+ * Gets the geometry input component
54
+ */
55
+ get geometry() {
56
+ return this._inputs[0];
57
+ }
58
+ /**
59
+ * Gets the depth input component
60
+ */
61
+ get depth() {
62
+ return this._inputs[1];
63
+ }
64
+ /**
65
+ * Gets the geometry output component
66
+ */
67
+ get output() {
68
+ return this._outputs[0];
69
+ }
70
+ _buildBlock(state) {
71
+ const func = (state) => {
72
+ const inputGeometry = this.geometry.getConnectedValue(state);
73
+ if (!inputGeometry || !inputGeometry.positions || !inputGeometry.indices) {
74
+ return null;
75
+ }
76
+ const vertexData = inputGeometry.clone();
77
+ const positions = vertexData.positions;
78
+ const indices = vertexData.indices;
79
+ const depthValue = this.depth.getConnectedValue(state) ?? 1.0;
80
+ if (depthValue === 0) {
81
+ return vertexData;
82
+ }
83
+ // Step 2: Compute average face normal
84
+ const normal = new Vector3(0, 0, 0);
85
+ const v0 = new Vector3();
86
+ const v1 = new Vector3();
87
+ const v2 = new Vector3();
88
+ const edge1 = new Vector3();
89
+ const edge2 = new Vector3();
90
+ const faceNormal = new Vector3();
91
+ for (let i = 0; i < indices.length; i += 3) {
92
+ const i0 = indices[i];
93
+ const i1 = indices[i + 1];
94
+ const i2 = indices[i + 2];
95
+ v0.set(positions[i0 * 3], positions[i0 * 3 + 1], positions[i0 * 3 + 2]);
96
+ v1.set(positions[i1 * 3], positions[i1 * 3 + 1], positions[i1 * 3 + 2]);
97
+ v2.set(positions[i2 * 3], positions[i2 * 3 + 1], positions[i2 * 3 + 2]);
98
+ v1.subtractToRef(v0, edge1);
99
+ v2.subtractToRef(v0, edge2);
100
+ Vector3.CrossToRef(edge1, edge2, faceNormal);
101
+ normal.addInPlace(faceNormal);
102
+ }
103
+ if (normal.lengthSquared() < 1e-10) {
104
+ normal.set(0, 1, 0);
105
+ }
106
+ else {
107
+ normal.normalize();
108
+ }
109
+ // Step 3: Create offset positions
110
+ const offset = normal.scale(depthValue);
111
+ const vertexCount = positions.length / 3;
112
+ const bottomPositions = new Float32Array(positions);
113
+ const topPositions = new Float32Array(vertexCount * 3);
114
+ for (let i = 0; i < vertexCount; i++) {
115
+ topPositions[i * 3] = positions[i * 3] + offset.x;
116
+ topPositions[i * 3 + 1] = positions[i * 3 + 1] + offset.y;
117
+ topPositions[i * 3 + 2] = positions[i * 3 + 2] + offset.z;
118
+ }
119
+ // Step 4: Detect boundary edges
120
+ const edgeCount = new Map();
121
+ for (let i = 0; i < indices.length; i += 3) {
122
+ const triIdx = i;
123
+ const triVerts = [indices[i], indices[i + 1], indices[i + 2]];
124
+ for (let e = 0; e < 3; e++) {
125
+ const a = triVerts[e];
126
+ const b = triVerts[(e + 1) % 3];
127
+ const key = Math.min(a, b) + "_" + Math.max(a, b);
128
+ const existing = edgeCount.get(key);
129
+ if (existing) {
130
+ existing.count++;
131
+ }
132
+ else {
133
+ edgeCount.set(key, { count: 1, triIndex: triIdx });
134
+ }
135
+ }
136
+ }
137
+ // Collect boundary edges with winding info
138
+ const boundaryEdges = [];
139
+ for (const [key, value] of Array.from(edgeCount)) {
140
+ if (value.count === 1) {
141
+ const parts = key.split("_");
142
+ const minV = parseInt(parts[0]);
143
+ const maxV = parseInt(parts[1]);
144
+ // Check original winding order in the triangle
145
+ const ti = value.triIndex;
146
+ const t0 = indices[ti];
147
+ const t1 = indices[ti + 1];
148
+ const t2 = indices[ti + 2];
149
+ // Determine if edge (minV, maxV) appears in order or reversed in the triangle
150
+ let inOrder = false;
151
+ if ((t0 === minV && t1 === maxV) || (t1 === minV && t2 === maxV) || (t2 === minV && t0 === maxV)) {
152
+ inOrder = true;
153
+ }
154
+ boundaryEdges.push({ a: minV, b: maxV, orderedAb: inOrder });
155
+ }
156
+ }
157
+ // Step 5: Generate side wall faces
158
+ const sideIndices = [];
159
+ for (const edge of boundaryEdges) {
160
+ const a = edge.a;
161
+ const b = edge.b;
162
+ const aTop = a + vertexCount;
163
+ const bTop = b + vertexCount;
164
+ if (edge.orderedAb) {
165
+ // Edge appears as (a, b) in triangle — outward normals
166
+ sideIndices.push(a, b, bTop);
167
+ sideIndices.push(a, bTop, aTop);
168
+ }
169
+ else {
170
+ // Edge appears as (b, a) in triangle — reverse winding
171
+ sideIndices.push(b, a, aTop);
172
+ sideIndices.push(b, aTop, bTop);
173
+ }
174
+ }
175
+ // Step 6: Assemble final VertexData
176
+ const capStart = (this.cap & ExtrudeGeometryCap.CapStart) !== 0;
177
+ const capEnd = (this.cap & ExtrudeGeometryCap.CapEnd) !== 0;
178
+ // Build indices
179
+ const finalIndices = [];
180
+ // Bottom cap: original indices
181
+ if (capStart) {
182
+ for (let i = 0; i < indices.length; i++) {
183
+ finalIndices.push(indices[i]);
184
+ }
185
+ }
186
+ // Top cap: original indices offset by vertexCount, reversed winding
187
+ if (capEnd) {
188
+ for (let i = 0; i < indices.length; i += 3) {
189
+ finalIndices.push(indices[i] + vertexCount);
190
+ finalIndices.push(indices[i + 2] + vertexCount);
191
+ finalIndices.push(indices[i + 1] + vertexCount);
192
+ }
193
+ }
194
+ // Side walls
195
+ for (let i = 0; i < sideIndices.length; i++) {
196
+ finalIndices.push(sideIndices[i]);
197
+ }
198
+ // Build positions: [bottom, top]
199
+ const finalPositions = new Float32Array(vertexCount * 2 * 3);
200
+ finalPositions.set(bottomPositions, 0);
201
+ finalPositions.set(topPositions, vertexCount * 3);
202
+ // Build the result VertexData
203
+ const result = new VertexData();
204
+ result.positions = Array.from(finalPositions);
205
+ result.indices = finalIndices;
206
+ // Duplicate UVs if present
207
+ if (vertexData.uvs) {
208
+ const uvs = vertexData.uvs;
209
+ const finalUVs = new Float32Array(vertexCount * 2 * 2);
210
+ finalUVs.set(new Float32Array(uvs), 0);
211
+ finalUVs.set(new Float32Array(uvs), vertexCount * 2);
212
+ result.uvs = Array.from(finalUVs);
213
+ }
214
+ // Duplicate colors if present
215
+ if (vertexData.colors) {
216
+ const colors = vertexData.colors;
217
+ const finalColors = new Float32Array(vertexCount * 2 * 4);
218
+ finalColors.set(new Float32Array(colors), 0);
219
+ finalColors.set(new Float32Array(colors), vertexCount * 4);
220
+ result.colors = Array.from(finalColors);
221
+ }
222
+ // Duplicate tangents if present
223
+ if (vertexData.tangents) {
224
+ const tangents = vertexData.tangents;
225
+ const finalTangents = new Float32Array(vertexCount * 2 * 4);
226
+ finalTangents.set(new Float32Array(tangents), 0);
227
+ finalTangents.set(new Float32Array(tangents), vertexCount * 4);
228
+ result.tangents = Array.from(finalTangents);
229
+ }
230
+ // Duplicate UV2-UV6 if present
231
+ const uvSets = ["uvs2", "uvs3", "uvs4", "uvs5", "uvs6"];
232
+ for (const uvSet of uvSets) {
233
+ const uvData = vertexData[uvSet];
234
+ if (uvData) {
235
+ const finalUV = new Float32Array(vertexCount * 2 * 2);
236
+ finalUV.set(new Float32Array(uvData), 0);
237
+ finalUV.set(new Float32Array(uvData), vertexCount * 2);
238
+ result[uvSet] = Array.from(finalUV);
239
+ }
240
+ }
241
+ // Compute normals using the simplified approach
242
+ const normals = [];
243
+ VertexData.ComputeNormals(result.positions, result.indices, normals);
244
+ result.normals = normals;
245
+ return result;
246
+ };
247
+ if (this.evaluateContext) {
248
+ this.output._storedFunction = func;
249
+ }
250
+ else {
251
+ this.output._storedFunction = null;
252
+ this.output._storedValue = func(state);
253
+ }
254
+ }
255
+ _dumpPropertiesCode() {
256
+ let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
257
+ codeString += `${this._codeVariableName}.cap = BABYLON.ExtrudeGeometryCap.${ExtrudeGeometryCap[this.cap]};\n`;
258
+ return codeString;
259
+ }
260
+ /**
261
+ * Serializes this block in a JSON representation
262
+ * @returns the serialized block object
263
+ */
264
+ serialize() {
265
+ const serializationObject = super.serialize();
266
+ serializationObject.evaluateContext = this.evaluateContext;
267
+ serializationObject.cap = this.cap;
268
+ return serializationObject;
269
+ }
270
+ /** @internal */
271
+ _deserialize(serializationObject) {
272
+ super._deserialize(serializationObject);
273
+ if (serializationObject.evaluateContext !== undefined) {
274
+ this.evaluateContext = serializationObject.evaluateContext;
275
+ }
276
+ if (serializationObject.cap !== undefined) {
277
+ this.cap = serializationObject.cap;
278
+ }
279
+ }
280
+ }
281
+ __decorate([
282
+ editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { embedded: true, notifiers: { rebuild: true } })
283
+ ], ExtrudeGeometryBlock.prototype, "evaluateContext", void 0);
284
+ __decorate([
285
+ editableInPropertyPage("Cap", 5 /* PropertyTypeForEdition.List */, "ADVANCED", {
286
+ notifiers: { rebuild: true },
287
+ embedded: true,
288
+ options: [
289
+ { label: "No Cap", value: ExtrudeGeometryCap.NoCap },
290
+ { label: "Cap Start", value: ExtrudeGeometryCap.CapStart },
291
+ { label: "Cap End", value: ExtrudeGeometryCap.CapEnd },
292
+ { label: "Cap All", value: ExtrudeGeometryCap.CapAll },
293
+ ],
294
+ })
295
+ ], ExtrudeGeometryBlock.prototype, "cap", void 0);
296
+ RegisterClass("BABYLON.ExtrudeGeometryBlock", ExtrudeGeometryBlock);
297
+ //# sourceMappingURL=extrudeGeometryBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extrudeGeometryBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/extrudeGeometryBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAA0B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAN,IAAY,kBASX;AATD,WAAY,kBAAkB;IAC1B,2DAA2D;IAC3D,6DAAS,CAAA;IACT,6DAA6D;IAC7D,mEAAY,CAAA;IACZ,2DAA2D;IAC3D,+DAAU,CAAA;IACV,mEAAmE;IACnE,+DAAU,CAAA;AACd,CAAC,EATW,kBAAkB,KAAlB,kBAAkB,QAS7B;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IAuBvD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QA3BhB;;;WAGG;QAEI,oBAAe,GAAG,KAAK,CAAC;QAE/B;;WAEG;QAWI,QAAG,GAAG,kBAAkB,CAAC,MAAM,CAAC;QASnC,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAEpF,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IAC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,IAAI,mBAAmB,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;YACpD,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC/D,CAAC;QACD,IAAI,mBAAmB,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;YACxC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,CAAC;QACvC,CAAC;IACL,CAAC;CACJ;AAjTU;IADN,sBAAsB,CAAC,kBAAkB,0CAAkC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;6DAC1G;AAexB;IAVN,sBAAsB,CAAC,KAAK,uCAA+B,UAAU,EAAE;QACpE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,CAAC,KAAK,EAAE;YACpD,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,kBAAkB,CAAC,QAAQ,EAAE;YAC1D,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,CAAC,MAAM,EAAE;YACtD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,CAAC,MAAM,EAAE;SACzD;KACJ,CAAC;iDACqC;AAoS3C,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport { Vector3 } from \"../../../Maths/math.vector\";\r\nimport { VertexData } from \"../../mesh.vertexData\";\r\n\r\n/**\r\n * Cap mode for the extrusion\r\n */\r\nexport enum ExtrudeGeometryCap {\r\n /** No caps — only the extruded side walls are generated */\r\n NoCap = 0,\r\n /** Cap the bottom face (the original input geometry face) */\r\n CapStart = 1,\r\n /** Cap the top face (the offset/extruded geometry face) */\r\n CapEnd = 2,\r\n /** Cap both the bottom and top faces (default). Creates a solid */\r\n CapAll = 3,\r\n}\r\n\r\n/**\r\n * Block used to extrude a geometry along its face normals\r\n */\r\nexport class ExtrudeGeometryBlock extends NodeGeometryBlock {\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { embedded: true, notifiers: { rebuild: true } })\r\n public evaluateContext = false;\r\n\r\n /**\r\n * Gets or sets the cap mode for the extrusion\r\n */\r\n @editableInPropertyPage(\"Cap\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { rebuild: true },\r\n embedded: true,\r\n options: [\r\n { label: \"No Cap\", value: ExtrudeGeometryCap.NoCap },\r\n { label: \"Cap Start\", value: ExtrudeGeometryCap.CapStart },\r\n { label: \"Cap End\", value: ExtrudeGeometryCap.CapEnd },\r\n { label: \"Cap All\", value: ExtrudeGeometryCap.CapAll },\r\n ],\r\n })\r\n public cap = ExtrudeGeometryCap.CapAll;\r\n\r\n /**\r\n * Create a new ExtrudeGeometryBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"depth\", NodeGeometryBlockConnectionPointTypes.Float, true, 1.0);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"ExtrudeGeometryBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth input component\r\n */\r\n public get depth(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n const inputGeometry = this.geometry.getConnectedValue(state) as VertexData;\r\n\r\n if (!inputGeometry || !inputGeometry.positions || !inputGeometry.indices) {\r\n return null;\r\n }\r\n\r\n const vertexData = inputGeometry.clone();\r\n const positions = vertexData.positions!;\r\n const indices = vertexData.indices!;\r\n const depthValue: number = this.depth.getConnectedValue(state) ?? 1.0;\r\n\r\n if (depthValue === 0) {\r\n return vertexData;\r\n }\r\n\r\n // Step 2: Compute average face normal\r\n const normal = new Vector3(0, 0, 0);\r\n const v0 = new Vector3();\r\n const v1 = new Vector3();\r\n const v2 = new Vector3();\r\n const edge1 = new Vector3();\r\n const edge2 = new Vector3();\r\n const faceNormal = new Vector3();\r\n\r\n for (let i = 0; i < indices.length; i += 3) {\r\n const i0 = indices[i];\r\n const i1 = indices[i + 1];\r\n const i2 = indices[i + 2];\r\n\r\n v0.set(positions[i0 * 3], positions[i0 * 3 + 1], positions[i0 * 3 + 2]);\r\n v1.set(positions[i1 * 3], positions[i1 * 3 + 1], positions[i1 * 3 + 2]);\r\n v2.set(positions[i2 * 3], positions[i2 * 3 + 1], positions[i2 * 3 + 2]);\r\n\r\n v1.subtractToRef(v0, edge1);\r\n v2.subtractToRef(v0, edge2);\r\n Vector3.CrossToRef(edge1, edge2, faceNormal);\r\n\r\n normal.addInPlace(faceNormal);\r\n }\r\n\r\n if (normal.lengthSquared() < 1e-10) {\r\n normal.set(0, 1, 0);\r\n } else {\r\n normal.normalize();\r\n }\r\n\r\n // Step 3: Create offset positions\r\n const offset = normal.scale(depthValue);\r\n const vertexCount = positions.length / 3;\r\n const bottomPositions = new Float32Array(positions);\r\n const topPositions = new Float32Array(vertexCount * 3);\r\n\r\n for (let i = 0; i < vertexCount; i++) {\r\n topPositions[i * 3] = positions[i * 3] + offset.x;\r\n topPositions[i * 3 + 1] = positions[i * 3 + 1] + offset.y;\r\n topPositions[i * 3 + 2] = positions[i * 3 + 2] + offset.z;\r\n }\r\n\r\n // Step 4: Detect boundary edges\r\n const edgeCount = new Map<string, { count: number; triIndex: number }>();\r\n for (let i = 0; i < indices.length; i += 3) {\r\n const triIdx = i;\r\n const triVerts = [indices[i], indices[i + 1], indices[i + 2]];\r\n\r\n for (let e = 0; e < 3; e++) {\r\n const a = triVerts[e];\r\n const b = triVerts[(e + 1) % 3];\r\n const key = Math.min(a, b) + \"_\" + Math.max(a, b);\r\n\r\n const existing = edgeCount.get(key);\r\n if (existing) {\r\n existing.count++;\r\n } else {\r\n edgeCount.set(key, { count: 1, triIndex: triIdx });\r\n }\r\n }\r\n }\r\n\r\n // Collect boundary edges with winding info\r\n const boundaryEdges: { a: number; b: number; orderedAb: boolean }[] = [];\r\n for (const [key, value] of Array.from(edgeCount)) {\r\n if (value.count === 1) {\r\n const parts = key.split(\"_\");\r\n const minV = parseInt(parts[0]);\r\n const maxV = parseInt(parts[1]);\r\n\r\n // Check original winding order in the triangle\r\n const ti = value.triIndex;\r\n const t0 = indices[ti];\r\n const t1 = indices[ti + 1];\r\n const t2 = indices[ti + 2];\r\n\r\n // Determine if edge (minV, maxV) appears in order or reversed in the triangle\r\n let inOrder = false;\r\n if ((t0 === minV && t1 === maxV) || (t1 === minV && t2 === maxV) || (t2 === minV && t0 === maxV)) {\r\n inOrder = true;\r\n }\r\n\r\n boundaryEdges.push({ a: minV, b: maxV, orderedAb: inOrder });\r\n }\r\n }\r\n\r\n // Step 5: Generate side wall faces\r\n const sideIndices: number[] = [];\r\n for (const edge of boundaryEdges) {\r\n const a = edge.a;\r\n const b = edge.b;\r\n const aTop = a + vertexCount;\r\n const bTop = b + vertexCount;\r\n\r\n if (edge.orderedAb) {\r\n // Edge appears as (a, b) in triangle — outward normals\r\n sideIndices.push(a, b, bTop);\r\n sideIndices.push(a, bTop, aTop);\r\n } else {\r\n // Edge appears as (b, a) in triangle — reverse winding\r\n sideIndices.push(b, a, aTop);\r\n sideIndices.push(b, aTop, bTop);\r\n }\r\n }\r\n\r\n // Step 6: Assemble final VertexData\r\n const capStart = (this.cap & ExtrudeGeometryCap.CapStart) !== 0;\r\n const capEnd = (this.cap & ExtrudeGeometryCap.CapEnd) !== 0;\r\n\r\n // Build indices\r\n const finalIndices: number[] = [];\r\n\r\n // Bottom cap: original indices\r\n if (capStart) {\r\n for (let i = 0; i < indices.length; i++) {\r\n finalIndices.push(indices[i]);\r\n }\r\n }\r\n\r\n // Top cap: original indices offset by vertexCount, reversed winding\r\n if (capEnd) {\r\n for (let i = 0; i < indices.length; i += 3) {\r\n finalIndices.push(indices[i] + vertexCount);\r\n finalIndices.push(indices[i + 2] + vertexCount);\r\n finalIndices.push(indices[i + 1] + vertexCount);\r\n }\r\n }\r\n\r\n // Side walls\r\n for (let i = 0; i < sideIndices.length; i++) {\r\n finalIndices.push(sideIndices[i]);\r\n }\r\n\r\n // Build positions: [bottom, top]\r\n const finalPositions = new Float32Array(vertexCount * 2 * 3);\r\n finalPositions.set(bottomPositions, 0);\r\n finalPositions.set(topPositions, vertexCount * 3);\r\n\r\n // Build the result VertexData\r\n const result = new VertexData();\r\n result.positions = Array.from(finalPositions);\r\n result.indices = finalIndices;\r\n\r\n // Duplicate UVs if present\r\n if (vertexData.uvs) {\r\n const uvs = vertexData.uvs;\r\n const finalUVs = new Float32Array(vertexCount * 2 * 2);\r\n finalUVs.set(new Float32Array(uvs), 0);\r\n finalUVs.set(new Float32Array(uvs), vertexCount * 2);\r\n result.uvs = Array.from(finalUVs);\r\n }\r\n\r\n // Duplicate colors if present\r\n if (vertexData.colors) {\r\n const colors = vertexData.colors;\r\n const finalColors = new Float32Array(vertexCount * 2 * 4);\r\n finalColors.set(new Float32Array(colors), 0);\r\n finalColors.set(new Float32Array(colors), vertexCount * 4);\r\n result.colors = Array.from(finalColors);\r\n }\r\n\r\n // Duplicate tangents if present\r\n if (vertexData.tangents) {\r\n const tangents = vertexData.tangents;\r\n const finalTangents = new Float32Array(vertexCount * 2 * 4);\r\n finalTangents.set(new Float32Array(tangents), 0);\r\n finalTangents.set(new Float32Array(tangents), vertexCount * 4);\r\n result.tangents = Array.from(finalTangents);\r\n }\r\n\r\n // Duplicate UV2-UV6 if present\r\n const uvSets = [\"uvs2\", \"uvs3\", \"uvs4\", \"uvs5\", \"uvs6\"] as const;\r\n for (const uvSet of uvSets) {\r\n const uvData = (vertexData as any)[uvSet];\r\n if (uvData) {\r\n const finalUV = new Float32Array(vertexCount * 2 * 2);\r\n finalUV.set(new Float32Array(uvData), 0);\r\n finalUV.set(new Float32Array(uvData), vertexCount * 2);\r\n (result as any)[uvSet] = Array.from(finalUV);\r\n }\r\n }\r\n\r\n // Compute normals using the simplified approach\r\n const normals: number[] = [];\r\n VertexData.ComputeNormals(result.positions, result.indices, normals);\r\n result.normals = normals;\r\n\r\n return result;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n codeString += `${this._codeVariableName}.cap = BABYLON.ExtrudeGeometryCap.${ExtrudeGeometryCap[this.cap]};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.cap = this.cap;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /** @internal */\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n }\r\n if (serializationObject.cap !== undefined) {\r\n this.cap = serializationObject.cap;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ExtrudeGeometryBlock\", ExtrudeGeometryBlock);\r\n"]}
@@ -85,3 +85,4 @@ export * from "./Blocks/geometryInterceptorBlock.js";
85
85
  export * from "./Blocks/geometryEaseBlock.js";
86
86
  export * from "./Blocks/Set/aggregatorBlock.js";
87
87
  export * from "./Blocks/subdivideBlock.js";
88
+ export * from "./Blocks/extrudeGeometryBlock.js";
@@ -85,4 +85,5 @@ export * from "./Blocks/geometryInterceptorBlock.js";
85
85
  export * from "./Blocks/geometryEaseBlock.js";
86
86
  export * from "./Blocks/Set/aggregatorBlock.js";
87
87
  export * from "./Blocks/subdivideBlock.js";
88
+ export * from "./Blocks/extrudeGeometryBlock.js";
88
89
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,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AuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Sources/pointListBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/cleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\nexport * from \"./Blocks/geometryEaseBlock\";\r\nexport * from \"./Blocks/Set/aggregatorBlock\";\r\nexport * from \"./Blocks/subd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;AACxC,cAAc,+BAA+B,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Sources/pointListBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/cleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\nexport * from \"./Blocks/geometryEaseBlock\";\r\nexport * from \"./Blocks/Set/aggregatorBlock\";\r\nexport * from \"./Blocks/subdivideBlock\";\r\nexport * from \"./Blocks/extrudeGeometryBlock\";\r\n"]}
package/Misc/tools.js CHANGED
@@ -372,7 +372,7 @@ export class Tools {
372
372
  }
373
373
  if (_a.AssetBaseUrl && url.startsWith(_a._DefaultAssetsUrl)) {
374
374
  // normalize the baseUrl
375
- const baseUrl = _a.AssetBaseUrl[_a.AssetBaseUrl.length - 1] === "/" ? _a.AssetBaseUrl.substring(0, _a.AssetBaseUrl.length - 1) : _a.AssetBaseUrl;
375
+ const baseUrl = _a.AssetBaseUrl.endsWith("/") ? _a.AssetBaseUrl.slice(0, -1) : _a.AssetBaseUrl;
376
376
  return url.replace(_a._DefaultAssetsUrl, baseUrl);
377
377
  }
378
378
  return url;
@@ -392,13 +392,17 @@ export class Tools {
392
392
  // if the base URL was set, and the script Url is an absolute path change the default path
393
393
  // change the default host, which is https://cdn.babylonjs.com with the one defined
394
394
  // make sure no trailing slash is present
395
- const baseUrl = _a.ScriptBaseUrl[_a.ScriptBaseUrl.length - 1] === "/" ? _a.ScriptBaseUrl.substring(0, _a.ScriptBaseUrl.length - 1) : _a.ScriptBaseUrl;
395
+ const baseUrl = _a.ScriptBaseUrl.endsWith("/") ? _a.ScriptBaseUrl.slice(0, -1) : _a.ScriptBaseUrl;
396
396
  scriptUrl = scriptUrl.replace(_a._DefaultCdnUrl, baseUrl);
397
397
  }
398
398
  else if (_a._CdnVersion) {
399
399
  // If a CDN version is set (injected at build time), rewrite unversioned CDN URLs to versioned ones
400
- const versionedBase = _a._DefaultCdnUrl + "/v" + _a._CdnVersion;
401
- scriptUrl = scriptUrl.replace(_a._DefaultCdnUrl, versionedBase);
400
+ const versionedBase = `${_a._DefaultCdnUrl}/v${_a._CdnVersion}`;
401
+ // Guard against double-versioning if the URL already contains the version prefix
402
+ // (e.g. when GetBabylonScriptURL is called multiple times on the same URL)
403
+ if (!scriptUrl.startsWith(versionedBase)) {
404
+ scriptUrl = scriptUrl.replace(_a._DefaultCdnUrl, versionedBase);
405
+ }
402
406
  }
403
407
  }
404
408
  // run the preprocessor
@@ -1217,7 +1221,7 @@ Tools._DefaultCdnUrl = "https://cdn.babylonjs.com";
1217
1221
  * When set, unversioned CDN URLs will be rewritten to include this version prefix.
1218
1222
  * @internal
1219
1223
  */
1220
- Tools._CdnVersion = "";
1224
+ Tools._CdnVersion = "8.54.3";
1221
1225
  /**
1222
1226
  * @internal
1223
1227
  */