x_ite 5.0.0 → 5.0.2

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 (69) hide show
  1. package/dist/assets/components/annotation.js +2 -2
  2. package/dist/assets/components/annotation.min.js +1 -1
  3. package/dist/assets/components/cad-geometry.js +2 -2
  4. package/dist/assets/components/cad-geometry.min.js +1 -1
  5. package/dist/assets/components/cube-map-texturing.js +2 -2
  6. package/dist/assets/components/cube-map-texturing.min.js +1 -1
  7. package/dist/assets/components/dis.js +2 -2
  8. package/dist/assets/components/dis.min.js +1 -1
  9. package/dist/assets/components/event-utilities.js +2 -2
  10. package/dist/assets/components/event-utilities.min.js +1 -1
  11. package/dist/assets/components/geometry2d.js +2 -2
  12. package/dist/assets/components/geometry2d.min.js +1 -1
  13. package/dist/assets/components/geospatial.js +2 -2
  14. package/dist/assets/components/geospatial.min.js +1 -1
  15. package/dist/assets/components/h-anim.js +2 -2
  16. package/dist/assets/components/h-anim.min.js +1 -1
  17. package/dist/assets/components/key-device-sensor.js +2 -2
  18. package/dist/assets/components/key-device-sensor.min.js +1 -1
  19. package/dist/assets/components/layout.js +2 -2
  20. package/dist/assets/components/layout.min.js +1 -1
  21. package/dist/assets/components/nurbs.js +2 -2
  22. package/dist/assets/components/nurbs.min.js +1 -1
  23. package/dist/assets/components/particle-systems.js +2 -2
  24. package/dist/assets/components/particle-systems.min.js +1 -1
  25. package/dist/assets/components/picking.js +2 -2
  26. package/dist/assets/components/picking.min.js +1 -1
  27. package/dist/assets/components/projective-texture-mapping.js +2 -2
  28. package/dist/assets/components/projective-texture-mapping.min.js +1 -1
  29. package/dist/assets/components/rigid-body-physics.js +2 -2
  30. package/dist/assets/components/rigid-body-physics.min.js +1 -1
  31. package/dist/assets/components/scripting.js +2 -2
  32. package/dist/assets/components/scripting.min.js +1 -1
  33. package/dist/assets/components/texturing-3d.js +2 -2
  34. package/dist/assets/components/texturing-3d.min.js +1 -1
  35. package/dist/assets/components/volume-rendering.js +2 -2
  36. package/dist/assets/components/volume-rendering.min.js +1 -1
  37. package/dist/assets/components/x_ite.js +2 -2
  38. package/dist/assets/components/x_ite.min.js +1 -1
  39. package/dist/assets/shaders/webgl1/Phong.fs +3 -3
  40. package/dist/assets/shaders/webgl2/Phong.fs +3 -3
  41. package/dist/example.html +2 -2
  42. package/dist/x_ite.css +2 -2
  43. package/dist/x_ite.js +14 -45
  44. package/dist/x_ite.min.js +4 -4
  45. package/dist/x_ite.zip +0 -0
  46. package/docs/_config.yml +1 -1
  47. package/docs/index.md +2 -2
  48. package/package.json +3 -3
  49. package/src/assets/shaders/webgl1/Phong.fs +3 -3
  50. package/src/assets/shaders/webgl2/Phong.fs +3 -3
  51. package/src/x_ite/Base/X3DBaseNode.js +8 -2
  52. package/src/x_ite/Browser/NURBS/NURBS.js +51 -51
  53. package/src/x_ite/Browser/VERSION.js +1 -1
  54. package/src/x_ite/Components/Grouping/X3DGroupingNode.js +17 -16
  55. package/src/x_ite/Components/NURBS/Contour2D.js +53 -14
  56. package/src/x_ite/Components/NURBS/ContourPolyline2D.js +15 -12
  57. package/src/x_ite/Components/NURBS/NurbsCurve2D.js +9 -9
  58. package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +9 -9
  59. package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +6 -6
  60. package/src/x_ite/Components/NURBS/NurbsSet.js +31 -27
  61. package/src/x_ite/Components/NURBS/NurbsSurfaceInterpolator.js +10 -10
  62. package/src/x_ite/Components/NURBS/NurbsSweptSurface.js +5 -5
  63. package/src/x_ite/Components/NURBS/NurbsSwungSurface.js +4 -4
  64. package/src/x_ite/Components/NURBS/NurbsTextureCoordinate.js +6 -6
  65. package/src/x_ite/Components/NURBS/NurbsTrimmedSurface.js +46 -7
  66. package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +30 -32
  67. package/src/x_ite/Components/Shape/Material.js +0 -20
  68. package/src/x_ite/Components/Shape/PhysicalMaterial.js +0 -12
  69. package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +0 -8
@@ -196,7 +196,7 @@ function (X3DParametricGeometryNode,
196
196
 
197
197
  // ControlPoints
198
198
 
199
- var
199
+ const
200
200
  uClosed = this .getUClosed (this ._uOrder .getValue (), this ._uDimension .getValue (), this ._vDimension .getValue (), this ._uKnot, this ._weight, this .controlPointNode),
201
201
  vClosed = this .getVClosed (this ._vOrder .getValue (), this ._uDimension .getValue (), this ._vDimension .getValue (), this ._vKnot, this ._weight, this .controlPointNode),
202
202
  weights = this .getUVWeights (this .weights, this ._uDimension .getValue (), this ._vDimension .getValue (), this ._weight),
@@ -204,7 +204,7 @@ function (X3DParametricGeometryNode,
204
204
 
205
205
  // Knots
206
206
 
207
- var
207
+ const
208
208
  uKnots = this .getKnots (this .uKnots, uClosed, this ._uOrder .getValue (), this ._uDimension .getValue (), this ._uKnot),
209
209
  vKnots = this .getKnots (this .vKnots, vClosed, this ._vOrder .getValue (), this ._vDimension .getValue (), this ._vKnot),
210
210
  uScale = uKnots .at (-1) - uKnots [0],
@@ -212,11 +212,11 @@ function (X3DParametricGeometryNode,
212
212
 
213
213
  // Initialize NURBS tessellator
214
214
 
215
- var
215
+ const
216
216
  uDegree = this ._uOrder .getValue () - 1,
217
217
  vDegree = this ._vOrder .getValue () - 1;
218
218
 
219
- var surface = this .surface = (this .surface || nurbs) ({
219
+ const surface = this .surface = (this .surface || nurbs) ({
220
220
  boundary: ["open", "open"],
221
221
  degree: [uDegree, vDegree],
222
222
  knots: [uKnots, vKnots],
@@ -224,7 +224,7 @@ function (X3DParametricGeometryNode,
224
224
  debug: false,
225
225
  });
226
226
 
227
- var sampleOptions = this .sampleOptions;
227
+ const sampleOptions = this .sampleOptions;
228
228
 
229
229
  sampleOptions .resolution [0] = this .getUTessellation (uKnots .length);
230
230
  sampleOptions .resolution [1] = this .getVTessellation (vKnots .length);
@@ -234,15 +234,15 @@ function (X3DParametricGeometryNode,
234
234
  sampleOptions .haveWeights = Boolean (weights);
235
235
  sampleOptions .trimmingContours = this .getTrimmingContours ();
236
236
 
237
- var
237
+ const
238
238
  mesh = nurbs .sample (this .mesh, surface, sampleOptions),
239
239
  faces = mesh .faces,
240
240
  points = mesh .points,
241
241
  vertexArray = this .getVertices ();
242
242
 
243
- for (var i = 0, length = faces .length; i < length; ++ i)
243
+ for (let i = 0, length = faces .length; i < length; ++ i)
244
244
  {
245
- var index = faces [i] * 3;
245
+ const index = faces [i] * 3;
246
246
 
247
247
  vertexArray .push (points [index], points [index + 1], points [index + 2], 1);
248
248
  }
@@ -254,7 +254,7 @@ function (X3DParametricGeometryNode,
254
254
  },
255
255
  buildNurbsTexCoords: (function ()
256
256
  {
257
- var
257
+ const
258
258
  defaultTexUKnots = [ ],
259
259
  defaultTexVKnots = [ ],
260
260
  defaultTexControlPoints = [[[0, 0, 0, 1], [0, 1, 0, 1]], [[1, 0, 0, 1], [1, 1, 0, 1]]];
@@ -268,7 +268,7 @@ function (X3DParametricGeometryNode,
268
268
 
269
269
  return function (uClosed, vClosed, uOrder, vOrder, uKnots, vKnots, uDimension, vDimension, domain)
270
270
  {
271
- var sampleOptions = this .sampleOptions;
271
+ const sampleOptions = this .sampleOptions;
272
272
 
273
273
  if (this .texCoordNode && this .texCoordNode .getSize () === uDimension * vDimension)
274
274
  {
@@ -302,7 +302,7 @@ function (X3DParametricGeometryNode,
302
302
  sampleOptions .domain = domain;
303
303
  }
304
304
 
305
- var texSurface = this .texSurface = (this .texSurface || nurbs) ({
305
+ const texSurface = this .texSurface = (this .texSurface || nurbs) ({
306
306
  boundary: ["open", "open"],
307
307
  degree: [texUDegree, texVDegree],
308
308
  knots: [texUKnots, texVKnots],
@@ -313,15 +313,15 @@ function (X3DParametricGeometryNode,
313
313
  sampleOptions .closed [1] = false;
314
314
  sampleOptions .haveWeights = false;
315
315
 
316
- var
316
+ const
317
317
  texMesh = nurbs .sample (this .texMesh, texSurface, sampleOptions),
318
318
  faces = texMesh .faces,
319
319
  points = texMesh .points,
320
320
  texCoordArray = this .getTexCoords ();
321
321
 
322
- for (var i = 0, length = faces .length; i < length; ++ i)
322
+ for (let i = 0, length = faces .length; i < length; ++ i)
323
323
  {
324
- var index = faces [i] * 4;
324
+ const index = faces [i] * 4;
325
325
 
326
326
  texCoordArray .push (points [index], points [index + 1], points [index + 2], points [index + 3]);
327
327
  }
@@ -331,28 +331,24 @@ function (X3DParametricGeometryNode,
331
331
  })(),
332
332
  buildNormals: function (faces, points)
333
333
  {
334
- var
334
+ const
335
335
  normals = this .createNormals (faces, points),
336
336
  normalArray = this .getNormals ();
337
337
 
338
- for (var i = 0, length = normals .length; i < length; ++ i)
339
- {
340
- var normal = normals [i];
341
-
338
+ for (const normal of normals)
342
339
  normalArray .push (normal .x, normal .y, normal .z);
343
- }
344
340
  },
345
341
  createNormals: function (faces, points)
346
342
  {
347
- var normals = this .createFaceNormals (faces, points);
343
+ const
344
+ normals = this .createFaceNormals (faces, points),
345
+ normalIndex = [ ];
348
346
 
349
- var normalIndex = [ ];
350
-
351
- for (var i = 0, length = faces .length; i < length; ++ i)
347
+ for (let i = 0, length = faces .length; i < length; ++ i)
352
348
  {
353
- var
354
- index = faces [i],
355
- pointIndex = normalIndex [index];
349
+ const index = faces [i];
350
+
351
+ let pointIndex = normalIndex [index];
356
352
 
357
353
  if (! pointIndex)
358
354
  pointIndex = normalIndex [index] = [ ];
@@ -364,18 +360,20 @@ function (X3DParametricGeometryNode,
364
360
  },
365
361
  createFaceNormals: (function ()
366
362
  {
367
- var
363
+ const
368
364
  v1 = new Vector3 (0, 0, 0),
369
365
  v2 = new Vector3 (0, 0, 0),
370
366
  v3 = new Vector3 (0, 0, 0);
371
367
 
372
368
  return function (faces, points)
373
369
  {
374
- var normals = this .faceNormals || [ ];
370
+ const
371
+ normals = this .faceNormals || [ ],
372
+ length = faces .length;
375
373
 
376
- for (var i = 0, length = faces .length; i < length; i += 3)
374
+ for (let i = 0; i < length; i += 3)
377
375
  {
378
- var
376
+ const
379
377
  index1 = faces [i] * 3,
380
378
  index2 = faces [i + 1] * 3,
381
379
  index3 = faces [i + 2] * 3;
@@ -384,7 +382,7 @@ function (X3DParametricGeometryNode,
384
382
  v2 .set (points [index2], points [index2 + 1], points [index2 + 2]);
385
383
  v3 .set (points [index3], points [index3 + 1], points [index3 + 2]);
386
384
 
387
- var normal = Triangle3 .normal (v1, v2 ,v3, normals [i] || new Vector3 (0, 0, 0));
385
+ const normal = Triangle3 .normal (v1, v2 ,v3, normals [i] || new Vector3 (0, 0, 0));
388
386
 
389
387
  normals [i] = normal;
390
388
  normals [i + 1] = normal;
@@ -339,10 +339,6 @@ function (Fields,
339
339
  gl .uniform1i (ambientTexture .textureTransformMapping, textureTransformMapping .get (this ._ambientTextureMapping .getValue ()) || 0);
340
340
  gl .uniform1i (ambientTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._ambientTextureMapping .getValue ()) || 0);
341
341
  }
342
- else
343
- {
344
- gl .uniform1i (ambientTexture .textureType, 0);
345
- }
346
342
 
347
343
  // Diffuse parameters
348
344
 
@@ -353,10 +349,6 @@ function (Fields,
353
349
  gl .uniform1i (diffuseTexture .textureTransformMapping, textureTransformMapping .get (this ._diffuseTextureMapping .getValue ()) || 0);
354
350
  gl .uniform1i (diffuseTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._diffuseTextureMapping .getValue ()) || 0);
355
351
  }
356
- else
357
- {
358
- gl .uniform1i (diffuseTexture .textureType, 0);
359
- }
360
352
 
361
353
  // Specular parameters
362
354
 
@@ -367,10 +359,6 @@ function (Fields,
367
359
  gl .uniform1i (specularTexture .textureTransformMapping, textureTransformMapping .get (this ._specularTextureMapping .getValue ()) || 0);
368
360
  gl .uniform1i (specularTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._specularTextureMapping .getValue ()) || 0);
369
361
  }
370
- else
371
- {
372
- gl .uniform1i (specularTexture .textureType, 0);
373
- }
374
362
 
375
363
  // Shininess parameters
376
364
 
@@ -381,10 +369,6 @@ function (Fields,
381
369
  gl .uniform1i (shininessTexture .textureTransformMapping, textureTransformMapping .get (this ._shininessTextureMapping .getValue ()) || 0);
382
370
  gl .uniform1i (shininessTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._shininessTextureMapping .getValue ()) || 0);
383
371
  }
384
- else
385
- {
386
- gl .uniform1i (shininessTexture .textureType, 0);
387
- }
388
372
 
389
373
  // Occlusion parameters
390
374
 
@@ -397,10 +381,6 @@ function (Fields,
397
381
  gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (this ._occlusionTextureMapping .getValue ()) || 0);
398
382
  gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._occlusionTextureMapping .getValue ()) || 0);
399
383
  }
400
- else
401
- {
402
- gl .uniform1i (occlusionTexture .textureType, 0);
403
- }
404
384
  }
405
385
  },
406
386
  });
@@ -268,10 +268,6 @@ function (Fields,
268
268
  gl .uniform1i (baseTexture .textureTransformMapping, textureTransformMapping .get (this ._baseTextureMapping .getValue ()) || 0);
269
269
  gl .uniform1i (baseTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._baseTextureMapping .getValue ()) || 0);
270
270
  }
271
- else
272
- {
273
- gl .uniform1i (baseTexture .textureType, 0);
274
- }
275
271
 
276
272
  // Metallic roughness parameters
277
273
 
@@ -282,10 +278,6 @@ function (Fields,
282
278
  gl .uniform1i (metallicRoughnessTexture .textureTransformMapping, textureTransformMapping .get (this ._metallicRoughnessTextureMapping .getValue ()) || 0);
283
279
  gl .uniform1i (metallicRoughnessTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._metallicRoughnessTextureMapping .getValue ()) || 0);
284
280
  }
285
- else
286
- {
287
- gl .uniform1i (metallicRoughnessTexture .textureType, 0);
288
- }
289
281
 
290
282
  // Occlusion parameters
291
283
 
@@ -298,10 +290,6 @@ function (Fields,
298
290
  gl .uniform1i (occlusionTexture .textureTransformMapping, textureTransformMapping .get (this ._occlusionTextureMapping .getValue ()) || 0);
299
291
  gl .uniform1i (occlusionTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._occlusionTextureMapping .getValue ()) || 0);
300
292
  }
301
- else
302
- {
303
- gl .uniform1i (occlusionTexture .textureType, 0);
304
- }
305
293
  }
306
294
  },
307
295
  });
@@ -187,10 +187,6 @@ function (Fields,
187
187
  gl .uniform1i (emissiveTexture .textureTransformMapping, textureTransformMapping .get (this ._emissiveTextureMapping .getValue ()) || 0);
188
188
  gl .uniform1i (emissiveTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._emissiveTextureMapping .getValue ()) || 0);
189
189
  }
190
- else
191
- {
192
- gl .uniform1i (emissiveTexture .textureType, 0);
193
- }
194
190
 
195
191
  // Normal parameters
196
192
 
@@ -203,10 +199,6 @@ function (Fields,
203
199
  gl .uniform1i (normalTexture .textureTransformMapping, textureTransformMapping .get (this ._normalTextureMapping .getValue ()) || 0);
204
200
  gl .uniform1i (normalTexture .textureCoordinateMapping, textureCoordinateMapping .get (this ._normalTextureMapping .getValue ()) || 0);
205
201
  }
206
- else
207
- {
208
- gl .uniform1i (normalTexture .textureType, 0);
209
- }
210
202
  }
211
203
  },
212
204
  });