x_ite 8.9.5 → 8.9.6
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/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +19 -19
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +17 -17
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +37 -37
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +30 -30
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +18 -18
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +68 -67
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/package.json +1 -1
- package/src/x_ite/Base/X3DChildObject.js +5 -3
- package/src/x_ite/Browser/Navigation/X3DViewer.js +2 -2
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +2 -2
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v8.9.
|
|
1
|
+
/* X_ITE v8.9.6 */(() => { // webpackBootstrap
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ // The require scope
|
|
4
4
|
/******/ var __webpack_require__ = {};
|
|
@@ -39,28 +39,28 @@ var __webpack_exports__ = {};
|
|
|
39
39
|
// UNUSED EXPORTS: default
|
|
40
40
|
|
|
41
41
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components\")"
|
|
42
|
-
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
42
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components");
|
|
43
43
|
var Components_default = /*#__PURE__*/__webpack_require__.n(Components_namespaceObject);
|
|
44
44
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Fields\")"
|
|
45
|
-
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
45
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Fields");
|
|
46
46
|
var Fields_default = /*#__PURE__*/__webpack_require__.n(Fields_namespaceObject);
|
|
47
47
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DFieldDefinition\")"
|
|
48
|
-
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
48
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Base/X3DFieldDefinition");
|
|
49
49
|
var X3DFieldDefinition_default = /*#__PURE__*/__webpack_require__.n(X3DFieldDefinition_namespaceObject);
|
|
50
50
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/FieldDefinitionArray\")"
|
|
51
|
-
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
51
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Base/FieldDefinitionArray");
|
|
52
52
|
var FieldDefinitionArray_default = /*#__PURE__*/__webpack_require__.n(FieldDefinitionArray_namespaceObject);
|
|
53
53
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DNode\")"
|
|
54
|
-
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
54
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Core/X3DNode");
|
|
55
55
|
var X3DNode_default = /*#__PURE__*/__webpack_require__.n(X3DNode_namespaceObject);
|
|
56
56
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DConstants\")"
|
|
57
|
-
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
57
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Base/X3DConstants");
|
|
58
58
|
var X3DConstants_default = /*#__PURE__*/__webpack_require__.n(X3DConstants_namespaceObject);
|
|
59
59
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Base/X3DCast\")"
|
|
60
|
-
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
60
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Base/X3DCast");
|
|
61
61
|
var X3DCast_default = /*#__PURE__*/__webpack_require__.n(X3DCast_namespaceObject);
|
|
62
62
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Namespace\")"
|
|
63
|
-
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
63
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Namespace");
|
|
64
64
|
var Namespace_default = /*#__PURE__*/__webpack_require__.n(Namespace_namespaceObject);
|
|
65
65
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/Contour2D.js
|
|
66
66
|
/*******************************************************************************
|
|
@@ -317,7 +317,7 @@ const X3DNurbsControlCurveNode_default_ = X3DNurbsControlCurveNode;
|
|
|
317
317
|
Namespace_default().set ("x_ite/Components/NURBS/X3DNurbsControlCurveNode", X3DNurbsControlCurveNode_default_);
|
|
318
318
|
/* harmony default export */ const NURBS_X3DNurbsControlCurveNode = (X3DNurbsControlCurveNode_default_);
|
|
319
319
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
320
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
320
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Numbers/Vector3");
|
|
321
321
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
322
322
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/ContourPolyline2D.js
|
|
323
323
|
/*******************************************************************************
|
|
@@ -490,7 +490,7 @@ const ContourPolyline2D_default_ = ContourPolyline2D;
|
|
|
490
490
|
Namespace_default().set ("x_ite/Components/NURBS/ContourPolyline2D", ContourPolyline2D_default_);
|
|
491
491
|
/* harmony default export */ const NURBS_ContourPolyline2D = (ContourPolyline2D_default_);
|
|
492
492
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DCoordinateNode\")"
|
|
493
|
-
const X3DCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
493
|
+
const X3DCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Rendering/X3DCoordinateNode");
|
|
494
494
|
var X3DCoordinateNode_default = /*#__PURE__*/__webpack_require__.n(X3DCoordinateNode_namespaceObject);
|
|
495
495
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/CoordinateDouble.js
|
|
496
496
|
/*******************************************************************************
|
|
@@ -593,13 +593,13 @@ const CoordinateDouble_default_ = CoordinateDouble;
|
|
|
593
593
|
Namespace_default().set ("x_ite/Components/NURBS/CoordinateDouble", CoordinateDouble_default_);
|
|
594
594
|
/* harmony default export */ const NURBS_CoordinateDouble = (CoordinateDouble_default_);
|
|
595
595
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DGeometryNode\")"
|
|
596
|
-
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
596
|
+
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Rendering/X3DGeometryNode");
|
|
597
597
|
var X3DGeometryNode_default = /*#__PURE__*/__webpack_require__.n(X3DGeometryNode_namespaceObject);
|
|
598
598
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector2\")"
|
|
599
|
-
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
599
|
+
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Numbers/Vector2");
|
|
600
600
|
var Vector2_default = /*#__PURE__*/__webpack_require__.n(Vector2_namespaceObject);
|
|
601
601
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector4\")"
|
|
602
|
-
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
602
|
+
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Numbers/Vector4");
|
|
603
603
|
var Vector4_default = /*#__PURE__*/__webpack_require__.n(Vector4_namespaceObject);
|
|
604
604
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/NURBS/NURBS.js
|
|
605
605
|
/*******************************************************************************
|
|
@@ -1164,7 +1164,7 @@ const X3DParametricGeometryNode_default_ = X3DParametricGeometryNode;
|
|
|
1164
1164
|
Namespace_default().set ("x_ite/Components/NURBS/X3DParametricGeometryNode", X3DParametricGeometryNode_default_);
|
|
1165
1165
|
/* harmony default export */ const NURBS_X3DParametricGeometryNode = (X3DParametricGeometryNode_default_);
|
|
1166
1166
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DLineGeometryNode\")"
|
|
1167
|
-
const X3DLineGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
1167
|
+
const X3DLineGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Rendering/X3DLineGeometryNode");
|
|
1168
1168
|
var X3DLineGeometryNode_default = /*#__PURE__*/__webpack_require__.n(X3DLineGeometryNode_namespaceObject);
|
|
1169
1169
|
;// CONCATENATED MODULE: ./src/lib/nurbs/src/utils/is-ndarray.js
|
|
1170
1170
|
|
|
@@ -2216,7 +2216,7 @@ const support_default_ = function (cacheKey, nurbs, accessors, debug, checkBound
|
|
|
2216
2216
|
Namespace_default().set ("lib/nurbs/src/support", support_default_);
|
|
2217
2217
|
/* harmony default export */ const support = (support_default_);
|
|
2218
2218
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Triangle3\")"
|
|
2219
|
-
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
2219
|
+
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Geometry/Triangle3");
|
|
2220
2220
|
var Triangle3_default = /*#__PURE__*/__webpack_require__.n(Triangle3_namespaceObject);
|
|
2221
2221
|
;// CONCATENATED MODULE: ./src/lib/nurbs/extras/sample.js
|
|
2222
2222
|
|
|
@@ -3243,13 +3243,13 @@ const NurbsCurve2D_default_ = NurbsCurve2D;
|
|
|
3243
3243
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsCurve2D", NurbsCurve2D_default_);
|
|
3244
3244
|
/* harmony default export */ const NURBS_NurbsCurve2D = (NurbsCurve2D_default_);
|
|
3245
3245
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DChildNode\")"
|
|
3246
|
-
const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
3246
|
+
const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Core/X3DChildNode");
|
|
3247
3247
|
var X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DChildNode_namespaceObject);
|
|
3248
3248
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/OrientationInterpolator\")"
|
|
3249
|
-
const OrientationInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
3249
|
+
const OrientationInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Interpolation/OrientationInterpolator");
|
|
3250
3250
|
var OrientationInterpolator_default = /*#__PURE__*/__webpack_require__.n(OrientationInterpolator_namespaceObject);
|
|
3251
3251
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Rotation4\")"
|
|
3252
|
-
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
3252
|
+
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Numbers/Rotation4");
|
|
3253
3253
|
var Rotation4_default = /*#__PURE__*/__webpack_require__.n(Rotation4_namespaceObject);
|
|
3254
3254
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js
|
|
3255
3255
|
/*******************************************************************************
|
|
@@ -3486,7 +3486,7 @@ const NurbsOrientationInterpolator_default_ = NurbsOrientationInterpolator;
|
|
|
3486
3486
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsOrientationInterpolator", NurbsOrientationInterpolator_default_);
|
|
3487
3487
|
/* harmony default export */ const NURBS_NurbsOrientationInterpolator = (NurbsOrientationInterpolator_default_);
|
|
3488
3488
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
3489
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
3489
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Algorithm");
|
|
3490
3490
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
3491
3491
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js
|
|
3492
3492
|
/*******************************************************************************
|
|
@@ -4000,7 +4000,7 @@ const NurbsPatchSurface_default_ = NurbsPatchSurface;
|
|
|
4000
4000
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsPatchSurface", NurbsPatchSurface_default_);
|
|
4001
4001
|
/* harmony default export */ const NURBS_NurbsPatchSurface = (NurbsPatchSurface_default_);
|
|
4002
4002
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/PositionInterpolator\")"
|
|
4003
|
-
const PositionInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
4003
|
+
const PositionInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Interpolation/PositionInterpolator");
|
|
4004
4004
|
var PositionInterpolator_default = /*#__PURE__*/__webpack_require__.n(PositionInterpolator_namespaceObject);
|
|
4005
4005
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsPositionInterpolator.js
|
|
4006
4006
|
/*******************************************************************************
|
|
@@ -4225,7 +4225,7 @@ const NurbsPositionInterpolator_default_ = NurbsPositionInterpolator;
|
|
|
4225
4225
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsPositionInterpolator", NurbsPositionInterpolator_default_);
|
|
4226
4226
|
/* harmony default export */ const NURBS_NurbsPositionInterpolator = (NurbsPositionInterpolator_default_);
|
|
4227
4227
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DBoundedObject\")"
|
|
4228
|
-
const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
4228
|
+
const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
|
|
4229
4229
|
var X3DBoundedObject_default = /*#__PURE__*/__webpack_require__.n(X3DBoundedObject_namespaceObject);
|
|
4230
4230
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsSet.js
|
|
4231
4231
|
/*******************************************************************************
|
|
@@ -4419,7 +4419,7 @@ const NurbsSet_default_ = NurbsSet;
|
|
|
4419
4419
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsSet", NurbsSet_default_);
|
|
4420
4420
|
/* harmony default export */ const NURBS_NurbsSet = (NurbsSet_default_);
|
|
4421
4421
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Line3\")"
|
|
4422
|
-
const Line3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
4422
|
+
const Line3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("standard/Math/Geometry/Line3");
|
|
4423
4423
|
var Line3_default = /*#__PURE__*/__webpack_require__.n(Line3_namespaceObject);
|
|
4424
4424
|
;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle2.js
|
|
4425
4425
|
/*******************************************************************************
|
|
@@ -4699,7 +4699,7 @@ const NurbsSurfaceInterpolator_default_ = NurbsSurfaceInterpolator;
|
|
|
4699
4699
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsSurfaceInterpolator", NurbsSurfaceInterpolator_default_);
|
|
4700
4700
|
/* harmony default export */ const NURBS_NurbsSurfaceInterpolator = (NurbsSurfaceInterpolator_default_);
|
|
4701
4701
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Geometry3D/Extrusion\")"
|
|
4702
|
-
const Extrusion_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.
|
|
4702
|
+
const Extrusion_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.9.6")] .require ("x_ite/Components/Geometry3D/Extrusion");
|
|
4703
4703
|
var Extrusion_default = /*#__PURE__*/__webpack_require__.n(Extrusion_namespaceObject);
|
|
4704
4704
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsSweptSurface.js
|
|
4705
4705
|
/*******************************************************************************
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* X_ITE v8.9.5 */(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components");var i=e.n(t);const n=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Fields");var o=e.n(n);const s=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Base/X3DFieldDefinition");var r=e.n(s);const l=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Base/FieldDefinitionArray");var a=e.n(l);const u=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Core/X3DNode");var h=e.n(u);const d=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Base/X3DConstants");var c=e.n(d);const p=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Base/X3DCast");var g=e.n(p);const m=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Namespace");var f=e.n(m);function _(e){h().call(this,e),this.addType(c().Contour2D),this.childNodes=[]}function b(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(_.prototype,h().prototype),{initialize(){h().prototype.initialize.call(this),this._addChildren.addInterest("set_addChildren__",this),this._removeChildren.addInterest("set_removeChildren__",this),this._children.addInterest("set_children__",this),this.set_children__()},set_addChildren__(){this._addChildren.setTainted(!0),this._addChildren.assign(b(this._addChildren,this._children));for(const e of this._addChildren)this._children.push(e);this._addChildren.length=0,this._addChildren.setTainted(!1)},set_removeChildren__(){this._removeChildren.setTainted(!0),this._children.assign(b(this._children,this._removeChildren)),this._removeChildren.length=0,this._removeChildren.setTainted(!1)},set_children__(){const e=this.childNodes;e.length=0;for(const t of this._children){const i=g()(c().NurbsCurve2D,t);if(i)e.push(i);else{const i=g()(c().ContourPolyline2D,t);if(i){e.push(i);continue}}}},addTrimmingContour(e){for(const t of this.childNodes)e.push(t.tessellate(2))}}),Object.defineProperties(_,{typeName:{value:"Contour2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"trimmingContour",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"addChildren",new(o().MFNode)),new(r())(c().inputOnly,"removeChildren",new(o().MFNode)),new(r())(c().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const w=_;f().set("x_ite/Components/NURBS/Contour2D",w);const v=w;function y(e){h().call(this,e),this.addType(c().X3DNurbsControlCurveNode)}Object.setPrototypeOf(y.prototype,h().prototype),Object.defineProperties(y,{typeName:{value:"X3DNurbsControlCurveNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const N=y;f().set("x_ite/Components/NURBS/X3DNurbsControlCurveNode",N);const C=N,O=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Numbers/Vector3");var S=e.n(O);function P(e){C.call(this,e),this.addType(c().ContourPolyline2D),this.controlPoints=[]}Object.assign(Object.setPrototypeOf(P.prototype,C.prototype),{tessellate(e){switch(e){case 0:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n;t[i+0]=e[i+0],t[i+1]=e[i+1]}return t.length=2*i,t}case 1:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n,o=3*n;t[o+0]=e[i+0],t[o+1]=0,t[o+2]=e[i+1]}return t.length=3*i,t}case 3:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n;t[n]=new(S())(e[i+0],e[i+1],0)}return t.length=i,t}}}}),Object.defineProperties(P,{typeName:{value:"ContourPolyline2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),enumerable:!0}});const D=P;f().set("x_ite/Components/NURBS/ContourPolyline2D",D);const F=D,R=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Rendering/X3DCoordinateNode");var V=e.n(R);function I(e){V().call(this,e),this.addType(c().CoordinateDouble)}Object.setPrototypeOf(I.prototype,V().prototype),Object.defineProperties(I,{typeName:{value:"CoordinateDouble",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"coord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"point",new(o().MFVec3d))]),enumerable:!0}});const T=I;f().set("x_ite/Components/NURBS/CoordinateDouble",T);const x=T,j=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Rendering/X3DGeometryNode");var z=e.n(j);const k=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Numbers/Vector2");var A=e.n(k);const B=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Numbers/Vector4");var X=e.n(B);const E={getTessellation:(e,t)=>e>0?e+1:e<0?-e*t+1:2*t+1,getClosed2D(e,t,i,n){const o=n.length;return(!(i.length===o)||i[0]===i[o-1])&&(!!n[0].equals(n[o-1])&&!!this.isPeriodic(e,o,t))},getClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s){const r=s.getSize();return(!(o.length===r)||o[0]===o[r-1])&&(!!s.get1Point(0,e).equals(s.get1Point(r-1,t))&&!!this.isPeriodic(i,r,n))}})(),getUClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s,r,l){const a=r.length===l.getSize();for(let i=0,s=o;i<s;++i){const o=i*n,s=i*n+n-1;if(a&&r[o]!==r[s])return!1;if(!l.get1Point(o,e).equals(l.get1Point(s,t)))return!1}return!!this.isPeriodic(i,n,s)}})(),getVClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s,r,l){const a=r.length===l.getSize();for(let i=0,s=n;i<s;++i){const s=i,u=(o-1)*n+i;if(a&&r[s]!==r[u])return!1;if(!l.get1Point(s,e).equals(l.get1Point(u,t)))return!1}return!!this.isPeriodic(i,o,s)}})(),isPeriodic(e,t,i){if(i.length===t+e){{let t=1;for(let n=1,o=e;n<o;++n)t+=i[n]===i[0];if(t===e)return!1}{let t=1;for(let n=i.length-e,o=i.length-1;n<o;++n)t+=i[n]===i[o];if(t===e)return!1}}return!0},getKnots(e,t,i,n,o){const s=e||[];for(let e=0,t=o.length;e<t;++e)s[e]=o[e];s.length=o.length;let r=!0;if(s.length===n+i){r=!1;let e=0;for(let t=1,n=s.length;t<n;++t)s[t]==s[t-1]?++e:e=0,e>i-1&&(r=!0),s[t-1]>s[t]&&(r=!0)}if(r)for(let e=0,t=n+i;e<t;++e)s[e]=e/(t-1);if(t)for(let e=1,t=i-1;e<t;++e)s.push(s.at(-1)+(s[e]-s[e-1]));return s},getWeights(e,t,i){if(i.length!==t)return;const n=e||[];for(let e=0;e<t;++e)n[e]=i[e];return n.length=t,n},getUVWeights(e,t,i,n){const o=t*i;if(n.length!==o)return;const s=e||[];for(let e=0,o=0;e<t;++e)for(let e=0;e<i;++e,++o)s[o]=n[o];return s.length=o,s},getControlPoints2D(e,t,i,n,o){const s=e||[],r=o.getValue(),l=o.length,a=!!n,u=a?S():A();s.haveWeights!==a&&(s.haveWeights=a,s.length=0);for(let e=0;e<l;++e){const t=2*e,i=s[e]||new u(0,0,0);s[e]=i.set(r[t+0],r[t+1],a?n[e]:0)}if(s.length=l,t)for(let e=1,t=i-1;e<t;++e)s.push(s[e]);return s},getControlPoints(e,t,i,n,o){const s=e||[],r=o.getSize(),l=!!n,a=l?X():S();s.haveWeights!==l&&(s.haveWeights=l,s.length=0);for(let e=0;e<r;++e){const t=s[e]=o.get1Point(e,s[e]||new a(0,0,0,0));l&&(t.w=n[e])}if(s.length=r,t)for(let e=1,t=i-1;e<t;++e)s.push(s[e]);return s},getUVControlPoints(e,t,i,n,o,s,r,l,a){const u=e||[],h=!!l,d=h?X():S();u.haveWeights!==h&&(u.haveWeights=h,u.length=0);for(let e=0;e<s;++e){let t=u[e];t||(t=u[e]=[]);for(let i=0;i<r;++i){const n=i*s+e;t[i]=a.get1Point(n,t[i]||new d(0,0,0,0)),h&&(t[i].w=l[n])}if(t.length=r,i)for(let e=1,i=o-1;e<i;++e)t.push(t[e])}if(u.length=s,t)for(let e=1,t=n-1;e<t;++e)u.push(u[e]);return u},getTexControlPoints(e,t,i,n,o,s,r,l){const a=e||[];for(let e=0;e<s;++e){let t=a[e];t||(t=a[e]=[]);for(let i=0;i<r;++i){const n=i*s+e;t[i]=l.get1Point(n,t[i]||new(X())(0,0,0,0))}if(t.length=r,i)for(let e=1,i=o-1;e<i;++e)t.push(t[e])}if(a.length=s,t)for(let e=1,t=n-1;e<t;++e)a.push(a[e]);return a}};f().set("x_ite/Browser/NURBS/NURBS",E);const U=E;function q(e){z().call(this,e),this.addType(c().X3DParametricGeometryNode)}Object.assign(Object.setPrototypeOf(q.prototype,z().prototype),{getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o)}),Object.defineProperties(q,{typeName:{value:"X3DParametricGeometryNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const M=q;f().set("x_ite/Components/NURBS/X3DParametricGeometryNode",M);const K=M,G=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Rendering/X3DLineGeometryNode");var W=e.n(G);const Y=function(e){return!!e&&(!!e.dtype&&new RegExp("function View[0-9]+d(:?"+e.dtype+")+").test(String(e.constructor)))};f().set("lib/nurbs/src/utils/is-ndarray",Y);const J=Y,L=function(e){return!!e&&(void 0!==e.data&&Array.isArray(e.shape)&&void 0!==e.offset&&void 0!==e.stride)};f().set("lib/nurbs/src/utils/is-ndarray-like",L);const Z=L,H=function(e){return Array.isArray(e)||ArrayBuffer.isView(e)||void 0!==e.length};f().set("lib/nurbs/src/utils/is-array-like",H);const Q=H;function $(e){if(e){if(J(e)||Z(e))return"generic"===e.dtype?$.GENERIC_NDARRAY:$.NDARRAY;if(Q(e)){for(var t=e;Q(t[0]);t=t[0]);return"x"in t?$.ARRAY_OF_OBJECTS:$.ARRAY_OF_ARRAYS}throw new Error("Unhandled data type. Got type: "+typeof e)}}$.ARRAY_OF_OBJECTS="Obj",$.ARRAY_OF_ARRAYS="Arr",$.NDARRAY="Nd",$.GENERIC_NDARRAY="GenNd",$.PACKED="PackArr";const ee=$;f().set("lib/nurbs/src/utils/infer-type",ee);const te=ee;const ie=function(e,t,i,n,o,s){var r,l,a=[],u=!1;for(r=0;r<e.splineDimension;r++){var h=Q(e.knots)&&Q(e.knots[r]);h&&(u=!0),a.push("Deg"+e.degree[r]+(h?"":"Uniform")+((l=e.boundary[r])[0].toUpperCase()+l.slice(1)))}var d=[[u?"NU":"",e.weights?"RBS":"BS"].join("")+e.dimension+"D",a.join("_")];return n&&d.push(n+"Pts"),o&&d.push(o+"Wts"),s&&d.push(s+"Kts"),t&&d.push("debug"),i&&d.push("chk"),d.join("_")};f().set("lib/nurbs/src/utils/cache-key",ie);const ne=ie;var oe=function e(t,i){return function(i,n){void 0===i||Array.isArray(i)||(i=[i]);for(var o=[],s=0;s<i.length;s++)o.push(e.sum(i[s]));if(n)for(i=0;i<o.length;i++)void 0!==n[i]&&(o[i]="("+o[i]+" + "+n[i]+") % "+n[i]);return t+o.join("_")}};oe.sum=function(e){return 0===(e=(e=Array.isArray(e)?e:[e]).filter((e=>void 0!==e&&0!==e))).length&&e.push(0),e.join(" + ")};const se=oe;f().set("lib/nurbs/src/utils/variable",se);const re=se;var le=[".x",".y",".z",".w"];function ae(e){return function(t,i){void 0===t||Array.isArray(t)||(t=[t]);for(var n=[],o=0;o<t.length;o++)n.push(re.sum(t[o]));if(i)for(t=0;t<n.length;t++)void 0!==i[t]&&(n[t]="("+n[t]+" + "+i[t]+") % "+i[t]);return e(n)}}function ue(e,t){if(t)switch(te(t)){case te.ARRAY_OF_OBJECTS:return ae((t=>{var i=t.pop();return e+"["+t.join("][")+"]"+le[i]}));case te.ARRAY_OF_ARRAYS:return ae((t=>e+"["+t.join("][")+"]"));case te.GENERIC_NDARRAY:return ae((t=>e+".get("+t.join(",")+")"));case te.NDARRAY:return ae((t=>{for(var i=[e+"Offset"],n=0;n<t.length;n++)i.push(e+"Stride"+n+" * ("+t[n]+")");return e+"["+i.join(" + ")+"]"}));case te.PACKED:default:return}}const he=function(e){var t,i={};return(t=ue("x",e.points))&&(i.point=t),(t=ue("w",e.weights))&&(i.weight=t),(t=ue("k",e.knots))&&(i.knot=t),i};f().set("lib/nurbs/src/utils/create-accessors",he);const de=he;var ce=[],pe=[];const ge=function(e,t,i){if(1!==t)throw new Error("Numerical derivative not implemented for order n = "+t+".");var n,o=void 0===arguments[this.splineDimension+3]?1e-4:arguments[this.splineDimension+3];for(ce.length=this.splineDimension,n=0;n<this.splineDimension;n++)ce[n+1]=arguments[n+3];var s,r,l,a=this.domain,u=a[i][0],h=a[i][1],d=ce[i+1],c=(h-u)*o;for("closed"===this.boundary[i]?(s=u+(d-u-c+(l=h-u))%l,r=u+(d-u+c+l)%l,c*=2):(s=Math.min(h,Math.max(u,d-c)),c=(r=Math.min(h,Math.max(u,d+c)))-s),ce[i+1]=s,ce[0]=pe,this.evaluate.apply(null,ce),ce[i+1]=r,ce[0]=e,this.evaluate.apply(null,ce),n=0;n<this.dimension;n++)e[n]=(e[n]-pe[n])/c;return e};f().set("lib/nurbs/src/numerical-derivative",ge);const me=ge,fe=function(e,t){for(var i=1,n=0,o=[];n<e.length;n++)i*=Array.isArray(e[n])?e[n][1]-e[n][0]:e[n],o[n]=Array.isArray(e[n])?e[n][0]:0;for(var s=0;s<i;s++)for(t(o.slice()),n=e.length-1;n>=0;n--){if(o[n]!==(Array.isArray(e[n])?e[n][1]:e[n])-1){o[n]++;break}o[n]=Array.isArray(e[n])?e[n][0]:0}};f().set("lib/nurbs/src/utils/ndloop",fe);const _e=fe,be=function(e,t,i,n){var o=[];switch(te(n)){case te.NDARRAY:o.push(" var "+t+" = "+i+".data;"),o.push(" var "+t+"Offset = "+i+".offset;");for(var s=0;s<n.dimension;s++)o.push(" var "+t+"Stride"+s+" = "+i+".stride["+s+"];");break;case te.ARRAY_OF_OBJECTS:case te.ARRAY_OF_ARRAYS:o.push(" var "+t+" = "+i+";")}return o.join("\n")};f().set("lib/nurbs/src/utils/accessor-preamble",be);const we=be,ve=function(e,t,i){if(e){if(Z(e))return t+".shape["+i+"]";for(var n=t,o=0;o<i;o++)n+="[0]";return n+".length"}return"this.size["+i+"]"};f().set("lib/nurbs/src/utils/size-getter",ve);const ye=ve;var Ne={},Ce={};const Oe=function(e,t,i,n,o,s,r){var l,a,u,h,d,c,p=t.splineDimension,g=t.points,m=t.degree,f=t.weights,_=void 0!==f,b=t.knots,w=t.dimension,v=t.boundary;if(null!=r){Array.isArray(r)||(r=[r]);var y=0;for(l=0;l<p;l++)void 0===r[l]&&(r[l]=0),y+=r[l];if(_&&y>1)throw new Error("Analytical derivative not implemented for rational b-splines with order n = "+y+".")}s&&(e="Basis"+e),r&&(e="Der"+r.join("_")+"_"+e);var N=Ne[e];if(n)var C="function"==typeof n?n:console.log;if(N)return n&&C(Ce[e]),N.bind(t);var O=[],S="evaluate"+e,P=i.point;s&&(P=function(e,t){for(var i=[],n=0;n<e.length;n++){for(var o=e[n],s=[],r=0;r<o.length;r++)0!==o[r]&&s.push(o[r]);o=s.join(" + "),t[n]&&(o="("+o+" + "+t[n]+") % "+t[n]),i.push(o+" === "+T(n))}return"(("+i.join(" && ")+") ? 1 : 0)"});var D=i.weight,F=i.knot,R=re("k"),V=re("x"),I=re("w"),T=re("i"),x=re("t"),j=n?"domain":"d",z=re(n?"size":"s"),k=re(n?"knotIndex":"j"),A=!0;for(d=0;d<p;d++)Q(b)&&Q(b[d])&&(A=!1);function B(e){O.push(" "+(e||""))}function X(e){n&&B(e)}if(s)var E=[];var U=[];for(l=0;l<p;l++)s&&E.push(T([l])),U.push(x([l]));for(O.push("function "+S+" ("+(s?"":"out, ")+U.join(", ")+(s?", "+E.join(", "):"")+") {"),B("var h, m, a, b;"),o&&(B("var "+j+" = this.domain;"),B("for (var i = 0; i < this.splineDimension; i++) {"),B(" a = arguments[i + 1];"),B(" if (a < "+j+"[i][0] || a > "+j+"[i][1] || a === undefined || isNaN(a)) {"),B(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+j+'[i][0]+", "+'+j+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),B(" }"),B("}")),d=0;d<p;d++)B("var "+z(d)+" = "+ye(g,"this.points",d)+";");function q(e,t,i){return"("+e+") ? ("+t+") : ("+i+")"}O.push(we(t,"x","this.points",g)),_&&O.push(we(t,"w","this.weights",f)),A||O.push(we(t,"k","this.knots",b));var M=[];for(d=0;d<p;d++)switch(te(b)){case te.NDARRAY:M[d]=!0;break;case te.ARRAY_OF_ARRAYS:M[d]=Q(b[d])}for(d=0;d<p;d++)if(M[d])for(X("\n // Bisect to locate the knot interval in dimension "+d+"\n"),B("var "+k(d)+" = 0;"),B("h = "+z(d)+";"),B("while(h > "+k(d)+" + 1) {"),B(" m = 0.5 * (h + "+k(d)+") | 0;"),B(" if ("+F([d,"m"])+" > "+x(d)+") h = m;"),B(" else "+k(d)+" = m;"),B("}"),X("\n // Fetch knots for dimension "+d+"\n"),l=1-m[d];l<=m[d];l++)"closed"===v[d]?B(l<0?"var "+R([d,l+m[d]-1])+" = "+q(k(d)+" < "+-l,F([d,0])+" + "+F([d,[z(d),k(d),l]])+" - "+F([d,[z(d)]]),F([d,[k(d),l]]))+";":l>0?"var "+R([d,l+m[d]-1])+" = "+q(k(d)+" + "+l+" > "+z(d),F([d,z(d)])+" + "+F([d,l+" + "+k(d)+" - "+z(d)])+" - "+F([d,0]),F([d,[k(d),l]]))+";":"var "+R([d,l+m[d]-1])+" = "+F([d,[k(d),l]])+";"):B("var "+R([d,l+m[d]-1])+" = "+F([d,[k(d),l]])+";");else{for(X("\n // Directly compute knot interval for dimension "+d+"\n"),"closed"===v[d]?B(k(d)+" = ("+x(d)+" | 0) % "+z(d)+";"):(B(k(d)+" = ("+x(d)+" | 0);"),B("if ("+k(d)+" < "+m[d]+") "+k(d)+" = "+m[d]+";"),B("if ("+k(d)+" > "+z(d)+" - 1) "+k(d)+" = "+z(d)+" - 1;")),X("\n // Compute and clamp knots for dimension "+d+"\n"),l=1-m[d];l<=m[d];l++)B("var "+(c=R([d,l+m[d]-1]))+" = "+k(d)+" + "+l+";");if("clamped"===v[d])for(l=1-m[d];l<=m[d];l++)c=R([d,l+m[d]-1]),l<0&&B("if ("+c+" < "+m[d]+") "+c+" = "+m[d]+";"),l>0&&B("if ("+c+" > "+z(d)+") "+c+" = "+z(d)+";");"closed"===v[d]&&(X("\n // Wrap the B-Spline parameter for closed boundary"),B(x(d)+" %= "+z(d)+";"))}for(d=0,u=[];d<p;d++)u[d]=m[d]+1;for(_&&(X("\n // Fetch weights\n"),_e(u,(function(e){for(var t=[],i=[],n=0;n<p;n++)t[n]=[k(n),e[n]-m[n]],"closed"===v[n]&&e[n]-m[n]<0&&(i[n]=z(n));B("var "+I(e)+" = "+D(t,i)+";")}))),n&&B(_?"\n // Fetch points and project into homogeneous (weighted) coordinates\n":"\n // Fetch points\n"),_e(u,(function(e){for(var t=[],i=[],n=0;n<p;n++)t[n]=[k(n),e[n]-m[n]],"closed"===v[n]&&e[n]-m[n]<0&&(i[n]=z(n));if(s)B(_?"var "+V(e)+" = "+P(t,i)+" * "+I(e)+";":"var "+V(e)+" = "+P(t,i)+";");else for(n=0;n<w;n++){var o=e.concat(n);t[p]=n,B(_?"var "+V(o)+" = "+P(t,i)+" * "+I(e)+";":"var "+V(o)+" = "+P(t,i)+";")}})),X("\n"),X('// Perform De Boor"s algorithm'),d=u.length-1;d>=0;d--)for(u[d]=[m[d],m[d]+1],l=0;l<m[d];l++)for(X("\n // Degree "+m[d]+" evaluation in dimension "+d+", step "+(l+1)+"\n"),a=m[d];a>l;a--){var K=r&&m[d]-l-r[d]<=0;K?(B("m = 1 / ("+R([d,a-l+m[d]-1])+" - "+R([d,a-1])+");"),_&&(B("a = ("+x(d)+" - "+R([d,a-1])+") * m;"),B("b = 1 - a;"))):(B("a = ("+x(d)+" - "+R([d,a-1])+") / ("+R([d,a-l+m[d]-1])+" - "+R([d,a-1])+");"),B("b = 1 - a;")),_&&_e(u,(function(e){var t=e.slice(),i=e.slice();t[d]=a,i[d]=a-1,K&&_&&B("h = "+I(t)+";"),B(I(t)+" = b * "+I(i)+" + a * "+I(t)+";")})),_e(u,(function(e){var t,i,n,o=e.slice(),r=e.slice();if(o[d]=a,r[d]=a-1,K){var u=l+1;if(s)t=_?"h * "+I(r)+" / "+I(o)+" * ":"",i=V(o)+(_?" / h":""),n=V(r)+(_?" / "+I(r):""),B(V(o)+" = "+u+" * "+t+"("+i+" - "+n+") * m;");else{var c=o.slice(),g=r.slice();for(h=0;h<w;h++)c[p]=g[p]=h,t=_?"h * "+I(r)+" / "+I(o)+" * ":"",i=V(c)+(_?" / h":""),n=V(g)+(_?" / "+I(r):""),B(V(c)+" = "+u+" * "+t+"("+i+" - "+n+") * m;")}}else if(s)B(V(o)+" = b * "+V(r)+" + a * "+V(o)+";");else for(h=0;h<w;h++)o[p]=r[p]=h,B(V(o)+" = b * "+V(r)+" + a * "+V(o)+";")})),X("\n")}if(n&&B(_?"\n // Project back from homogeneous coordinates and return final output\n":"\n // Return final output\n"),s)B(_?"return "+V(m)+" / "+I(m)+";":"return "+V(m)+";");else for(d=0;d<w;d++)B(_?"out["+d+"] = "+V(m.concat([d]))+" / "+I(m)+";":"out["+d+"] = "+V(m.concat([d]))+";");if(s||B("return out;"),O.push("}"),n){var G=O.join("\n");C(G),Ce[e]=G}var W=new Function([O.join("\n"),"; return ",S].join(""))();return Ne[e]=W,W.bind(t)};f().set("lib/nurbs/src/evaluate",Oe);const Se=Oe;var Pe={};const De=function(e,t,i,n){var o,s,r,l,a,u,h,d,c=Pe[e];if(c)return c.bind(t);var p=[],g="transform"+e;p.push("function "+g+"(m) {"),p.push("var i, w;"),p.push(we(t,"x","this.points",t.points));var m=re(n?"size":"s");for(o=0;o<t.splineDimension;o++)p.push("var "+m(o)+" = "+ye(t.points,"this.points",o)+";");for(l=[],o=0;o<t.splineDimension;o++)r="i"+o,l.push(r),p.push("for ("+r+" = "+m(o)+"- 1; "+r+" >= 0; "+r+"--) {");for(o=0;o<t.dimension;o++)p.push("x"+o+" = "+i.point(l.concat([o])));for(a=[],o=0;o<t.dimension;o++)a.push("m["+((t.dimension+1)*(o+1)-1)+"] * x"+o);for(a.push("m["+((t.dimension+1)*(t.dimension+1)-1)+"]"),p.push("var w = ("+a.join(" + ")+") || 1.0;"),o=0;o<t.dimension;o++){for(a=[],u=t.dimension,s=0;s<u;s++)a.push("m["+(s*(u+1)+o)+"] * x"+s);a.push("m["+(s*(u+1)+o)+"]"),d=i.point(l.concat([o])),h="("+a.join(" + ")+") / w",p.push(d+" = "+h+";")}for(o=t.splineDimension-1;o>=0;o--)p.push("}");p.push("return this;"),p.push("}");var f=new Function([p.join("\n"),"; return ",g].join(""))();return n&&console.log(p.join("\n")),Pe[e]=f,f.bind(t)};f().set("lib/nurbs/src/transform",De);const Fe=De;var Re={};const Ve=function(e,t,i,n,o){var s=Re[e];if(s)return s.bind(t);var r,l,a,u=t.degree,h=t.knots,d=t.splineDimension,c=t.boundary,p=[],g="support"+e,m=i.knot,f=re("t"),_=n?"domain":"d",b=re(n?"size":"s"),w=re(n?"knotIndex":"i"),v=!0;for(a=0;a<d;a++)Q(h)&&Q(h[a])&&(v=!1);function y(e){p.push(" "+(e||""))}var N=[];for(r=0;r<d;r++)N.push(f([r]));p.push("function "+g+" (out, "+N.join(", ")+") {");var C=0;function O(e,t){y(void 0===t?"out["+C+++"] = "+e.join(" + ")+";":"out["+C+++"] = ("+e.join(" + ")+" + "+t+") % "+t+";")}for(y("var h, m;"),y("var c = 0;"),o&&(y("var "+_+" = this.domain;"),y("for (var i = 0; i < this.splineDimension; i++) {"),y(" a = arguments[i + 1];"),y(" if (a < "+_+"[i][0] || a > "+_+"[i][1] || a === undefined || isNaN(a)) {"),y(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+_+'[i][0]+", "+'+_+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),y(" }"),y("}")),a=0;a<d;a++)y("var "+b(a)+" = "+ye(t.points,"this.points",a)+";");v||p.push(we(t,"k","this.knots",h));var S=[];for(a=0;a<d;a++)switch(te(h)){case te.NDARRAY:S[a]=!0;break;case te.ARRAY_OF_ARRAYS:S[a]=Q(h[a])}for(a=0;a<d;a++)S[a]?(y("var "+w(a)+" = 0;"),y("h = "+b(a)+";"),y("while(h > "+w(a)+" + 1) {"),y(" m = 0.5 * (h + "+w(a)+") | 0;"),y(" if ("+m([a,"m"])+" > "+f(a)+") h = m;"),y(" else "+w(a)+" = m;"),y("}")):"closed"===c[a]?y(w(a)+" = ("+f(a)+" | 0) % "+b(a)+";"):(y(w(a)+" = ("+f(a)+" | 0);"),y("if ("+w(a)+" < "+u[a]+") "+w(a)+" = "+u[a]+";"),y("if ("+w(a)+" > "+b(a)+" - 1) "+w(a)+" = "+b(a)+" - 1;"));for(a=0,l=[];a<d;a++)l[a]=u[a]+1;_e(l,(function(e){for(var t=[],i=[],n=0;n<d;n++)t[n]=[w(n),e[n]-u[n]],"closed"===c[n]&&e[n]-u[n]<0&&(i[n]=b(n));for(n=0;n<d;n++)O(t[n],i[n])})),y("out.length = "+C+";"),y("return out;"),p.push("}"),n&&console.log(p.join("\n"));var P=new Function([p.join("\n"),"; return ",g].join(""))();return Re[e]=P,P.bind(t)};f().set("lib/nurbs/src/support",Ve);const Ie=Ve,Te=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Geometry/Triangle3");var xe=e.n(Te),je=[];const ze=function(e,t,i){i=i||{};var n=(e=e||{}).points=e.points||[],o=e.faces=e.faces||[],s=i.haveWeights,r=t.dimension-s;if(Array.isArray(i.resolution))var l=i.resolution;else{var a=void 0===i.resolution?31:i.resolution;l=new Array(t.splineDimension).fill(a)}switch(t.splineDimension){case 1:for(var u=(f=(b=l[0])+!(v="closed"===t.boundary[0]))*r,h=(N=(_=i.domain||t.domain)[0])[1]-N[0],d=0;d<f;++d){var c=N[0]+h*d/b,p=d*r;if(t.evaluate(je,c),s)for(var g=je[r],m=0;m<r;++m)n[p+m]=je[m]/g;else for(m=0;m<r;++m)n[p+m]=je[m]}n.length=u;break;case 2:var f,_,b=l[0],w=l[1],v="closed"===t.boundary[0],y=w+!(D="closed"===t.boundary[1]),N=(u=(f=b+!v)*y*r,(_=i.domain||t.domain)[0]),C=_[1],O=(h=N[1]-N[0],C[1]-C[0]);for(d=0;d<f;++d){c=N[0]+h*d/b;for(var S=0;S<y;++S){var P=C[0]+O*S/w;p=(d+f*S)*r;if(t.evaluate(je,c,P),s)for(g=je[r],m=0;m<r;++m)n[p+m]=je[m]/g;else for(m=0;m<r;++m)n[p+m]=je[m]}}n.length=u;v=i.closed[0];var D=i.closed[1],F=0;for(d=0;d<b;++d){var R=d,V=d+1;v&&(V%=b);for(S=0;S<w;++S){var I=S,T=S+1;D&&(T%=w),o[F++]=R+f*I,o[F++]=V+f*I,o[F++]=V+f*T,o[F++]=R+f*I,o[F++]=V+f*T,o[F++]=R+f*T}}o.length=F;break;default:throw new Error("Can only sample contours and surfaces")}return e};f().set("lib/nurbs/extras/sample",ze);const ke=ze;var Ae={open:"open",closed:"closed",clamped:"clamped"};function Be(e){return null==e}function Xe(e,t,i,n,o,s){var r,l;!e||Q(e)||J(e)?(s=s||{},this.weights=n,this.knots=i,this.degree=t,this.points=e,this.boundary=o,this.debug=s.debug,this.checkBounds=!!s.checkBounds,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0})):(s=e,this.debug=e.debug,this.checkBounds=!!e.checkBounds,this.weights=e.weights,this.knots=e.knots,this.degree=e.degree,this.boundary=e.boundary,this.points=e.points,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0}));var a=te(this.points),u=te(this.weights),h=te(this.knots);if(this.points)switch(a){case te.GENERIC_NDARRAY:case te.NDARRAY:Object.defineProperties(this,{splineDimension:{value:this.points.shape.length-1,writable:!1,configurable:!0},dimension:{value:this.points.shape[this.points.shape.length-1],writable:!1,configurable:!0},size:{get:function(){return this.points.shape.slice(0,this.points.shape.length-1)},set:function(){throw new Error("Cannot assign to read only property 'size'")},configurable:!0}});break;case te.ARRAY_OF_OBJECTS:case te.ARRAY_OF_ARRAYS:var d=0,c=this.size||[];c.length=0;for(var p=this.points;Q(p[0]);p=p[0])d++,c.push(p.length);if(0===d)throw new Error("Expected an array of points");Object.defineProperties(this,{splineDimension:{value:d,writable:!1,configurable:!0},dimension:{value:p.length,writable:!1,configurable:!0},size:{get:function(){var e=[];e.length=0;for(var t=0,i=this.points;t<this.splineDimension;t++,i=i[0])e[t]=i.length;return e},set:function(){throw new Error('Cannot assign to read only property "size"')},configurable:!0}});break;case te.PACKED:default:throw new Error("Expected either a packed array, array of arrays, or ndarray of points")}else{if(void 0===this.size||null===this.size)throw new Error("Either points or a control hull size must be provided.");if(Q(this.size)||Object.defineProperty(this,"size",{value:[this.size],writable:!0,configurable:!0}),0===this.size.length)throw new Error("`size` must be a number or an array of length at least one.");Object.defineProperties(this,{splineDimension:{value:this.size.length,writable:!1,configurable:!0},dimension:{value:0,writable:!1,configurable:!0}})}if(Q(this.degree)){for(r=0;r<this.splineDimension;r++)if(Be(this.degree[r]))throw new Error("Missing degree in dimension "+(r+1))}else{var g=!Be(this.degree),m=Be(this.degree)?2:this.degree;for(this.degree=[],r=0;r<this.splineDimension;r++)if(this.size[r]<=m){if(g)throw new Error("Expected at least "+(m+1)+" points for degree "+m+" spline in dimension "+(r+1)+" but got only "+this.size[r]);this.degree[r]=this.size[r]-1}else this.degree[r]=m}if(l="string"!=typeof this.boundary?"open":this.boundary,!Ae[l])throw new Error("Boundary type must be one of "+Object.keys(Ae)+". Got "+l);for(this.boundary=Q(this.boundary)?this.boundary:[],this.boundary.length=this.splineDimension,r=0;r<this.splineDimension;r++)if(this.boundary[r]=Be(this.boundary[r])?l:this.boundary[r],!Ae[l])throw new Error("Boundary type must be one of "+Object.keys(Ae)+". Got "+l+" for dimension "+(r+1));switch(h){case te.ARRAY_OF_ARRAYS:for(Q(this.knots)&&this.knots.length>0&&!Q(this.knots[0])&&(this.knots=[this.knots]),r=0;r<this.splineDimension;r++){if(this.size[r]<=this.degree[r])throw new Error("Expected at least "+(this.degree[r]+1)+" points in dimension "+(r+1)+" but got "+this.size[r]+".");if(Q(this.knots[r])){if("closed"!==this.boundary[r]&&this.knots[r].length!==this.degree[r]+this.size[r]+1)throw new Error("Expected "+(this.degree[r]+this.size[r]+1)+" knots in dimension "+(r+1)+" but got "+this.knots[r].length+".");if("closed"===this.boundary[r]&&this.knots[r].length!==this.size[r]+1&&!(this.knots[r].length===this.size[r]+this.degree[r]+1))throw new Error("Expected "+(this.size[r]+1)+" knots for closed spline in dimension "+(r+1)+" but got "+this.knots[r].length+".")}}case te.NDARRAY:}var f=ne(this,this.debug,this.checkBounds,a,u,h);if(f!==this.__cacheKey){this.__cacheKey=f;var _=de(this);this.evaluate=Se(this.__cacheKey,this,_,this.debug,this.checkBounds,!1),this.transform=Fe(this.__cacheKey,this,_,this.debug),this.support=Ie(this.__cacheKey,this,_,this.debug,this.checkBounds),this.evaluator=function(e,t){return Se(this.__cacheKey,this,_,this.debug,this.checkBounds,t,e)}}return this.numericalDerivative=me.bind(this),this}function Ee(){var e,t=[],i=this.points;i?Z(i)&&(e=i.shape):e=this.size;for(var n=0;n<this.splineDimension;n++){var o=e?e[n]:i.length,s=this.degree[n],r="closed"===this.boundary[n];if(this.knots&&this.knots[n]){var l=this.knots[n];t[n]=[l[r?0:s],l[o]]}else t[n]=[r?0:s,o];i&&(i=i[0])}return t}function Ue(e,t,i,n,o,s){var r=function(e,t,i,n,o,s){return l(e,t,i,n,o,s),r},l=Xe.bind(r);return Object.defineProperty(r,"domain",{get:Ee}),l(e,t,i,n,o,s),r}Ue.sample=ke;const qe=Ue;f().set("lib/nurbs/nurbs",qe);const Me=qe;function Ke(e){K.call(this,e),W().call(this,e),this.addType(c().NurbsCurve),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]}}Object.assign(Object.setPrototypeOf(Ke.prototype,K.prototype),W().prototype,{initialize(){K.prototype.initialize.call(this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},getTessellation(e){return U.getTessellation(this._tessellation.getValue(),e-this._order.getValue())},getClosed(e,t,i,n){return!!this._closed.getValue()&&U.getClosed(e,t,i,n)},getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),tessellate(){if(this._order.getValue()<2)return[];if(!this.controlPointNode)return[];if(this.controlPointNode.getSize()<this._order.getValue())return[];const e=this.getVertices(),t=[];if(e.length){const i=e.length;for(let n=0;n<i;n+=8)t.push(e[n],e[n+1],e[n+2]);t.push(e[i-4],e[i-3],e[i-2])}return t},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=(n.at(-1),n[0],this._order.getValue()-1),s=this.surface=(this.surface||Me)({boundary:["open"],degree:[o],knots:[n],points:i,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(n.length),this.sampleOptions.haveWeights=!!t;const r=Me.sample(this.mesh,s,this.sampleOptions).points,l=this.getVertices();for(let e=3,t=r.length;e<t;e+=3){const t=e-3;l.push(r[t],r[t+1],r[t+2],1),l.push(r[e],r[e+1],r[e+2],1)}},dispose(){K.prototype.dispose.call(this)}}),Object.defineProperties(Ke,{typeName:{value:"NurbsCurve",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"closed",new(o().SFBool)),new(r())(c().initializeOnly,"order",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode))]),enumerable:!0}});const Ge=Ke;f().set("x_ite/Components/NURBS/NurbsCurve",Ge);const We=Ge;function Ye(e){C.call(this,e),this.addType(c().NurbsCurve2D),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]},this.array=[]}Object.assign(Object.setPrototypeOf(Ye.prototype,C.prototype),{getTessellation(e){return U.getTessellation(this._tessellation.getValue(),e-this._order.getValue())},getClosed(e,t,i,n){return!!this._closed.getValue()&&U.getClosed2D(e,t,i,n)},getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints2D(e,t,i,n,o),tessellate(e){const t=this.array;if(t.length=0,this._order.getValue()<2)return t;if(this._controlPoint.length<this._order.getValue())return t;const i=this.getClosed(this._order.getValue(),this._knot,this._weight,this._controlPoint),n=this.getWeights(this.weights,this._controlPoint.length,this._weight),o=this.getControlPoints(this.controlPoints,i,this._order.getValue(),n,this._controlPoint),s=this.getKnots(this.knots,i,this._order.getValue(),this._controlPoint.length,this._knot),r=(s.at(-1),s[0],this._order.getValue()-1),l=this.surface=(this.surface||Me)({boundary:["open"],degree:[r],knots:[s],points:o,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(s.length),this.sampleOptions.haveWeights=!!n;const a=Me.sample(this.mesh,l,this.sampleOptions).points;switch(e){case 0:for(let e=0,i=a.length;e<i;e+=2)t.push(a[e],a[e+1]);break;case 1:for(let e=0,i=a.length;e<i;e+=2)t.push(a[e],0,a[e+1]);break;case 2:for(let e=0,i=a.length;e<i;e+=2)t.push(new(S())(a[e],a[e+1],0))}return t}}),Object.defineProperties(Ye,{typeName:{value:"NurbsCurve2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"closed",new(o().SFBool)),new(r())(c().initializeOnly,"order",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),enumerable:!0}});const Je=Ye;f().set("x_ite/Components/NURBS/NurbsCurve2D",Je);const Le=Je,Ze=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Core/X3DChildNode");var He=e.n(Ze);const Qe=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Interpolation/OrientationInterpolator");var $e=e.n(Qe);const et=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Numbers/Rotation4");var tt=e.n(et);function it(e){He().call(this,e),this.addType(c().NurbsOrientationInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new($e())(e),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}Object.assign(Object.setPrototypeOf(it.prototype,He().prototype),{initialize(){He().prototype.initialize.call(this),this._order.addInterest("requestRebuild",this),this._knot.addInterest("requestRebuild",this),this._weight.addInterest("requestRebuild",this),this._controlPoint.addInterest("set_controlPoint__",this),this._rebuild.addInterest("build",this),this._set_fraction.addFieldInterest(this.interpolator._set_fraction),this.interpolator._value_changed.addFieldInterest(this._value_changed),this.interpolator.setup(),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:(e,t,i,n)=>!1,getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),requestRebuild(){this._rebuild.addEvent()},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=n.at(-1)-n[0],s=this._order.getValue()-1,r=this.surface=(this.surface||Me)({boundary:["open"],degree:[s],knots:[n],points:i,debug:!1});this.sampleOptions.haveWeights=!!t;const l=Me.sample(this.mesh,r,this.sampleOptions).points,a=this.interpolator;a._key.length=0,a._keyValue.length=0;for(let t=0,i=l.length-3;t<i;t+=3){const s=new(S())(l[t+3]-l[t+0],l[t+4]-l[t+1],l[t+5]-l[t+2]);a._key.push(n[0]+t/(i-3+3*e)*o),a._keyValue.push(new(tt())(S().zAxis,s))}e&&(a._key.push(n[0]+o),a._keyValue.push(a._keyValue[0]))}}),Object.defineProperties(it,{typeName:{value:"NurbsOrientationInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFFloat)),new(r())(c().inputOutput,"order",new(o().SFInt32)(3)),new(r())(c().inputOutput,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"value_changed",new(o().SFRotation))]),enumerable:!0}});const nt=it;f().set("x_ite/Components/NURBS/NurbsOrientationInterpolator",nt);const ot=nt,st=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Algorithm");var rt=e.n(st);function lt(e){K.call(this,e),this.addType(c().X3DNurbsSurfaceGeometryNode),this.tessellationScale=1,this.uKnots=[],this.vKnots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[],closed:[]},this.textUKnots=[],this.textVKnots=[],this.textWeights=[],this.texControlPoints=[],this.texMesh={}}Object.assign(Object.setPrototypeOf(lt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._texCoord.addInterest("set_texCoord__",this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_texCoord__(),this.set_controlPoint__()},set_texCoord__(){this.texCoordNode?.removeInterest("requestRebuild",this),this.nurbsTexCoordNode?.removeInterest("requestRebuild",this),this.texCoordNode=g()(c().X3DTextureCoordinateNode,this._texCoord),this.nurbsTexCoordNode=g()(c().NurbsTextureCoordinate,this._texCoord),this.texCoordNode?.addInterest("requestRebuild",this),this.nurbsTexCoordNode?.addInterest("requestRebuild",this)},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},setTessellationScale(e){this.tessellationScale=e,this.requestRebuild()},getUTessellation(e){return Math.floor(U.getTessellation(this._uTessellation.getValue(),e-this._uOrder.getValue())*this.tessellationScale)},getVTessellation(e){return Math.floor(U.getTessellation(this._vTessellation.getValue(),e-this._vOrder.getValue())*this.tessellationScale)},getUClosed(e,t,i,n,o,s){return!!this._uClosed.getValue()&&U.getUClosed(e,t,i,n,o,s)},getVClosed(e,t,i,n,o,s){return!!this._vClosed.getValue()&&U.getVClosed(e,t,i,n,o,s)},getUVWeights:(e,t,i,n)=>U.getUVWeights(e,t,i,n),getTexControlPoints:(e,t,i,n,o,s,r,l)=>U.getTexControlPoints(e,t,i,n,o,s,r,l),getUVControlPoints:(e,t,i,n,o,s,r,l,a)=>U.getUVControlPoints(e,t,i,n,o,s,r,l,a),getTrimmingContours(){},build(){if(this._uOrder.getValue()<2)return;if(this._vOrder.getValue()<2)return;if(this._uDimension.getValue()<this._uOrder.getValue())return;if(this._vDimension.getValue()<this._vOrder.getValue())return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()!==this._uDimension.getValue()*this._vDimension.getValue())return;const e=this.getUClosed(this._uOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._uKnot,this._weight,this.controlPointNode),t=this.getVClosed(this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._vKnot,this._weight,this.controlPointNode),i=this.getUVWeights(this.weights,this._uDimension.getValue(),this._vDimension.getValue(),this._weight),n=this.getUVControlPoints(this.controlPoints,e,t,this._uOrder.getValue(),this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),i,this.controlPointNode),o=this.getKnots(this.uKnots,e,this._uOrder.getValue(),this._uDimension.getValue(),this._uKnot),s=this.getKnots(this.vKnots,t,this._vOrder.getValue(),this._vDimension.getValue(),this._vKnot),r=(o.at(-1),o[0],s.at(-1),s[0],this._uOrder.getValue()-1),l=this._vOrder.getValue()-1,a=this.surface=(this.surface||Me)({boundary:["open","open"],degree:[r,l],knots:[o,s],points:n,debug:!1}),u=this.sampleOptions;u.resolution[0]=this.getUTessellation(o.length),u.resolution[1]=this.getVTessellation(s.length),u.closed[0]=e,u.closed[1]=t,u.domain=void 0,u.haveWeights=!!i,u.trimmingContours=this.getTrimmingContours();const h=Me.sample(this.mesh,a,u),d=h.faces,c=h.points,p=this.getVertices();for(let e=0,t=d.length;e<t;++e){const t=3*d[e];p.push(c[t],c[t+1],c[t+2],1)}this.buildNurbsTexCoords(e,t,this._uOrder.getValue(),this._vOrder.getValue(),o,s,this._uDimension.getValue(),this._vDimension.getValue(),a.domain),this.buildNormals(d,c),this.setSolid(this._solid.getValue()),this.setCCW(!0)},buildNurbsTexCoords:(()=>{const e=[],t=[],i=[[[0,0,0,1],[0,1,0,1]],[[1,0,0,1],[1,1,0,1]]];function n(e,t){return e[0]=e[1]=t[0],e[2]=e[3]=t.at(-1),e}return function(o,s,r,l,a,u,h,d,c){const p=this.sampleOptions;if(this.texCoordNode&&this.texCoordNode.getSize()===h*d)var g=r-1,m=l-1,f=a,_=u,b=this.getTexControlPoints(this.texControlPoints,o,s,r,l,h,d,this.texCoordNode);else if(this.nurbsTexCoordNode&&this.nurbsTexCoordNode.isValid()){var w=this.nurbsTexCoordNode,v=(g=w._uOrder.getValue()-1,m=w._vOrder.getValue()-1,f=this.getKnots(this.texUKnots,!1,w._uOrder.getValue(),w._uDimension.getValue(),w._uKnot),_=this.getKnots(this.texVKnots,!1,w._vOrder.getValue(),w._vDimension.getValue(),w._vKnot),this.getUVWeights(this.texWeights,w._uDimension.getValue(),w._vDimension.getValue(),w._weight));b=w.getControlPoints(v)}else{g=1,m=1,f=n(e,a),_=n(t,u),b=i;p.domain=c}const y=this.texSurface=(this.texSurface||Me)({boundary:["open","open"],degree:[g,m],knots:[f,_],points:b});p.closed[0]=!1,p.closed[1]=!1,p.haveWeights=!1;const N=Me.sample(this.texMesh,y,p),C=N.faces,O=N.points,S=this.getTexCoords();for(let e=0,t=C.length;e<t;++e){const t=4*C[e];S.push(O[t],O[t+1],O[t+2],O[t+3])}this.getMultiTexCoords().push(this.getTexCoords())}})(),buildNormals(e,t){const i=this.createNormals(e,t),n=this.getNormals();for(const e of i)n.push(e.x,e.y,e.z)},createNormals(e,t){const i=new Map,n=this.createFaceNormals(e,t),o=e.length;for(let t=0;t<o;++t){const n=e[t];let o=i.get(n);o||i.set(n,o=[]),o.push(t)}return this.refineNormals(i,n,rt().radians(85))},createFaceNormals:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0),i=new(S())(0,0,0);return function(n,o){const s=this.faceNormals||[],r=n.length;for(let l=0;l<r;l+=3){const r=3*n[l],a=3*n[l+1],u=3*n[l+2];e.set(o[r],o[r+1],o[r+2]),t.set(o[a],o[a+1],o[a+2]),i.set(o[u],o[u+1],o[u+2]);const h=xe().normal(e,t,i,s[l]||new(S())(0,0,0));s[l]=h,s[l+1]=h,s[l+2]=h}return s.length=r,s}})()}),Object.defineProperties(lt,{typeName:{value:"X3DNurbsSurfaceGeometryNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const at=lt;f().set("x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode",at);const ut=at;function ht(e){ut.call(this,e),this.addType(c().NurbsPatchSurface)}Object.setPrototypeOf(ht.prototype,ut.prototype),Object.defineProperties(ht,{typeName:{value:"NurbsPatchSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"uClosed",new(o().SFBool)),new(r())(c().initializeOnly,"vClosed",new(o().SFBool)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"texCoord",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode))]),enumerable:!0}});const dt=ht;f().set("x_ite/Components/NURBS/NurbsPatchSurface",dt);const ct=dt,pt=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Interpolation/PositionInterpolator");var gt=e.n(pt);function mt(e){He().call(this,e),this.addType(c().NurbsPositionInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new(gt())(e),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}Object.assign(Object.setPrototypeOf(mt.prototype,He().prototype),{initialize(){He().prototype.initialize.call(this),this._order.addInterest("requestRebuild",this),this._knot.addInterest("requestRebuild",this),this._weight.addInterest("requestRebuild",this),this._controlPoint.addInterest("set_controlPoint__",this),this._rebuild.addInterest("build",this),this._set_fraction.addFieldInterest(this.interpolator._set_fraction),this.interpolator._value_changed.addFieldInterest(this._value_changed),this.interpolator.setup(),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:(e,t,i,n)=>!1,getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),requestRebuild(){this._rebuild.addEvent()},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),s=n.at(-1)-n[0],r=this._order.getValue()-1,l=this.surface=(this.surface||Me)({boundary:["open"],degree:[r],knots:[n],points:i,debug:!1});this.sampleOptions.haveWeights=!!t;const a=Me.sample(this.mesh,l,this.sampleOptions).points,u=this.interpolator;u._key.length=0,u._keyValue.length=0;for(let e=0,t=a.length;e<t;e+=3)u._key.push(n[0]+e/(t-3)*s),u._keyValue.push(new(o().SFVec3f)(a[e],a[e+1],a[e+2]))}}),Object.defineProperties(mt,{typeName:{value:"NurbsPositionInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFFloat)),new(r())(c().inputOutput,"order",new(o().SFInt32)(3)),new(r())(c().inputOutput,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"value_changed",new(o().SFVec3f))]),enumerable:!0}});const ft=mt;f().set("x_ite/Components/NURBS/NurbsPositionInterpolator",ft);const _t=ft,bt=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Grouping/X3DBoundedObject");var wt=e.n(bt);function vt(e){He().call(this,e),wt().call(this,e),this.addType(c().NurbsSet),this.geometryNodes=[]}function yt(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(vt.prototype,He().prototype),wt().prototype,{initialize(){He().prototype.initialize.call(this),wt().prototype.initialize.call(this),this._tessellationScale.addInterest("set_tessellationScale__",this),this._addGeometry.addInterest("set_addGeometry__",this),this._removeGeometry.addInterest("set_removeGeometry__",this),this._geometry.addInterest("set_geometry__",this),this.set_geometry__()},getBBox(e,t){for(const t of this.geometryNodes)e.add(t.getBBox());return e},set_tessellationScale__(){const e=Math.max(0,this._tessellationScale.getValue());for(const t of this.geometryNodes)t.setTessellationScale(e)},set_addGeometry__(){this._addGeometry.setTainted(!0),this._addGeometry.assign(yt(this._addGeometry,this._geometry));for(const e of this._addGeometry)this._geometry.push(e);this._addGeometry.length=0,this._addGeometry.setTainted(!1)},set_removeGeometry__(){this._removeGeometry.setTainted(!0),this._geometry.assign(yt(this._geometry,this._removeGeometry)),this._removeGeometry.length=0,this._removeGeometry.setTainted(!1)},set_geometry__(){for(const e of this.geometryNodes)e.setTessellationScale(1);this.geometryNodes.length=0;for(const e of this._geometry){const t=g()(c().X3DNurbsSurfaceGeometryNode,e);t&&this.geometryNodes.push(t)}this.set_tessellationScale__()},dispose(){wt().prototype.dispose.call(this),He().prototype.dispose.call(this)}}),Object.defineProperties(vt,{typeName:{value:"NurbsSet",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellationScale",new(o().SFFloat)(1)),new(r())(c().inputOutput,"visible",new(o().SFBool)(!0)),new(r())(c().inputOutput,"bboxDisplay",new(o().SFBool)),new(r())(c().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(r())(c().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(r())(c().inputOnly,"addGeometry",new(o().MFNode)),new(r())(c().inputOnly,"removeGeometry",new(o().MFNode)),new(r())(c().inputOutput,"geometry",new(o().MFNode))]),enumerable:!0}});const Nt=vt;f().set("x_ite/Components/NURBS/NurbsSet",Nt);const Ct=Nt,Ot=window[Symbol.for("X_ITE.X3D-8.9.5")].require("standard/Math/Geometry/Line3");var St=e.n(Ot);const Pt={isPointInTriangle(e,t,i,n){const o=(t.y-i.y)*(e.x-i.x)+(i.x-t.x)*(e.y-i.y);if(0==o)return!1;const s=((t.y-i.y)*(n.x-i.x)+(i.x-t.x)*(n.y-i.y))/o;if(s<0||s>1)return!1;const r=((i.y-e.y)*(n.x-i.x)+(e.x-i.x)*(n.y-i.y))/o;if(r<0||r>1)return!1;const l=1-s-r;return!(l<0||l>1)}};f().set("standard/Math/Geometry/Triangle2",Pt);const Dt=Pt;function Ft(e){He().call(this,e),this.addType(c().NurbsSurfaceInterpolator),this.geometry=new ct(e)}Object.assign(Object.setPrototypeOf(Ft.prototype,He().prototype),{initialize(){this._set_fraction.addInterest("set_fraction__",this),this._uOrder.addFieldInterest(this.geometry._uOrder),this._vOrder.addFieldInterest(this.geometry._vOrder),this._uDimension.addFieldInterest(this.geometry._uDimension),this._vDimension.addFieldInterest(this.geometry._vDimension),this._uKnot.addFieldInterest(this.geometry._uKnot),this._vKnot.addFieldInterest(this.geometry._vKnot),this._weight.addFieldInterest(this.geometry._weight),this._controlPoint.addFieldInterest(this.geometry._controlPoint),this.geometry._uTessellation=128,this.geometry._vTessellation=128,this.geometry._uOrder=this._uOrder,this.geometry._vOrder=this._vOrder,this.geometry._uDimension=this._uDimension,this.geometry._vDimension=this._vDimension,this.geometry._uKnot=this._uKnot,this.geometry._vKnot=this._vKnot,this.geometry._weight=this._weight,this.geometry._controlPoint=this._controlPoint,this.geometry.setup()},set_fraction__:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0),i=new(S())(0,0,0),n=new(S())(0,0,0),o=new(St())(S().Zero,S().zAxis),s={};return function(){const r=this._set_fraction.getValue(),l=this.geometry.getTexCoords(),a=this.geometry.getNormals(),u=this.geometry.getVertices();for(let h=0,d=0,c=l.length;h<c;h+=12,d+=9)if(e.set(l[h+0],l[h+1],0),t.set(l[h+4],l[h+5],0),i.set(l[h+7],l[h+9],0),Dt.isPointInTriangle(e,t,i,r)&&(o.set(n.set(r.x,r.y,0),S().zAxis),o.intersectsTriangle(e,t,i,s))){const e=s.u,t=s.v,i=s.t,n=new(S())(i*a[d+0]+e*a[d+3]+t*a[d+6],i*a[d+1]+e*a[d+4]+t*a[d+7],i*a[d+2]+e*a[d+5]+t*a[d+8]),o=new(S())(i*u[h+0]+e*u[h+4]+t*u[h+8],i*u[h+1]+e*u[h+5]+t*u[h+9],i*u[h+2]+e*u[h+6]+t*u[h+10]);this._normal_changed=n,this._position_changed=o}}})()}),Object.defineProperties(Ft,{typeName:{value:"NurbsSurfaceInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFVec2f)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"normal_changed",new(o().SFVec3f)),new(r())(c().outputOnly,"position_changed",new(o().SFVec3f))]),enumerable:!0}});const Rt=Ft;f().set("x_ite/Components/NURBS/NurbsSurfaceInterpolator",Rt);const Vt=Rt,It=window[Symbol.for("X_ITE.X3D-8.9.5")].require("x_ite/Components/Geometry3D/Extrusion");var Tt=e.n(It);function xt(e){K.call(this,e),this.addType(c().NurbsSweptSurface),this.extrusion=new(Tt())(e)}Object.assign(Object.setPrototypeOf(xt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._crossSectionCurve.addInterest("set_crossSectionCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const e=this.extrusion;e._beginCap=!1,e._endCap=!1,e._solid=!0,e._ccw=!0,e._convex=!0,e._creaseAngle=Math.PI,e.setup(),e._crossSection.setTainted(!0),e._spine.setTainted(!0),this.set_crossSectionCurve__(),this.set_trajectoryCurve__()},set_crossSectionCurve__(){this.crossSectionCurveNode&&this.crossSectionCurveNode.removeInterest("requestRebuild",this),this.crossSectionCurveNode=g()(c().X3DNurbsControlCurveNode,this._crossSectionCurve),this.crossSectionCurveNode&&this.crossSectionCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__(){this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.removeInterest("requestRebuild",this),this.trajectoryCurveNode=g()(c().NurbsCurve,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.addInterest("requestRebuild",this)},build(){if(!this.crossSectionCurveNode)return;if(!this.trajectoryCurveNode)return;const e=this.extrusion;if(e._crossSection=this.crossSectionCurveNode.tessellate(0),e._spine=this.trajectoryCurveNode.tessellate(0),e.rebuild(),this.getColors().assign(e.getColors()),this.getTexCoords().assign(e.getTexCoords()),this.getNormals().assign(e.getNormals()),this.getVertices().assign(e.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const e=this.getNormals();for(let t=0,i=e.length;t<i;++t)e[t]=-e[t]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}}),Object.defineProperties(xt,{typeName:{value:"NurbsSweptSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"ccw",new(o().SFBool)(!0)),new(r())(c().inputOutput,"crossSectionCurve",new(o().SFNode)),new(r())(c().inputOutput,"trajectoryCurve",new(o().SFNode))]),enumerable:!0}});const jt=xt;f().set("x_ite/Components/NURBS/NurbsSweptSurface",jt);const zt=jt;function kt(e){K.call(this,e),this.addType(c().NurbsSwungSurface),this.extrusion=new(Tt())(e)}Object.assign(Object.setPrototypeOf(kt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._profileCurve.addInterest("set_profileCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const e=this.extrusion;e._beginCap=!1,e._endCap=!1,e._solid=!0,e._ccw=!0,e._convex=!0,e._creaseAngle=Math.PI,e.setup(),e._crossSection.setTainted(!0),e._spine.setTainted(!0),this.set_profileCurve__(),this.set_trajectoryCurve__()},set_profileCurve__(){this.profileCurveNode&&this.profileCurveNode.removeInterest("requestRebuild",this),this.profileCurveNode=g()(c().X3DNurbsControlCurveNode,this._profileCurve),this.profileCurveNode&&this.profileCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__(){this.trajectoryCurveNode&&this.trajectoryCurveNode.removeInterest("requestRebuild",this),this.trajectoryCurveNode=g()(c().X3DNurbsControlCurveNode,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode.addInterest("requestRebuild",this)},build(){if(!this.profileCurveNode)return;if(!this.trajectoryCurveNode)return;const e=this.extrusion;if(e._crossSection=this.profileCurveNode.tessellate(0),e._spine=this.trajectoryCurveNode.tessellate(1),e.rebuild(),this.getColors().assign(e.getColors()),this.getTexCoords().assign(e.getTexCoords()),this.getNormals().assign(e.getNormals()),this.getVertices().assign(e.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const e=this.getNormals();for(let t=0,i=e.length;t<i;++t)e[t]=-e[t]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}}),Object.defineProperties(kt,{typeName:{value:"NurbsSwungSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"ccw",new(o().SFBool)(!0)),new(r())(c().inputOutput,"profileCurve",new(o().SFNode)),new(r())(c().inputOutput,"trajectoryCurve",new(o().SFNode))]),enumerable:!0}});const At=kt;f().set("x_ite/Components/NURBS/NurbsSwungSurface",At);const Bt=At;function Xt(e){h().call(this,e),this.addType(c().NurbsTextureCoordinate),this.controlPoints=[]}Object.assign(Object.setPrototypeOf(Xt.prototype,h().prototype),{initialize(){h().prototype.initialize.call(this)},getControlPoints(e){const t=this._controlPoint.getValue(),i=this.controlPoints;for(let n=0,o=this._uDimension.getValue();n<o;++n){let s=i[n];s||(s=i[n]=[]);for(let i=0,r=this._vDimension.getValue();i<r;++i){const r=i*o+n,l=s[i]||new(X()),a=2*r;s[i]=l.set(t[a],t[a+1],0,e?e[r]:1)}}return i},isValid(){return!(this._uOrder.getValue()<2)&&(!(this._vOrder.getValue()<2)&&(!(this._uDimension.getValue()<this._uOrder.getValue())&&(!(this._vDimension.getValue()<this._vOrder.getValue())&&this._controlPoint.length===this._uDimension.getValue()*this._vDimension.getValue())))}}),Object.defineProperties(Xt,{typeName:{value:"NurbsTextureCoordinate",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"texCoord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2f))]),enumerable:!0}});const Et=Xt;f().set("x_ite/Components/NURBS/NurbsTextureCoordinate",Et);const Ut=Et;function qt(e){ut.call(this,e),this.addType(c().NurbsTrimmedSurface),this.trimmingContourNodes=[]}function Mt(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(qt.prototype,ut.prototype),{initialize(){ut.prototype.initialize.call(this),this._addTrimmingContour.addInterest("set_addTrimmingContour__",this),this._removeTrimmingContour.addInterest("set_removeTrimmingContour__",this),this._trimmingContour.addInterest("set_trimmingContour__",this),this.set_trimmingContour__()},set_addTrimmingContour__(){this._addTrimmingContour.setTainted(!0),this._addTrimmingContour.assign(Mt(this._addTrimmingContour,this._trimmingContour),this._addTrimmingContour.length);for(const e of this._addTrimmingContour)this._trimmingContour.push(e);this._addTrimmingContour.length=0,this._addTrimmingContour.setTainted(!1)},set_removeTrimmingContour__(){this._removeTrimmingContour.setTainted(!0),this._trimmingContour.assign(Mt(this._trimmingContour,this._removeTrimmingContour)),this._removeTrimmingContour.length=0,this._removeTrimmingContour.setTainted(!1)},set_trimmingContour__(){const e=this.trimmingContourNodes;e.length=0;for(const t of this._trimmingContour){const i=g()(c().Contour2D,t);i&&e.push(i)}},getTrimmingContours(){const e=this.trimmingContourNodes,t=[];for(const i of e)i.addTrimmingContour(t);return t}}),Object.defineProperties(qt,{typeName:{value:"NurbsTrimmedSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"uClosed",new(o().SFBool)),new(r())(c().initializeOnly,"vClosed",new(o().SFBool)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"texCoord",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().inputOnly,"addTrimmingContour",new(o().MFNode)),new(r())(c().inputOnly,"removeTrimmingContour",new(o().MFNode)),new(r())(c().inputOutput,"trimmingContour",new(o().MFNode))]),enumerable:!0}});const Kt=qt;f().set("x_ite/Components/NURBS/NurbsTrimmedSurface",Kt);const Gt=Kt;i().add({name:"NURBS",concreteNodes:[v,F,x,We,Le,ot,ct,_t,Ct,Vt,zt,Bt,Ut,Gt],abstractNodes:[C,ut,K]});const Wt=void 0;f().set("assets/components/NURBS",Wt)})();
|
|
1
|
+
/* X_ITE v8.9.6 */(()=>{"use strict";var e={n:t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},d:(t,i)=>{for(var n in i)e.o(i,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:i[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components");var i=e.n(t);const n=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Fields");var o=e.n(n);const s=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Base/X3DFieldDefinition");var r=e.n(s);const l=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Base/FieldDefinitionArray");var a=e.n(l);const u=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Core/X3DNode");var h=e.n(u);const d=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Base/X3DConstants");var c=e.n(d);const p=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Base/X3DCast");var g=e.n(p);const m=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Namespace");var f=e.n(m);function _(e){h().call(this,e),this.addType(c().Contour2D),this.childNodes=[]}function b(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(_.prototype,h().prototype),{initialize(){h().prototype.initialize.call(this),this._addChildren.addInterest("set_addChildren__",this),this._removeChildren.addInterest("set_removeChildren__",this),this._children.addInterest("set_children__",this),this.set_children__()},set_addChildren__(){this._addChildren.setTainted(!0),this._addChildren.assign(b(this._addChildren,this._children));for(const e of this._addChildren)this._children.push(e);this._addChildren.length=0,this._addChildren.setTainted(!1)},set_removeChildren__(){this._removeChildren.setTainted(!0),this._children.assign(b(this._children,this._removeChildren)),this._removeChildren.length=0,this._removeChildren.setTainted(!1)},set_children__(){const e=this.childNodes;e.length=0;for(const t of this._children){const i=g()(c().NurbsCurve2D,t);if(i)e.push(i);else{const i=g()(c().ContourPolyline2D,t);if(i){e.push(i);continue}}}},addTrimmingContour(e){for(const t of this.childNodes)e.push(t.tessellate(2))}}),Object.defineProperties(_,{typeName:{value:"Contour2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"trimmingContour",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"addChildren",new(o().MFNode)),new(r())(c().inputOnly,"removeChildren",new(o().MFNode)),new(r())(c().inputOutput,"children",new(o().MFNode))]),enumerable:!0}});const w=_;f().set("x_ite/Components/NURBS/Contour2D",w);const v=w;function y(e){h().call(this,e),this.addType(c().X3DNurbsControlCurveNode)}Object.setPrototypeOf(y.prototype,h().prototype),Object.defineProperties(y,{typeName:{value:"X3DNurbsControlCurveNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const N=y;f().set("x_ite/Components/NURBS/X3DNurbsControlCurveNode",N);const C=N,O=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Numbers/Vector3");var S=e.n(O);function P(e){C.call(this,e),this.addType(c().ContourPolyline2D),this.controlPoints=[]}Object.assign(Object.setPrototypeOf(P.prototype,C.prototype),{tessellate(e){switch(e){case 0:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n;t[i+0]=e[i+0],t[i+1]=e[i+1]}return t.length=2*i,t}case 1:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n,o=3*n;t[o+0]=e[i+0],t[o+1]=0,t[o+2]=e[i+1]}return t.length=3*i,t}case 3:{const e=this._controlPoint.getValue(),t=this.controlPoints,i=this._controlPoint.length;for(let n=0;n<i;++n){const i=2*n;t[n]=new(S())(e[i+0],e[i+1],0)}return t.length=i,t}}}}),Object.defineProperties(P,{typeName:{value:"ContourPolyline2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),enumerable:!0}});const D=P;f().set("x_ite/Components/NURBS/ContourPolyline2D",D);const F=D,R=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Rendering/X3DCoordinateNode");var V=e.n(R);function I(e){V().call(this,e),this.addType(c().CoordinateDouble)}Object.setPrototypeOf(I.prototype,V().prototype),Object.defineProperties(I,{typeName:{value:"CoordinateDouble",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"coord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"point",new(o().MFVec3d))]),enumerable:!0}});const T=I;f().set("x_ite/Components/NURBS/CoordinateDouble",T);const x=T,j=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Rendering/X3DGeometryNode");var z=e.n(j);const k=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Numbers/Vector2");var A=e.n(k);const B=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Numbers/Vector4");var X=e.n(B);const E={getTessellation:(e,t)=>e>0?e+1:e<0?-e*t+1:2*t+1,getClosed2D(e,t,i,n){const o=n.length;return(!(i.length===o)||i[0]===i[o-1])&&(!!n[0].equals(n[o-1])&&!!this.isPeriodic(e,o,t))},getClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s){const r=s.getSize();return(!(o.length===r)||o[0]===o[r-1])&&(!!s.get1Point(0,e).equals(s.get1Point(r-1,t))&&!!this.isPeriodic(i,r,n))}})(),getUClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s,r,l){const a=r.length===l.getSize();for(let i=0,s=o;i<s;++i){const o=i*n,s=i*n+n-1;if(a&&r[o]!==r[s])return!1;if(!l.get1Point(o,e).equals(l.get1Point(s,t)))return!1}return!!this.isPeriodic(i,n,s)}})(),getVClosed:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0);return function(i,n,o,s,r,l){const a=r.length===l.getSize();for(let i=0,s=n;i<s;++i){const s=i,u=(o-1)*n+i;if(a&&r[s]!==r[u])return!1;if(!l.get1Point(s,e).equals(l.get1Point(u,t)))return!1}return!!this.isPeriodic(i,o,s)}})(),isPeriodic(e,t,i){if(i.length===t+e){{let t=1;for(let n=1,o=e;n<o;++n)t+=i[n]===i[0];if(t===e)return!1}{let t=1;for(let n=i.length-e,o=i.length-1;n<o;++n)t+=i[n]===i[o];if(t===e)return!1}}return!0},getKnots(e,t,i,n,o){const s=e||[];for(let e=0,t=o.length;e<t;++e)s[e]=o[e];s.length=o.length;let r=!0;if(s.length===n+i){r=!1;let e=0;for(let t=1,n=s.length;t<n;++t)s[t]==s[t-1]?++e:e=0,e>i-1&&(r=!0),s[t-1]>s[t]&&(r=!0)}if(r)for(let e=0,t=n+i;e<t;++e)s[e]=e/(t-1);if(t)for(let e=1,t=i-1;e<t;++e)s.push(s.at(-1)+(s[e]-s[e-1]));return s},getWeights(e,t,i){if(i.length!==t)return;const n=e||[];for(let e=0;e<t;++e)n[e]=i[e];return n.length=t,n},getUVWeights(e,t,i,n){const o=t*i;if(n.length!==o)return;const s=e||[];for(let e=0,o=0;e<t;++e)for(let e=0;e<i;++e,++o)s[o]=n[o];return s.length=o,s},getControlPoints2D(e,t,i,n,o){const s=e||[],r=o.getValue(),l=o.length,a=!!n,u=a?S():A();s.haveWeights!==a&&(s.haveWeights=a,s.length=0);for(let e=0;e<l;++e){const t=2*e,i=s[e]||new u(0,0,0);s[e]=i.set(r[t+0],r[t+1],a?n[e]:0)}if(s.length=l,t)for(let e=1,t=i-1;e<t;++e)s.push(s[e]);return s},getControlPoints(e,t,i,n,o){const s=e||[],r=o.getSize(),l=!!n,a=l?X():S();s.haveWeights!==l&&(s.haveWeights=l,s.length=0);for(let e=0;e<r;++e){const t=s[e]=o.get1Point(e,s[e]||new a(0,0,0,0));l&&(t.w=n[e])}if(s.length=r,t)for(let e=1,t=i-1;e<t;++e)s.push(s[e]);return s},getUVControlPoints(e,t,i,n,o,s,r,l,a){const u=e||[],h=!!l,d=h?X():S();u.haveWeights!==h&&(u.haveWeights=h,u.length=0);for(let e=0;e<s;++e){let t=u[e];t||(t=u[e]=[]);for(let i=0;i<r;++i){const n=i*s+e;t[i]=a.get1Point(n,t[i]||new d(0,0,0,0)),h&&(t[i].w=l[n])}if(t.length=r,i)for(let e=1,i=o-1;e<i;++e)t.push(t[e])}if(u.length=s,t)for(let e=1,t=n-1;e<t;++e)u.push(u[e]);return u},getTexControlPoints(e,t,i,n,o,s,r,l){const a=e||[];for(let e=0;e<s;++e){let t=a[e];t||(t=a[e]=[]);for(let i=0;i<r;++i){const n=i*s+e;t[i]=l.get1Point(n,t[i]||new(X())(0,0,0,0))}if(t.length=r,i)for(let e=1,i=o-1;e<i;++e)t.push(t[e])}if(a.length=s,t)for(let e=1,t=n-1;e<t;++e)a.push(a[e]);return a}};f().set("x_ite/Browser/NURBS/NURBS",E);const U=E;function q(e){z().call(this,e),this.addType(c().X3DParametricGeometryNode)}Object.assign(Object.setPrototypeOf(q.prototype,z().prototype),{getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o)}),Object.defineProperties(q,{typeName:{value:"X3DParametricGeometryNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const M=q;f().set("x_ite/Components/NURBS/X3DParametricGeometryNode",M);const K=M,G=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Rendering/X3DLineGeometryNode");var W=e.n(G);const Y=function(e){return!!e&&(!!e.dtype&&new RegExp("function View[0-9]+d(:?"+e.dtype+")+").test(String(e.constructor)))};f().set("lib/nurbs/src/utils/is-ndarray",Y);const J=Y,L=function(e){return!!e&&(void 0!==e.data&&Array.isArray(e.shape)&&void 0!==e.offset&&void 0!==e.stride)};f().set("lib/nurbs/src/utils/is-ndarray-like",L);const Z=L,H=function(e){return Array.isArray(e)||ArrayBuffer.isView(e)||void 0!==e.length};f().set("lib/nurbs/src/utils/is-array-like",H);const Q=H;function $(e){if(e){if(J(e)||Z(e))return"generic"===e.dtype?$.GENERIC_NDARRAY:$.NDARRAY;if(Q(e)){for(var t=e;Q(t[0]);t=t[0]);return"x"in t?$.ARRAY_OF_OBJECTS:$.ARRAY_OF_ARRAYS}throw new Error("Unhandled data type. Got type: "+typeof e)}}$.ARRAY_OF_OBJECTS="Obj",$.ARRAY_OF_ARRAYS="Arr",$.NDARRAY="Nd",$.GENERIC_NDARRAY="GenNd",$.PACKED="PackArr";const ee=$;f().set("lib/nurbs/src/utils/infer-type",ee);const te=ee;const ie=function(e,t,i,n,o,s){var r,l,a=[],u=!1;for(r=0;r<e.splineDimension;r++){var h=Q(e.knots)&&Q(e.knots[r]);h&&(u=!0),a.push("Deg"+e.degree[r]+(h?"":"Uniform")+((l=e.boundary[r])[0].toUpperCase()+l.slice(1)))}var d=[[u?"NU":"",e.weights?"RBS":"BS"].join("")+e.dimension+"D",a.join("_")];return n&&d.push(n+"Pts"),o&&d.push(o+"Wts"),s&&d.push(s+"Kts"),t&&d.push("debug"),i&&d.push("chk"),d.join("_")};f().set("lib/nurbs/src/utils/cache-key",ie);const ne=ie;var oe=function e(t,i){return function(i,n){void 0===i||Array.isArray(i)||(i=[i]);for(var o=[],s=0;s<i.length;s++)o.push(e.sum(i[s]));if(n)for(i=0;i<o.length;i++)void 0!==n[i]&&(o[i]="("+o[i]+" + "+n[i]+") % "+n[i]);return t+o.join("_")}};oe.sum=function(e){return 0===(e=(e=Array.isArray(e)?e:[e]).filter((e=>void 0!==e&&0!==e))).length&&e.push(0),e.join(" + ")};const se=oe;f().set("lib/nurbs/src/utils/variable",se);const re=se;var le=[".x",".y",".z",".w"];function ae(e){return function(t,i){void 0===t||Array.isArray(t)||(t=[t]);for(var n=[],o=0;o<t.length;o++)n.push(re.sum(t[o]));if(i)for(t=0;t<n.length;t++)void 0!==i[t]&&(n[t]="("+n[t]+" + "+i[t]+") % "+i[t]);return e(n)}}function ue(e,t){if(t)switch(te(t)){case te.ARRAY_OF_OBJECTS:return ae((t=>{var i=t.pop();return e+"["+t.join("][")+"]"+le[i]}));case te.ARRAY_OF_ARRAYS:return ae((t=>e+"["+t.join("][")+"]"));case te.GENERIC_NDARRAY:return ae((t=>e+".get("+t.join(",")+")"));case te.NDARRAY:return ae((t=>{for(var i=[e+"Offset"],n=0;n<t.length;n++)i.push(e+"Stride"+n+" * ("+t[n]+")");return e+"["+i.join(" + ")+"]"}));case te.PACKED:default:return}}const he=function(e){var t,i={};return(t=ue("x",e.points))&&(i.point=t),(t=ue("w",e.weights))&&(i.weight=t),(t=ue("k",e.knots))&&(i.knot=t),i};f().set("lib/nurbs/src/utils/create-accessors",he);const de=he;var ce=[],pe=[];const ge=function(e,t,i){if(1!==t)throw new Error("Numerical derivative not implemented for order n = "+t+".");var n,o=void 0===arguments[this.splineDimension+3]?1e-4:arguments[this.splineDimension+3];for(ce.length=this.splineDimension,n=0;n<this.splineDimension;n++)ce[n+1]=arguments[n+3];var s,r,l,a=this.domain,u=a[i][0],h=a[i][1],d=ce[i+1],c=(h-u)*o;for("closed"===this.boundary[i]?(s=u+(d-u-c+(l=h-u))%l,r=u+(d-u+c+l)%l,c*=2):(s=Math.min(h,Math.max(u,d-c)),c=(r=Math.min(h,Math.max(u,d+c)))-s),ce[i+1]=s,ce[0]=pe,this.evaluate.apply(null,ce),ce[i+1]=r,ce[0]=e,this.evaluate.apply(null,ce),n=0;n<this.dimension;n++)e[n]=(e[n]-pe[n])/c;return e};f().set("lib/nurbs/src/numerical-derivative",ge);const me=ge,fe=function(e,t){for(var i=1,n=0,o=[];n<e.length;n++)i*=Array.isArray(e[n])?e[n][1]-e[n][0]:e[n],o[n]=Array.isArray(e[n])?e[n][0]:0;for(var s=0;s<i;s++)for(t(o.slice()),n=e.length-1;n>=0;n--){if(o[n]!==(Array.isArray(e[n])?e[n][1]:e[n])-1){o[n]++;break}o[n]=Array.isArray(e[n])?e[n][0]:0}};f().set("lib/nurbs/src/utils/ndloop",fe);const _e=fe,be=function(e,t,i,n){var o=[];switch(te(n)){case te.NDARRAY:o.push(" var "+t+" = "+i+".data;"),o.push(" var "+t+"Offset = "+i+".offset;");for(var s=0;s<n.dimension;s++)o.push(" var "+t+"Stride"+s+" = "+i+".stride["+s+"];");break;case te.ARRAY_OF_OBJECTS:case te.ARRAY_OF_ARRAYS:o.push(" var "+t+" = "+i+";")}return o.join("\n")};f().set("lib/nurbs/src/utils/accessor-preamble",be);const we=be,ve=function(e,t,i){if(e){if(Z(e))return t+".shape["+i+"]";for(var n=t,o=0;o<i;o++)n+="[0]";return n+".length"}return"this.size["+i+"]"};f().set("lib/nurbs/src/utils/size-getter",ve);const ye=ve;var Ne={},Ce={};const Oe=function(e,t,i,n,o,s,r){var l,a,u,h,d,c,p=t.splineDimension,g=t.points,m=t.degree,f=t.weights,_=void 0!==f,b=t.knots,w=t.dimension,v=t.boundary;if(null!=r){Array.isArray(r)||(r=[r]);var y=0;for(l=0;l<p;l++)void 0===r[l]&&(r[l]=0),y+=r[l];if(_&&y>1)throw new Error("Analytical derivative not implemented for rational b-splines with order n = "+y+".")}s&&(e="Basis"+e),r&&(e="Der"+r.join("_")+"_"+e);var N=Ne[e];if(n)var C="function"==typeof n?n:console.log;if(N)return n&&C(Ce[e]),N.bind(t);var O=[],S="evaluate"+e,P=i.point;s&&(P=function(e,t){for(var i=[],n=0;n<e.length;n++){for(var o=e[n],s=[],r=0;r<o.length;r++)0!==o[r]&&s.push(o[r]);o=s.join(" + "),t[n]&&(o="("+o+" + "+t[n]+") % "+t[n]),i.push(o+" === "+T(n))}return"(("+i.join(" && ")+") ? 1 : 0)"});var D=i.weight,F=i.knot,R=re("k"),V=re("x"),I=re("w"),T=re("i"),x=re("t"),j=n?"domain":"d",z=re(n?"size":"s"),k=re(n?"knotIndex":"j"),A=!0;for(d=0;d<p;d++)Q(b)&&Q(b[d])&&(A=!1);function B(e){O.push(" "+(e||""))}function X(e){n&&B(e)}if(s)var E=[];var U=[];for(l=0;l<p;l++)s&&E.push(T([l])),U.push(x([l]));for(O.push("function "+S+" ("+(s?"":"out, ")+U.join(", ")+(s?", "+E.join(", "):"")+") {"),B("var h, m, a, b;"),o&&(B("var "+j+" = this.domain;"),B("for (var i = 0; i < this.splineDimension; i++) {"),B(" a = arguments[i + 1];"),B(" if (a < "+j+"[i][0] || a > "+j+"[i][1] || a === undefined || isNaN(a)) {"),B(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+j+'[i][0]+", "+'+j+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),B(" }"),B("}")),d=0;d<p;d++)B("var "+z(d)+" = "+ye(g,"this.points",d)+";");function q(e,t,i){return"("+e+") ? ("+t+") : ("+i+")"}O.push(we(t,"x","this.points",g)),_&&O.push(we(t,"w","this.weights",f)),A||O.push(we(t,"k","this.knots",b));var M=[];for(d=0;d<p;d++)switch(te(b)){case te.NDARRAY:M[d]=!0;break;case te.ARRAY_OF_ARRAYS:M[d]=Q(b[d])}for(d=0;d<p;d++)if(M[d])for(X("\n // Bisect to locate the knot interval in dimension "+d+"\n"),B("var "+k(d)+" = 0;"),B("h = "+z(d)+";"),B("while(h > "+k(d)+" + 1) {"),B(" m = 0.5 * (h + "+k(d)+") | 0;"),B(" if ("+F([d,"m"])+" > "+x(d)+") h = m;"),B(" else "+k(d)+" = m;"),B("}"),X("\n // Fetch knots for dimension "+d+"\n"),l=1-m[d];l<=m[d];l++)"closed"===v[d]?B(l<0?"var "+R([d,l+m[d]-1])+" = "+q(k(d)+" < "+-l,F([d,0])+" + "+F([d,[z(d),k(d),l]])+" - "+F([d,[z(d)]]),F([d,[k(d),l]]))+";":l>0?"var "+R([d,l+m[d]-1])+" = "+q(k(d)+" + "+l+" > "+z(d),F([d,z(d)])+" + "+F([d,l+" + "+k(d)+" - "+z(d)])+" - "+F([d,0]),F([d,[k(d),l]]))+";":"var "+R([d,l+m[d]-1])+" = "+F([d,[k(d),l]])+";"):B("var "+R([d,l+m[d]-1])+" = "+F([d,[k(d),l]])+";");else{for(X("\n // Directly compute knot interval for dimension "+d+"\n"),"closed"===v[d]?B(k(d)+" = ("+x(d)+" | 0) % "+z(d)+";"):(B(k(d)+" = ("+x(d)+" | 0);"),B("if ("+k(d)+" < "+m[d]+") "+k(d)+" = "+m[d]+";"),B("if ("+k(d)+" > "+z(d)+" - 1) "+k(d)+" = "+z(d)+" - 1;")),X("\n // Compute and clamp knots for dimension "+d+"\n"),l=1-m[d];l<=m[d];l++)B("var "+(c=R([d,l+m[d]-1]))+" = "+k(d)+" + "+l+";");if("clamped"===v[d])for(l=1-m[d];l<=m[d];l++)c=R([d,l+m[d]-1]),l<0&&B("if ("+c+" < "+m[d]+") "+c+" = "+m[d]+";"),l>0&&B("if ("+c+" > "+z(d)+") "+c+" = "+z(d)+";");"closed"===v[d]&&(X("\n // Wrap the B-Spline parameter for closed boundary"),B(x(d)+" %= "+z(d)+";"))}for(d=0,u=[];d<p;d++)u[d]=m[d]+1;for(_&&(X("\n // Fetch weights\n"),_e(u,(function(e){for(var t=[],i=[],n=0;n<p;n++)t[n]=[k(n),e[n]-m[n]],"closed"===v[n]&&e[n]-m[n]<0&&(i[n]=z(n));B("var "+I(e)+" = "+D(t,i)+";")}))),n&&B(_?"\n // Fetch points and project into homogeneous (weighted) coordinates\n":"\n // Fetch points\n"),_e(u,(function(e){for(var t=[],i=[],n=0;n<p;n++)t[n]=[k(n),e[n]-m[n]],"closed"===v[n]&&e[n]-m[n]<0&&(i[n]=z(n));if(s)B(_?"var "+V(e)+" = "+P(t,i)+" * "+I(e)+";":"var "+V(e)+" = "+P(t,i)+";");else for(n=0;n<w;n++){var o=e.concat(n);t[p]=n,B(_?"var "+V(o)+" = "+P(t,i)+" * "+I(e)+";":"var "+V(o)+" = "+P(t,i)+";")}})),X("\n"),X('// Perform De Boor"s algorithm'),d=u.length-1;d>=0;d--)for(u[d]=[m[d],m[d]+1],l=0;l<m[d];l++)for(X("\n // Degree "+m[d]+" evaluation in dimension "+d+", step "+(l+1)+"\n"),a=m[d];a>l;a--){var K=r&&m[d]-l-r[d]<=0;K?(B("m = 1 / ("+R([d,a-l+m[d]-1])+" - "+R([d,a-1])+");"),_&&(B("a = ("+x(d)+" - "+R([d,a-1])+") * m;"),B("b = 1 - a;"))):(B("a = ("+x(d)+" - "+R([d,a-1])+") / ("+R([d,a-l+m[d]-1])+" - "+R([d,a-1])+");"),B("b = 1 - a;")),_&&_e(u,(function(e){var t=e.slice(),i=e.slice();t[d]=a,i[d]=a-1,K&&_&&B("h = "+I(t)+";"),B(I(t)+" = b * "+I(i)+" + a * "+I(t)+";")})),_e(u,(function(e){var t,i,n,o=e.slice(),r=e.slice();if(o[d]=a,r[d]=a-1,K){var u=l+1;if(s)t=_?"h * "+I(r)+" / "+I(o)+" * ":"",i=V(o)+(_?" / h":""),n=V(r)+(_?" / "+I(r):""),B(V(o)+" = "+u+" * "+t+"("+i+" - "+n+") * m;");else{var c=o.slice(),g=r.slice();for(h=0;h<w;h++)c[p]=g[p]=h,t=_?"h * "+I(r)+" / "+I(o)+" * ":"",i=V(c)+(_?" / h":""),n=V(g)+(_?" / "+I(r):""),B(V(c)+" = "+u+" * "+t+"("+i+" - "+n+") * m;")}}else if(s)B(V(o)+" = b * "+V(r)+" + a * "+V(o)+";");else for(h=0;h<w;h++)o[p]=r[p]=h,B(V(o)+" = b * "+V(r)+" + a * "+V(o)+";")})),X("\n")}if(n&&B(_?"\n // Project back from homogeneous coordinates and return final output\n":"\n // Return final output\n"),s)B(_?"return "+V(m)+" / "+I(m)+";":"return "+V(m)+";");else for(d=0;d<w;d++)B(_?"out["+d+"] = "+V(m.concat([d]))+" / "+I(m)+";":"out["+d+"] = "+V(m.concat([d]))+";");if(s||B("return out;"),O.push("}"),n){var G=O.join("\n");C(G),Ce[e]=G}var W=new Function([O.join("\n"),"; return ",S].join(""))();return Ne[e]=W,W.bind(t)};f().set("lib/nurbs/src/evaluate",Oe);const Se=Oe;var Pe={};const De=function(e,t,i,n){var o,s,r,l,a,u,h,d,c=Pe[e];if(c)return c.bind(t);var p=[],g="transform"+e;p.push("function "+g+"(m) {"),p.push("var i, w;"),p.push(we(t,"x","this.points",t.points));var m=re(n?"size":"s");for(o=0;o<t.splineDimension;o++)p.push("var "+m(o)+" = "+ye(t.points,"this.points",o)+";");for(l=[],o=0;o<t.splineDimension;o++)r="i"+o,l.push(r),p.push("for ("+r+" = "+m(o)+"- 1; "+r+" >= 0; "+r+"--) {");for(o=0;o<t.dimension;o++)p.push("x"+o+" = "+i.point(l.concat([o])));for(a=[],o=0;o<t.dimension;o++)a.push("m["+((t.dimension+1)*(o+1)-1)+"] * x"+o);for(a.push("m["+((t.dimension+1)*(t.dimension+1)-1)+"]"),p.push("var w = ("+a.join(" + ")+") || 1.0;"),o=0;o<t.dimension;o++){for(a=[],u=t.dimension,s=0;s<u;s++)a.push("m["+(s*(u+1)+o)+"] * x"+s);a.push("m["+(s*(u+1)+o)+"]"),d=i.point(l.concat([o])),h="("+a.join(" + ")+") / w",p.push(d+" = "+h+";")}for(o=t.splineDimension-1;o>=0;o--)p.push("}");p.push("return this;"),p.push("}");var f=new Function([p.join("\n"),"; return ",g].join(""))();return n&&console.log(p.join("\n")),Pe[e]=f,f.bind(t)};f().set("lib/nurbs/src/transform",De);const Fe=De;var Re={};const Ve=function(e,t,i,n,o){var s=Re[e];if(s)return s.bind(t);var r,l,a,u=t.degree,h=t.knots,d=t.splineDimension,c=t.boundary,p=[],g="support"+e,m=i.knot,f=re("t"),_=n?"domain":"d",b=re(n?"size":"s"),w=re(n?"knotIndex":"i"),v=!0;for(a=0;a<d;a++)Q(h)&&Q(h[a])&&(v=!1);function y(e){p.push(" "+(e||""))}var N=[];for(r=0;r<d;r++)N.push(f([r]));p.push("function "+g+" (out, "+N.join(", ")+") {");var C=0;function O(e,t){y(void 0===t?"out["+C+++"] = "+e.join(" + ")+";":"out["+C+++"] = ("+e.join(" + ")+" + "+t+") % "+t+";")}for(y("var h, m;"),y("var c = 0;"),o&&(y("var "+_+" = this.domain;"),y("for (var i = 0; i < this.splineDimension; i++) {"),y(" a = arguments[i + 1];"),y(" if (a < "+_+"[i][0] || a > "+_+"[i][1] || a === undefined || isNaN(a)) {"),y(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+_+'[i][0]+", "+'+_+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),y(" }"),y("}")),a=0;a<d;a++)y("var "+b(a)+" = "+ye(t.points,"this.points",a)+";");v||p.push(we(t,"k","this.knots",h));var S=[];for(a=0;a<d;a++)switch(te(h)){case te.NDARRAY:S[a]=!0;break;case te.ARRAY_OF_ARRAYS:S[a]=Q(h[a])}for(a=0;a<d;a++)S[a]?(y("var "+w(a)+" = 0;"),y("h = "+b(a)+";"),y("while(h > "+w(a)+" + 1) {"),y(" m = 0.5 * (h + "+w(a)+") | 0;"),y(" if ("+m([a,"m"])+" > "+f(a)+") h = m;"),y(" else "+w(a)+" = m;"),y("}")):"closed"===c[a]?y(w(a)+" = ("+f(a)+" | 0) % "+b(a)+";"):(y(w(a)+" = ("+f(a)+" | 0);"),y("if ("+w(a)+" < "+u[a]+") "+w(a)+" = "+u[a]+";"),y("if ("+w(a)+" > "+b(a)+" - 1) "+w(a)+" = "+b(a)+" - 1;"));for(a=0,l=[];a<d;a++)l[a]=u[a]+1;_e(l,(function(e){for(var t=[],i=[],n=0;n<d;n++)t[n]=[w(n),e[n]-u[n]],"closed"===c[n]&&e[n]-u[n]<0&&(i[n]=b(n));for(n=0;n<d;n++)O(t[n],i[n])})),y("out.length = "+C+";"),y("return out;"),p.push("}"),n&&console.log(p.join("\n"));var P=new Function([p.join("\n"),"; return ",g].join(""))();return Re[e]=P,P.bind(t)};f().set("lib/nurbs/src/support",Ve);const Ie=Ve,Te=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Geometry/Triangle3");var xe=e.n(Te),je=[];const ze=function(e,t,i){i=i||{};var n=(e=e||{}).points=e.points||[],o=e.faces=e.faces||[],s=i.haveWeights,r=t.dimension-s;if(Array.isArray(i.resolution))var l=i.resolution;else{var a=void 0===i.resolution?31:i.resolution;l=new Array(t.splineDimension).fill(a)}switch(t.splineDimension){case 1:for(var u=(f=(b=l[0])+!(v="closed"===t.boundary[0]))*r,h=(N=(_=i.domain||t.domain)[0])[1]-N[0],d=0;d<f;++d){var c=N[0]+h*d/b,p=d*r;if(t.evaluate(je,c),s)for(var g=je[r],m=0;m<r;++m)n[p+m]=je[m]/g;else for(m=0;m<r;++m)n[p+m]=je[m]}n.length=u;break;case 2:var f,_,b=l[0],w=l[1],v="closed"===t.boundary[0],y=w+!(D="closed"===t.boundary[1]),N=(u=(f=b+!v)*y*r,(_=i.domain||t.domain)[0]),C=_[1],O=(h=N[1]-N[0],C[1]-C[0]);for(d=0;d<f;++d){c=N[0]+h*d/b;for(var S=0;S<y;++S){var P=C[0]+O*S/w;p=(d+f*S)*r;if(t.evaluate(je,c,P),s)for(g=je[r],m=0;m<r;++m)n[p+m]=je[m]/g;else for(m=0;m<r;++m)n[p+m]=je[m]}}n.length=u;v=i.closed[0];var D=i.closed[1],F=0;for(d=0;d<b;++d){var R=d,V=d+1;v&&(V%=b);for(S=0;S<w;++S){var I=S,T=S+1;D&&(T%=w),o[F++]=R+f*I,o[F++]=V+f*I,o[F++]=V+f*T,o[F++]=R+f*I,o[F++]=V+f*T,o[F++]=R+f*T}}o.length=F;break;default:throw new Error("Can only sample contours and surfaces")}return e};f().set("lib/nurbs/extras/sample",ze);const ke=ze;var Ae={open:"open",closed:"closed",clamped:"clamped"};function Be(e){return null==e}function Xe(e,t,i,n,o,s){var r,l;!e||Q(e)||J(e)?(s=s||{},this.weights=n,this.knots=i,this.degree=t,this.points=e,this.boundary=o,this.debug=s.debug,this.checkBounds=!!s.checkBounds,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0})):(s=e,this.debug=e.debug,this.checkBounds=!!e.checkBounds,this.weights=e.weights,this.knots=e.knots,this.degree=e.degree,this.boundary=e.boundary,this.points=e.points,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0}));var a=te(this.points),u=te(this.weights),h=te(this.knots);if(this.points)switch(a){case te.GENERIC_NDARRAY:case te.NDARRAY:Object.defineProperties(this,{splineDimension:{value:this.points.shape.length-1,writable:!1,configurable:!0},dimension:{value:this.points.shape[this.points.shape.length-1],writable:!1,configurable:!0},size:{get:function(){return this.points.shape.slice(0,this.points.shape.length-1)},set:function(){throw new Error("Cannot assign to read only property 'size'")},configurable:!0}});break;case te.ARRAY_OF_OBJECTS:case te.ARRAY_OF_ARRAYS:var d=0,c=this.size||[];c.length=0;for(var p=this.points;Q(p[0]);p=p[0])d++,c.push(p.length);if(0===d)throw new Error("Expected an array of points");Object.defineProperties(this,{splineDimension:{value:d,writable:!1,configurable:!0},dimension:{value:p.length,writable:!1,configurable:!0},size:{get:function(){var e=[];e.length=0;for(var t=0,i=this.points;t<this.splineDimension;t++,i=i[0])e[t]=i.length;return e},set:function(){throw new Error('Cannot assign to read only property "size"')},configurable:!0}});break;case te.PACKED:default:throw new Error("Expected either a packed array, array of arrays, or ndarray of points")}else{if(void 0===this.size||null===this.size)throw new Error("Either points or a control hull size must be provided.");if(Q(this.size)||Object.defineProperty(this,"size",{value:[this.size],writable:!0,configurable:!0}),0===this.size.length)throw new Error("`size` must be a number or an array of length at least one.");Object.defineProperties(this,{splineDimension:{value:this.size.length,writable:!1,configurable:!0},dimension:{value:0,writable:!1,configurable:!0}})}if(Q(this.degree)){for(r=0;r<this.splineDimension;r++)if(Be(this.degree[r]))throw new Error("Missing degree in dimension "+(r+1))}else{var g=!Be(this.degree),m=Be(this.degree)?2:this.degree;for(this.degree=[],r=0;r<this.splineDimension;r++)if(this.size[r]<=m){if(g)throw new Error("Expected at least "+(m+1)+" points for degree "+m+" spline in dimension "+(r+1)+" but got only "+this.size[r]);this.degree[r]=this.size[r]-1}else this.degree[r]=m}if(l="string"!=typeof this.boundary?"open":this.boundary,!Ae[l])throw new Error("Boundary type must be one of "+Object.keys(Ae)+". Got "+l);for(this.boundary=Q(this.boundary)?this.boundary:[],this.boundary.length=this.splineDimension,r=0;r<this.splineDimension;r++)if(this.boundary[r]=Be(this.boundary[r])?l:this.boundary[r],!Ae[l])throw new Error("Boundary type must be one of "+Object.keys(Ae)+". Got "+l+" for dimension "+(r+1));switch(h){case te.ARRAY_OF_ARRAYS:for(Q(this.knots)&&this.knots.length>0&&!Q(this.knots[0])&&(this.knots=[this.knots]),r=0;r<this.splineDimension;r++){if(this.size[r]<=this.degree[r])throw new Error("Expected at least "+(this.degree[r]+1)+" points in dimension "+(r+1)+" but got "+this.size[r]+".");if(Q(this.knots[r])){if("closed"!==this.boundary[r]&&this.knots[r].length!==this.degree[r]+this.size[r]+1)throw new Error("Expected "+(this.degree[r]+this.size[r]+1)+" knots in dimension "+(r+1)+" but got "+this.knots[r].length+".");if("closed"===this.boundary[r]&&this.knots[r].length!==this.size[r]+1&&!(this.knots[r].length===this.size[r]+this.degree[r]+1))throw new Error("Expected "+(this.size[r]+1)+" knots for closed spline in dimension "+(r+1)+" but got "+this.knots[r].length+".")}}case te.NDARRAY:}var f=ne(this,this.debug,this.checkBounds,a,u,h);if(f!==this.__cacheKey){this.__cacheKey=f;var _=de(this);this.evaluate=Se(this.__cacheKey,this,_,this.debug,this.checkBounds,!1),this.transform=Fe(this.__cacheKey,this,_,this.debug),this.support=Ie(this.__cacheKey,this,_,this.debug,this.checkBounds),this.evaluator=function(e,t){return Se(this.__cacheKey,this,_,this.debug,this.checkBounds,t,e)}}return this.numericalDerivative=me.bind(this),this}function Ee(){var e,t=[],i=this.points;i?Z(i)&&(e=i.shape):e=this.size;for(var n=0;n<this.splineDimension;n++){var o=e?e[n]:i.length,s=this.degree[n],r="closed"===this.boundary[n];if(this.knots&&this.knots[n]){var l=this.knots[n];t[n]=[l[r?0:s],l[o]]}else t[n]=[r?0:s,o];i&&(i=i[0])}return t}function Ue(e,t,i,n,o,s){var r=function(e,t,i,n,o,s){return l(e,t,i,n,o,s),r},l=Xe.bind(r);return Object.defineProperty(r,"domain",{get:Ee}),l(e,t,i,n,o,s),r}Ue.sample=ke;const qe=Ue;f().set("lib/nurbs/nurbs",qe);const Me=qe;function Ke(e){K.call(this,e),W().call(this,e),this.addType(c().NurbsCurve),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]}}Object.assign(Object.setPrototypeOf(Ke.prototype,K.prototype),W().prototype,{initialize(){K.prototype.initialize.call(this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},getTessellation(e){return U.getTessellation(this._tessellation.getValue(),e-this._order.getValue())},getClosed(e,t,i,n){return!!this._closed.getValue()&&U.getClosed(e,t,i,n)},getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),tessellate(){if(this._order.getValue()<2)return[];if(!this.controlPointNode)return[];if(this.controlPointNode.getSize()<this._order.getValue())return[];const e=this.getVertices(),t=[];if(e.length){const i=e.length;for(let n=0;n<i;n+=8)t.push(e[n],e[n+1],e[n+2]);t.push(e[i-4],e[i-3],e[i-2])}return t},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=(n.at(-1),n[0],this._order.getValue()-1),s=this.surface=(this.surface||Me)({boundary:["open"],degree:[o],knots:[n],points:i,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(n.length),this.sampleOptions.haveWeights=!!t;const r=Me.sample(this.mesh,s,this.sampleOptions).points,l=this.getVertices();for(let e=3,t=r.length;e<t;e+=3){const t=e-3;l.push(r[t],r[t+1],r[t+2],1),l.push(r[e],r[e+1],r[e+2],1)}},dispose(){K.prototype.dispose.call(this)}}),Object.defineProperties(Ke,{typeName:{value:"NurbsCurve",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"closed",new(o().SFBool)),new(r())(c().initializeOnly,"order",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode))]),enumerable:!0}});const Ge=Ke;f().set("x_ite/Components/NURBS/NurbsCurve",Ge);const We=Ge;function Ye(e){C.call(this,e),this.addType(c().NurbsCurve2D),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]},this.array=[]}Object.assign(Object.setPrototypeOf(Ye.prototype,C.prototype),{getTessellation(e){return U.getTessellation(this._tessellation.getValue(),e-this._order.getValue())},getClosed(e,t,i,n){return!!this._closed.getValue()&&U.getClosed2D(e,t,i,n)},getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints2D(e,t,i,n,o),tessellate(e){const t=this.array;if(t.length=0,this._order.getValue()<2)return t;if(this._controlPoint.length<this._order.getValue())return t;const i=this.getClosed(this._order.getValue(),this._knot,this._weight,this._controlPoint),n=this.getWeights(this.weights,this._controlPoint.length,this._weight),o=this.getControlPoints(this.controlPoints,i,this._order.getValue(),n,this._controlPoint),s=this.getKnots(this.knots,i,this._order.getValue(),this._controlPoint.length,this._knot),r=(s.at(-1),s[0],this._order.getValue()-1),l=this.surface=(this.surface||Me)({boundary:["open"],degree:[r],knots:[s],points:o,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(s.length),this.sampleOptions.haveWeights=!!n;const a=Me.sample(this.mesh,l,this.sampleOptions).points;switch(e){case 0:for(let e=0,i=a.length;e<i;e+=2)t.push(a[e],a[e+1]);break;case 1:for(let e=0,i=a.length;e<i;e+=2)t.push(a[e],0,a[e+1]);break;case 2:for(let e=0,i=a.length;e<i;e+=2)t.push(new(S())(a[e],a[e+1],0))}return t}}),Object.defineProperties(Ye,{typeName:{value:"NurbsCurve2D",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"closed",new(o().SFBool)),new(r())(c().initializeOnly,"order",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),enumerable:!0}});const Je=Ye;f().set("x_ite/Components/NURBS/NurbsCurve2D",Je);const Le=Je,Ze=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Core/X3DChildNode");var He=e.n(Ze);const Qe=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Interpolation/OrientationInterpolator");var $e=e.n(Qe);const et=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Numbers/Rotation4");var tt=e.n(et);function it(e){He().call(this,e),this.addType(c().NurbsOrientationInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new($e())(e),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}Object.assign(Object.setPrototypeOf(it.prototype,He().prototype),{initialize(){He().prototype.initialize.call(this),this._order.addInterest("requestRebuild",this),this._knot.addInterest("requestRebuild",this),this._weight.addInterest("requestRebuild",this),this._controlPoint.addInterest("set_controlPoint__",this),this._rebuild.addInterest("build",this),this._set_fraction.addFieldInterest(this.interpolator._set_fraction),this.interpolator._value_changed.addFieldInterest(this._value_changed),this.interpolator.setup(),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:(e,t,i,n)=>!1,getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),requestRebuild(){this._rebuild.addEvent()},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=n.at(-1)-n[0],s=this._order.getValue()-1,r=this.surface=(this.surface||Me)({boundary:["open"],degree:[s],knots:[n],points:i,debug:!1});this.sampleOptions.haveWeights=!!t;const l=Me.sample(this.mesh,r,this.sampleOptions).points,a=this.interpolator;a._key.length=0,a._keyValue.length=0;for(let t=0,i=l.length-3;t<i;t+=3){const s=new(S())(l[t+3]-l[t+0],l[t+4]-l[t+1],l[t+5]-l[t+2]);a._key.push(n[0]+t/(i-3+3*e)*o),a._keyValue.push(new(tt())(S().zAxis,s))}e&&(a._key.push(n[0]+o),a._keyValue.push(a._keyValue[0]))}}),Object.defineProperties(it,{typeName:{value:"NurbsOrientationInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFFloat)),new(r())(c().inputOutput,"order",new(o().SFInt32)(3)),new(r())(c().inputOutput,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"value_changed",new(o().SFRotation))]),enumerable:!0}});const nt=it;f().set("x_ite/Components/NURBS/NurbsOrientationInterpolator",nt);const ot=nt,st=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Algorithm");var rt=e.n(st);function lt(e){K.call(this,e),this.addType(c().X3DNurbsSurfaceGeometryNode),this.tessellationScale=1,this.uKnots=[],this.vKnots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[],closed:[]},this.textUKnots=[],this.textVKnots=[],this.textWeights=[],this.texControlPoints=[],this.texMesh={}}Object.assign(Object.setPrototypeOf(lt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._texCoord.addInterest("set_texCoord__",this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_texCoord__(),this.set_controlPoint__()},set_texCoord__(){this.texCoordNode?.removeInterest("requestRebuild",this),this.nurbsTexCoordNode?.removeInterest("requestRebuild",this),this.texCoordNode=g()(c().X3DTextureCoordinateNode,this._texCoord),this.nurbsTexCoordNode=g()(c().NurbsTextureCoordinate,this._texCoord),this.texCoordNode?.addInterest("requestRebuild",this),this.nurbsTexCoordNode?.addInterest("requestRebuild",this)},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},setTessellationScale(e){this.tessellationScale=e,this.requestRebuild()},getUTessellation(e){return Math.floor(U.getTessellation(this._uTessellation.getValue(),e-this._uOrder.getValue())*this.tessellationScale)},getVTessellation(e){return Math.floor(U.getTessellation(this._vTessellation.getValue(),e-this._vOrder.getValue())*this.tessellationScale)},getUClosed(e,t,i,n,o,s){return!!this._uClosed.getValue()&&U.getUClosed(e,t,i,n,o,s)},getVClosed(e,t,i,n,o,s){return!!this._vClosed.getValue()&&U.getVClosed(e,t,i,n,o,s)},getUVWeights:(e,t,i,n)=>U.getUVWeights(e,t,i,n),getTexControlPoints:(e,t,i,n,o,s,r,l)=>U.getTexControlPoints(e,t,i,n,o,s,r,l),getUVControlPoints:(e,t,i,n,o,s,r,l,a)=>U.getUVControlPoints(e,t,i,n,o,s,r,l,a),getTrimmingContours(){},build(){if(this._uOrder.getValue()<2)return;if(this._vOrder.getValue()<2)return;if(this._uDimension.getValue()<this._uOrder.getValue())return;if(this._vDimension.getValue()<this._vOrder.getValue())return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()!==this._uDimension.getValue()*this._vDimension.getValue())return;const e=this.getUClosed(this._uOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._uKnot,this._weight,this.controlPointNode),t=this.getVClosed(this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._vKnot,this._weight,this.controlPointNode),i=this.getUVWeights(this.weights,this._uDimension.getValue(),this._vDimension.getValue(),this._weight),n=this.getUVControlPoints(this.controlPoints,e,t,this._uOrder.getValue(),this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),i,this.controlPointNode),o=this.getKnots(this.uKnots,e,this._uOrder.getValue(),this._uDimension.getValue(),this._uKnot),s=this.getKnots(this.vKnots,t,this._vOrder.getValue(),this._vDimension.getValue(),this._vKnot),r=(o.at(-1),o[0],s.at(-1),s[0],this._uOrder.getValue()-1),l=this._vOrder.getValue()-1,a=this.surface=(this.surface||Me)({boundary:["open","open"],degree:[r,l],knots:[o,s],points:n,debug:!1}),u=this.sampleOptions;u.resolution[0]=this.getUTessellation(o.length),u.resolution[1]=this.getVTessellation(s.length),u.closed[0]=e,u.closed[1]=t,u.domain=void 0,u.haveWeights=!!i,u.trimmingContours=this.getTrimmingContours();const h=Me.sample(this.mesh,a,u),d=h.faces,c=h.points,p=this.getVertices();for(let e=0,t=d.length;e<t;++e){const t=3*d[e];p.push(c[t],c[t+1],c[t+2],1)}this.buildNurbsTexCoords(e,t,this._uOrder.getValue(),this._vOrder.getValue(),o,s,this._uDimension.getValue(),this._vDimension.getValue(),a.domain),this.buildNormals(d,c),this.setSolid(this._solid.getValue()),this.setCCW(!0)},buildNurbsTexCoords:(()=>{const e=[],t=[],i=[[[0,0,0,1],[0,1,0,1]],[[1,0,0,1],[1,1,0,1]]];function n(e,t){return e[0]=e[1]=t[0],e[2]=e[3]=t.at(-1),e}return function(o,s,r,l,a,u,h,d,c){const p=this.sampleOptions;if(this.texCoordNode&&this.texCoordNode.getSize()===h*d)var g=r-1,m=l-1,f=a,_=u,b=this.getTexControlPoints(this.texControlPoints,o,s,r,l,h,d,this.texCoordNode);else if(this.nurbsTexCoordNode&&this.nurbsTexCoordNode.isValid()){var w=this.nurbsTexCoordNode,v=(g=w._uOrder.getValue()-1,m=w._vOrder.getValue()-1,f=this.getKnots(this.texUKnots,!1,w._uOrder.getValue(),w._uDimension.getValue(),w._uKnot),_=this.getKnots(this.texVKnots,!1,w._vOrder.getValue(),w._vDimension.getValue(),w._vKnot),this.getUVWeights(this.texWeights,w._uDimension.getValue(),w._vDimension.getValue(),w._weight));b=w.getControlPoints(v)}else{g=1,m=1,f=n(e,a),_=n(t,u),b=i;p.domain=c}const y=this.texSurface=(this.texSurface||Me)({boundary:["open","open"],degree:[g,m],knots:[f,_],points:b});p.closed[0]=!1,p.closed[1]=!1,p.haveWeights=!1;const N=Me.sample(this.texMesh,y,p),C=N.faces,O=N.points,S=this.getTexCoords();for(let e=0,t=C.length;e<t;++e){const t=4*C[e];S.push(O[t],O[t+1],O[t+2],O[t+3])}this.getMultiTexCoords().push(this.getTexCoords())}})(),buildNormals(e,t){const i=this.createNormals(e,t),n=this.getNormals();for(const e of i)n.push(e.x,e.y,e.z)},createNormals(e,t){const i=new Map,n=this.createFaceNormals(e,t),o=e.length;for(let t=0;t<o;++t){const n=e[t];let o=i.get(n);o||i.set(n,o=[]),o.push(t)}return this.refineNormals(i,n,rt().radians(85))},createFaceNormals:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0),i=new(S())(0,0,0);return function(n,o){const s=this.faceNormals||[],r=n.length;for(let l=0;l<r;l+=3){const r=3*n[l],a=3*n[l+1],u=3*n[l+2];e.set(o[r],o[r+1],o[r+2]),t.set(o[a],o[a+1],o[a+2]),i.set(o[u],o[u+1],o[u+2]);const h=xe().normal(e,t,i,s[l]||new(S())(0,0,0));s[l]=h,s[l+1]=h,s[l+2]=h}return s.length=r,s}})()}),Object.defineProperties(lt,{typeName:{value:"X3DNurbsSurfaceGeometryNode",enumerable:!0},componentName:{value:"NURBS",enumerable:!0}});const at=lt;f().set("x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode",at);const ut=at;function ht(e){ut.call(this,e),this.addType(c().NurbsPatchSurface)}Object.setPrototypeOf(ht.prototype,ut.prototype),Object.defineProperties(ht,{typeName:{value:"NurbsPatchSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"uClosed",new(o().SFBool)),new(r())(c().initializeOnly,"vClosed",new(o().SFBool)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"texCoord",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode))]),enumerable:!0}});const dt=ht;f().set("x_ite/Components/NURBS/NurbsPatchSurface",dt);const ct=dt,pt=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Interpolation/PositionInterpolator");var gt=e.n(pt);function mt(e){He().call(this,e),this.addType(c().NurbsPositionInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new(gt())(e),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}Object.assign(Object.setPrototypeOf(mt.prototype,He().prototype),{initialize(){He().prototype.initialize.call(this),this._order.addInterest("requestRebuild",this),this._knot.addInterest("requestRebuild",this),this._weight.addInterest("requestRebuild",this),this._controlPoint.addInterest("set_controlPoint__",this),this._rebuild.addInterest("build",this),this._set_fraction.addFieldInterest(this.interpolator._set_fraction),this.interpolator._value_changed.addFieldInterest(this._value_changed),this.interpolator.setup(),this.set_controlPoint__()},set_controlPoint__(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=g()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:(e,t,i,n)=>!1,getKnots:(e,t,i,n,o)=>U.getKnots(e,t,i,n,o),getWeights:(e,t,i)=>U.getWeights(e,t,i),getControlPoints:(e,t,i,n,o)=>U.getControlPoints(e,t,i,n,o),requestRebuild(){this._rebuild.addEvent()},build(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const e=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),t=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),i=this.getControlPoints(this.controlPoints,e,this._order.getValue(),t,this.controlPointNode),n=this.getKnots(this.knots,e,this._order.getValue(),this.controlPointNode.getSize(),this._knot),s=n.at(-1)-n[0],r=this._order.getValue()-1,l=this.surface=(this.surface||Me)({boundary:["open"],degree:[r],knots:[n],points:i,debug:!1});this.sampleOptions.haveWeights=!!t;const a=Me.sample(this.mesh,l,this.sampleOptions).points,u=this.interpolator;u._key.length=0,u._keyValue.length=0;for(let e=0,t=a.length;e<t;e+=3)u._key.push(n[0]+e/(t-3)*s),u._keyValue.push(new(o().SFVec3f)(a[e],a[e+1],a[e+2]))}}),Object.defineProperties(mt,{typeName:{value:"NurbsPositionInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFFloat)),new(r())(c().inputOutput,"order",new(o().SFInt32)(3)),new(r())(c().inputOutput,"knot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"value_changed",new(o().SFVec3f))]),enumerable:!0}});const ft=mt;f().set("x_ite/Components/NURBS/NurbsPositionInterpolator",ft);const _t=ft,bt=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Grouping/X3DBoundedObject");var wt=e.n(bt);function vt(e){He().call(this,e),wt().call(this,e),this.addType(c().NurbsSet),this.geometryNodes=[]}function yt(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(vt.prototype,He().prototype),wt().prototype,{initialize(){He().prototype.initialize.call(this),wt().prototype.initialize.call(this),this._tessellationScale.addInterest("set_tessellationScale__",this),this._addGeometry.addInterest("set_addGeometry__",this),this._removeGeometry.addInterest("set_removeGeometry__",this),this._geometry.addInterest("set_geometry__",this),this.set_geometry__()},getBBox(e,t){for(const t of this.geometryNodes)e.add(t.getBBox());return e},set_tessellationScale__(){const e=Math.max(0,this._tessellationScale.getValue());for(const t of this.geometryNodes)t.setTessellationScale(e)},set_addGeometry__(){this._addGeometry.setTainted(!0),this._addGeometry.assign(yt(this._addGeometry,this._geometry));for(const e of this._addGeometry)this._geometry.push(e);this._addGeometry.length=0,this._addGeometry.setTainted(!1)},set_removeGeometry__(){this._removeGeometry.setTainted(!0),this._geometry.assign(yt(this._geometry,this._removeGeometry)),this._removeGeometry.length=0,this._removeGeometry.setTainted(!1)},set_geometry__(){for(const e of this.geometryNodes)e.setTessellationScale(1);this.geometryNodes.length=0;for(const e of this._geometry){const t=g()(c().X3DNurbsSurfaceGeometryNode,e);t&&this.geometryNodes.push(t)}this.set_tessellationScale__()},dispose(){wt().prototype.dispose.call(this),He().prototype.dispose.call(this)}}),Object.defineProperties(vt,{typeName:{value:"NurbsSet",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"tessellationScale",new(o().SFFloat)(1)),new(r())(c().inputOutput,"visible",new(o().SFBool)(!0)),new(r())(c().inputOutput,"bboxDisplay",new(o().SFBool)),new(r())(c().initializeOnly,"bboxSize",new(o().SFVec3f)(-1,-1,-1)),new(r())(c().initializeOnly,"bboxCenter",new(o().SFVec3f)),new(r())(c().inputOnly,"addGeometry",new(o().MFNode)),new(r())(c().inputOnly,"removeGeometry",new(o().MFNode)),new(r())(c().inputOutput,"geometry",new(o().MFNode))]),enumerable:!0}});const Nt=vt;f().set("x_ite/Components/NURBS/NurbsSet",Nt);const Ct=Nt,Ot=window[Symbol.for("X_ITE.X3D-8.9.6")].require("standard/Math/Geometry/Line3");var St=e.n(Ot);const Pt={isPointInTriangle(e,t,i,n){const o=(t.y-i.y)*(e.x-i.x)+(i.x-t.x)*(e.y-i.y);if(0==o)return!1;const s=((t.y-i.y)*(n.x-i.x)+(i.x-t.x)*(n.y-i.y))/o;if(s<0||s>1)return!1;const r=((i.y-e.y)*(n.x-i.x)+(e.x-i.x)*(n.y-i.y))/o;if(r<0||r>1)return!1;const l=1-s-r;return!(l<0||l>1)}};f().set("standard/Math/Geometry/Triangle2",Pt);const Dt=Pt;function Ft(e){He().call(this,e),this.addType(c().NurbsSurfaceInterpolator),this.geometry=new ct(e)}Object.assign(Object.setPrototypeOf(Ft.prototype,He().prototype),{initialize(){this._set_fraction.addInterest("set_fraction__",this),this._uOrder.addFieldInterest(this.geometry._uOrder),this._vOrder.addFieldInterest(this.geometry._vOrder),this._uDimension.addFieldInterest(this.geometry._uDimension),this._vDimension.addFieldInterest(this.geometry._vDimension),this._uKnot.addFieldInterest(this.geometry._uKnot),this._vKnot.addFieldInterest(this.geometry._vKnot),this._weight.addFieldInterest(this.geometry._weight),this._controlPoint.addFieldInterest(this.geometry._controlPoint),this.geometry._uTessellation=128,this.geometry._vTessellation=128,this.geometry._uOrder=this._uOrder,this.geometry._vOrder=this._vOrder,this.geometry._uDimension=this._uDimension,this.geometry._vDimension=this._vDimension,this.geometry._uKnot=this._uKnot,this.geometry._vKnot=this._vKnot,this.geometry._weight=this._weight,this.geometry._controlPoint=this._controlPoint,this.geometry.setup()},set_fraction__:(()=>{const e=new(S())(0,0,0),t=new(S())(0,0,0),i=new(S())(0,0,0),n=new(S())(0,0,0),o=new(St())(S().Zero,S().zAxis),s={};return function(){const r=this._set_fraction.getValue(),l=this.geometry.getTexCoords(),a=this.geometry.getNormals(),u=this.geometry.getVertices();for(let h=0,d=0,c=l.length;h<c;h+=12,d+=9)if(e.set(l[h+0],l[h+1],0),t.set(l[h+4],l[h+5],0),i.set(l[h+7],l[h+9],0),Dt.isPointInTriangle(e,t,i,r)&&(o.set(n.set(r.x,r.y,0),S().zAxis),o.intersectsTriangle(e,t,i,s))){const e=s.u,t=s.v,i=s.t,n=new(S())(i*a[d+0]+e*a[d+3]+t*a[d+6],i*a[d+1]+e*a[d+4]+t*a[d+7],i*a[d+2]+e*a[d+5]+t*a[d+8]),o=new(S())(i*u[h+0]+e*u[h+4]+t*u[h+8],i*u[h+1]+e*u[h+5]+t*u[h+9],i*u[h+2]+e*u[h+6]+t*u[h+10]);this._normal_changed=n,this._position_changed=o}}})()}),Object.defineProperties(Ft,{typeName:{value:"NurbsSurfaceInterpolator",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"children",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOnly,"set_fraction",new(o().SFVec2f)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().outputOnly,"normal_changed",new(o().SFVec3f)),new(r())(c().outputOnly,"position_changed",new(o().SFVec3f))]),enumerable:!0}});const Rt=Ft;f().set("x_ite/Components/NURBS/NurbsSurfaceInterpolator",Rt);const Vt=Rt,It=window[Symbol.for("X_ITE.X3D-8.9.6")].require("x_ite/Components/Geometry3D/Extrusion");var Tt=e.n(It);function xt(e){K.call(this,e),this.addType(c().NurbsSweptSurface),this.extrusion=new(Tt())(e)}Object.assign(Object.setPrototypeOf(xt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._crossSectionCurve.addInterest("set_crossSectionCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const e=this.extrusion;e._beginCap=!1,e._endCap=!1,e._solid=!0,e._ccw=!0,e._convex=!0,e._creaseAngle=Math.PI,e.setup(),e._crossSection.setTainted(!0),e._spine.setTainted(!0),this.set_crossSectionCurve__(),this.set_trajectoryCurve__()},set_crossSectionCurve__(){this.crossSectionCurveNode&&this.crossSectionCurveNode.removeInterest("requestRebuild",this),this.crossSectionCurveNode=g()(c().X3DNurbsControlCurveNode,this._crossSectionCurve),this.crossSectionCurveNode&&this.crossSectionCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__(){this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.removeInterest("requestRebuild",this),this.trajectoryCurveNode=g()(c().NurbsCurve,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.addInterest("requestRebuild",this)},build(){if(!this.crossSectionCurveNode)return;if(!this.trajectoryCurveNode)return;const e=this.extrusion;if(e._crossSection=this.crossSectionCurveNode.tessellate(0),e._spine=this.trajectoryCurveNode.tessellate(0),e.rebuild(),this.getColors().assign(e.getColors()),this.getTexCoords().assign(e.getTexCoords()),this.getNormals().assign(e.getNormals()),this.getVertices().assign(e.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const e=this.getNormals();for(let t=0,i=e.length;t<i;++t)e[t]=-e[t]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}}),Object.defineProperties(xt,{typeName:{value:"NurbsSweptSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"ccw",new(o().SFBool)(!0)),new(r())(c().inputOutput,"crossSectionCurve",new(o().SFNode)),new(r())(c().inputOutput,"trajectoryCurve",new(o().SFNode))]),enumerable:!0}});const jt=xt;f().set("x_ite/Components/NURBS/NurbsSweptSurface",jt);const zt=jt;function kt(e){K.call(this,e),this.addType(c().NurbsSwungSurface),this.extrusion=new(Tt())(e)}Object.assign(Object.setPrototypeOf(kt.prototype,K.prototype),{initialize(){K.prototype.initialize.call(this),this._profileCurve.addInterest("set_profileCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const e=this.extrusion;e._beginCap=!1,e._endCap=!1,e._solid=!0,e._ccw=!0,e._convex=!0,e._creaseAngle=Math.PI,e.setup(),e._crossSection.setTainted(!0),e._spine.setTainted(!0),this.set_profileCurve__(),this.set_trajectoryCurve__()},set_profileCurve__(){this.profileCurveNode&&this.profileCurveNode.removeInterest("requestRebuild",this),this.profileCurveNode=g()(c().X3DNurbsControlCurveNode,this._profileCurve),this.profileCurveNode&&this.profileCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__(){this.trajectoryCurveNode&&this.trajectoryCurveNode.removeInterest("requestRebuild",this),this.trajectoryCurveNode=g()(c().X3DNurbsControlCurveNode,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode.addInterest("requestRebuild",this)},build(){if(!this.profileCurveNode)return;if(!this.trajectoryCurveNode)return;const e=this.extrusion;if(e._crossSection=this.profileCurveNode.tessellate(0),e._spine=this.trajectoryCurveNode.tessellate(1),e.rebuild(),this.getColors().assign(e.getColors()),this.getTexCoords().assign(e.getTexCoords()),this.getNormals().assign(e.getNormals()),this.getVertices().assign(e.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const e=this.getNormals();for(let t=0,i=e.length;t<i;++t)e[t]=-e[t]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}}),Object.defineProperties(kt,{typeName:{value:"NurbsSwungSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"ccw",new(o().SFBool)(!0)),new(r())(c().inputOutput,"profileCurve",new(o().SFNode)),new(r())(c().inputOutput,"trajectoryCurve",new(o().SFNode))]),enumerable:!0}});const At=kt;f().set("x_ite/Components/NURBS/NurbsSwungSurface",At);const Bt=At;function Xt(e){h().call(this,e),this.addType(c().NurbsTextureCoordinate),this.controlPoints=[]}Object.assign(Object.setPrototypeOf(Xt.prototype,h().prototype),{initialize(){h().prototype.initialize.call(this)},getControlPoints(e){const t=this._controlPoint.getValue(),i=this.controlPoints;for(let n=0,o=this._uDimension.getValue();n<o;++n){let s=i[n];s||(s=i[n]=[]);for(let i=0,r=this._vDimension.getValue();i<r;++i){const r=i*o+n,l=s[i]||new(X()),a=2*r;s[i]=l.set(t[a],t[a+1],0,e?e[r]:1)}}return i},isValid(){return!(this._uOrder.getValue()<2)&&(!(this._vOrder.getValue()<2)&&(!(this._uDimension.getValue()<this._uOrder.getValue())&&(!(this._vDimension.getValue()<this._vOrder.getValue())&&this._controlPoint.length===this._uDimension.getValue()*this._vDimension.getValue())))}}),Object.defineProperties(Xt,{typeName:{value:"NurbsTextureCoordinate",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"texCoord",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2f))]),enumerable:!0}});const Et=Xt;f().set("x_ite/Components/NURBS/NurbsTextureCoordinate",Et);const Ut=Et;function qt(e){ut.call(this,e),this.addType(c().NurbsTrimmedSurface),this.trimmingContourNodes=[]}function Mt(e,t){const i=new Set(t);return e.filter((e=>!i.has(e)))}Object.assign(Object.setPrototypeOf(qt.prototype,ut.prototype),{initialize(){ut.prototype.initialize.call(this),this._addTrimmingContour.addInterest("set_addTrimmingContour__",this),this._removeTrimmingContour.addInterest("set_removeTrimmingContour__",this),this._trimmingContour.addInterest("set_trimmingContour__",this),this.set_trimmingContour__()},set_addTrimmingContour__(){this._addTrimmingContour.setTainted(!0),this._addTrimmingContour.assign(Mt(this._addTrimmingContour,this._trimmingContour),this._addTrimmingContour.length);for(const e of this._addTrimmingContour)this._trimmingContour.push(e);this._addTrimmingContour.length=0,this._addTrimmingContour.setTainted(!1)},set_removeTrimmingContour__(){this._removeTrimmingContour.setTainted(!0),this._trimmingContour.assign(Mt(this._trimmingContour,this._removeTrimmingContour)),this._removeTrimmingContour.length=0,this._removeTrimmingContour.setTainted(!1)},set_trimmingContour__(){const e=this.trimmingContourNodes;e.length=0;for(const t of this._trimmingContour){const i=g()(c().Contour2D,t);i&&e.push(i)}},getTrimmingContours(){const e=this.trimmingContourNodes,t=[];for(const i of e)i.addTrimmingContour(t);return t}}),Object.defineProperties(qt,{typeName:{value:"NurbsTrimmedSurface",enumerable:!0},componentName:{value:"NURBS",enumerable:!0},containerField:{value:"geometry",enumerable:!0},specificationRange:{value:Object.freeze(["3.0","Infinity"]),enumerable:!0},fieldDefinitions:{value:new(a())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().initializeOnly,"uClosed",new(o().SFBool)),new(r())(c().initializeOnly,"vClosed",new(o().SFBool)),new(r())(c().initializeOnly,"uOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"vOrder",new(o().SFInt32)(3)),new(r())(c().initializeOnly,"uDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"vDimension",new(o().SFInt32)),new(r())(c().initializeOnly,"uKnot",new(o().MFDouble)),new(r())(c().initializeOnly,"vKnot",new(o().MFDouble)),new(r())(c().inputOutput,"weight",new(o().MFDouble)),new(r())(c().inputOutput,"texCoord",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().SFNode)),new(r())(c().inputOnly,"addTrimmingContour",new(o().MFNode)),new(r())(c().inputOnly,"removeTrimmingContour",new(o().MFNode)),new(r())(c().inputOutput,"trimmingContour",new(o().MFNode))]),enumerable:!0}});const Kt=qt;f().set("x_ite/Components/NURBS/NurbsTrimmedSurface",Kt);const Gt=Kt;i().add({name:"NURBS",concreteNodes:[v,F,x,We,Le,ot,ct,_t,Ct,Vt,zt,Bt,Ut,Gt],abstractNodes:[C,ut,K]});const Wt=void 0;f().set("assets/components/NURBS",Wt)})();
|