x_ite 8.6.6 → 8.6.7
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/Makefile +1 -0
- 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 +26 -26
- 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 +18 -18
- 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 +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- 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 +34 -34
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- 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/assets/lib/draco_decoder_gltf.js +29 -0
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +2299 -2123
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/laboratory/x3d-file-converter.md +3 -0
- package/docs/_tabs/laboratory.md +2 -2
- package/docs/laboratory/gltf-sample-viewer.html +72 -3
- package/package.json +2 -2
- package/src/assets/lib/draco_decoder_gltf.js +29 -0
- package/src/assets/shaders/webgl1/include/Particle.glsl.js +7 -0
- package/src/assets/shaders/webgl1/include/Vertex.glsl.js +3 -2
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +18 -5
- package/src/standard/Utility/ObjectCache.js +9 -10
- package/src/x_ite/Browser/Networking/URLs.js +4 -0
- package/src/x_ite/Browser/Picking/X3DPickingContext.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +1 -1
- package/src/x_ite/Browser/Shaders/Shaders.js +2 -0
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +7 -0
- package/src/x_ite/Browser/X3DBrowserContext.js +3 -3
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +1 -1
- package/src/x_ite/Components/Interpolation/SquadOrientationInterpolator.js +6 -7
- package/src/x_ite/Components/Layering/X3DLayerNode.js +1 -3
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +1 -1
- package/src/x_ite/Components/Shape/Material.js +23 -24
- package/src/x_ite/Components/Shape/PhysicalMaterial.js +0 -1
- package/src/x_ite/Components/Shape/UnlitMaterial.js +0 -1
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +10 -12
- package/src/x_ite/Components/Texturing/ImageTexture.js +4 -17
- package/src/x_ite/Components/Texturing/MovieTexture.js +4 -5
- package/src/x_ite/Parser/GLTF2Parser.js +194 -36
- package/src/x_ite/Parser/SVGParser.js +5 -2
- package/src/x_ite/Rendering/X3DRenderObject.js +3 -4
- package/webpack.config.js +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE v8.6.
|
|
1
|
+
/* X_ITE v8.6.7 */(() => { // 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.6.
|
|
42
|
+
const Components_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
45
|
+
const Fields_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
48
|
+
const X3DFieldDefinition_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
51
|
+
const FieldDefinitionArray_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
54
|
+
const X3DNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
57
|
+
const X3DConstants_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
60
|
+
const X3DCast_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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.6.
|
|
63
|
+
const Namespace_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .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
|
/*******************************************************************************
|
|
@@ -302,7 +302,7 @@ const X3DNurbsControlCurveNode_default_ = X3DNurbsControlCurveNode;
|
|
|
302
302
|
Namespace_default().set ("x_ite/Components/NURBS/X3DNurbsControlCurveNode", X3DNurbsControlCurveNode_default_);
|
|
303
303
|
/* harmony default export */ const NURBS_X3DNurbsControlCurveNode = (X3DNurbsControlCurveNode_default_);
|
|
304
304
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector3\")"
|
|
305
|
-
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
305
|
+
const Vector3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Numbers/Vector3");
|
|
306
306
|
var Vector3_default = /*#__PURE__*/__webpack_require__.n(Vector3_namespaceObject);
|
|
307
307
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/ContourPolyline2D.js
|
|
308
308
|
/*******************************************************************************
|
|
@@ -460,7 +460,7 @@ const ContourPolyline2D_default_ = ContourPolyline2D;
|
|
|
460
460
|
Namespace_default().set ("x_ite/Components/NURBS/ContourPolyline2D", ContourPolyline2D_default_);
|
|
461
461
|
/* harmony default export */ const NURBS_ContourPolyline2D = (ContourPolyline2D_default_);
|
|
462
462
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DCoordinateNode\")"
|
|
463
|
-
const X3DCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
463
|
+
const X3DCoordinateNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Rendering/X3DCoordinateNode");
|
|
464
464
|
var X3DCoordinateNode_default = /*#__PURE__*/__webpack_require__.n(X3DCoordinateNode_namespaceObject);
|
|
465
465
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/CoordinateDouble.js
|
|
466
466
|
/*******************************************************************************
|
|
@@ -550,13 +550,13 @@ const CoordinateDouble_default_ = CoordinateDouble;
|
|
|
550
550
|
Namespace_default().set ("x_ite/Components/NURBS/CoordinateDouble", CoordinateDouble_default_);
|
|
551
551
|
/* harmony default export */ const NURBS_CoordinateDouble = (CoordinateDouble_default_);
|
|
552
552
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DGeometryNode\")"
|
|
553
|
-
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
553
|
+
const X3DGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Rendering/X3DGeometryNode");
|
|
554
554
|
var X3DGeometryNode_default = /*#__PURE__*/__webpack_require__.n(X3DGeometryNode_namespaceObject);
|
|
555
555
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector2\")"
|
|
556
|
-
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
556
|
+
const Vector2_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Numbers/Vector2");
|
|
557
557
|
var Vector2_default = /*#__PURE__*/__webpack_require__.n(Vector2_namespaceObject);
|
|
558
558
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Vector4\")"
|
|
559
|
-
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
559
|
+
const Vector4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Numbers/Vector4");
|
|
560
560
|
var Vector4_default = /*#__PURE__*/__webpack_require__.n(Vector4_namespaceObject);
|
|
561
561
|
;// CONCATENATED MODULE: ./src/x_ite/Browser/NURBS/NURBS.js
|
|
562
562
|
/*******************************************************************************
|
|
@@ -1108,7 +1108,7 @@ const X3DParametricGeometryNode_default_ = X3DParametricGeometryNode;
|
|
|
1108
1108
|
Namespace_default().set ("x_ite/Components/NURBS/X3DParametricGeometryNode", X3DParametricGeometryNode_default_);
|
|
1109
1109
|
/* harmony default export */ const NURBS_X3DParametricGeometryNode = (X3DParametricGeometryNode_default_);
|
|
1110
1110
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Rendering/X3DLineGeometryNode\")"
|
|
1111
|
-
const X3DLineGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
1111
|
+
const X3DLineGeometryNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Rendering/X3DLineGeometryNode");
|
|
1112
1112
|
var X3DLineGeometryNode_default = /*#__PURE__*/__webpack_require__.n(X3DLineGeometryNode_namespaceObject);
|
|
1113
1113
|
;// CONCATENATED MODULE: ./src/lib/nurbs/src/utils/is-ndarray.js
|
|
1114
1114
|
|
|
@@ -2160,7 +2160,7 @@ const support_default_ = function (cacheKey, nurbs, accessors, debug, checkBound
|
|
|
2160
2160
|
Namespace_default().set ("lib/nurbs/src/support", support_default_);
|
|
2161
2161
|
/* harmony default export */ const support = (support_default_);
|
|
2162
2162
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Triangle3\")"
|
|
2163
|
-
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
2163
|
+
const Triangle3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Geometry/Triangle3");
|
|
2164
2164
|
var Triangle3_default = /*#__PURE__*/__webpack_require__.n(Triangle3_namespaceObject);
|
|
2165
2165
|
;// CONCATENATED MODULE: ./src/lib/nurbs/extras/sample.js
|
|
2166
2166
|
|
|
@@ -3157,13 +3157,13 @@ const NurbsCurve2D_default_ = NurbsCurve2D;
|
|
|
3157
3157
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsCurve2D", NurbsCurve2D_default_);
|
|
3158
3158
|
/* harmony default export */ const NURBS_NurbsCurve2D = (NurbsCurve2D_default_);
|
|
3159
3159
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Core/X3DChildNode\")"
|
|
3160
|
-
const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
3160
|
+
const X3DChildNode_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Core/X3DChildNode");
|
|
3161
3161
|
var X3DChildNode_default = /*#__PURE__*/__webpack_require__.n(X3DChildNode_namespaceObject);
|
|
3162
3162
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/OrientationInterpolator\")"
|
|
3163
|
-
const OrientationInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
3163
|
+
const OrientationInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Interpolation/OrientationInterpolator");
|
|
3164
3164
|
var OrientationInterpolator_default = /*#__PURE__*/__webpack_require__.n(OrientationInterpolator_namespaceObject);
|
|
3165
3165
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Numbers/Rotation4\")"
|
|
3166
|
-
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
3166
|
+
const Rotation4_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Numbers/Rotation4");
|
|
3167
3167
|
var Rotation4_default = /*#__PURE__*/__webpack_require__.n(Rotation4_namespaceObject);
|
|
3168
3168
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js
|
|
3169
3169
|
/*******************************************************************************
|
|
@@ -3385,7 +3385,7 @@ const NurbsOrientationInterpolator_default_ = NurbsOrientationInterpolator;
|
|
|
3385
3385
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsOrientationInterpolator", NurbsOrientationInterpolator_default_);
|
|
3386
3386
|
/* harmony default export */ const NURBS_NurbsOrientationInterpolator = (NurbsOrientationInterpolator_default_);
|
|
3387
3387
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Algorithm\")"
|
|
3388
|
-
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
3388
|
+
const Algorithm_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Algorithm");
|
|
3389
3389
|
var Algorithm_default = /*#__PURE__*/__webpack_require__.n(Algorithm_namespaceObject);
|
|
3390
3390
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js
|
|
3391
3391
|
/*******************************************************************************
|
|
@@ -3878,7 +3878,7 @@ const NurbsPatchSurface_default_ = NurbsPatchSurface;
|
|
|
3878
3878
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsPatchSurface", NurbsPatchSurface_default_);
|
|
3879
3879
|
/* harmony default export */ const NURBS_NurbsPatchSurface = (NurbsPatchSurface_default_);
|
|
3880
3880
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Interpolation/PositionInterpolator\")"
|
|
3881
|
-
const PositionInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
3881
|
+
const PositionInterpolator_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Interpolation/PositionInterpolator");
|
|
3882
3882
|
var PositionInterpolator_default = /*#__PURE__*/__webpack_require__.n(PositionInterpolator_namespaceObject);
|
|
3883
3883
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsPositionInterpolator.js
|
|
3884
3884
|
/*******************************************************************************
|
|
@@ -4088,7 +4088,7 @@ const NurbsPositionInterpolator_default_ = NurbsPositionInterpolator;
|
|
|
4088
4088
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsPositionInterpolator", NurbsPositionInterpolator_default_);
|
|
4089
4089
|
/* harmony default export */ const NURBS_NurbsPositionInterpolator = (NurbsPositionInterpolator_default_);
|
|
4090
4090
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Grouping/X3DBoundedObject\")"
|
|
4091
|
-
const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
4091
|
+
const X3DBoundedObject_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Grouping/X3DBoundedObject");
|
|
4092
4092
|
var X3DBoundedObject_default = /*#__PURE__*/__webpack_require__.n(X3DBoundedObject_namespaceObject);
|
|
4093
4093
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsSet.js
|
|
4094
4094
|
/*******************************************************************************
|
|
@@ -4278,7 +4278,7 @@ const NurbsSet_default_ = NurbsSet;
|
|
|
4278
4278
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsSet", NurbsSet_default_);
|
|
4279
4279
|
/* harmony default export */ const NURBS_NurbsSet = (NurbsSet_default_);
|
|
4280
4280
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"standard/Math/Geometry/Line3\")"
|
|
4281
|
-
const Line3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
4281
|
+
const Line3_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("standard/Math/Geometry/Line3");
|
|
4282
4282
|
var Line3_default = /*#__PURE__*/__webpack_require__.n(Line3_namespaceObject);
|
|
4283
4283
|
;// CONCATENATED MODULE: ./src/standard/Math/Geometry/Triangle2.js
|
|
4284
4284
|
/*******************************************************************************
|
|
@@ -4542,7 +4542,7 @@ const NurbsSurfaceInterpolator_default_ = NurbsSurfaceInterpolator;
|
|
|
4542
4542
|
Namespace_default().set ("x_ite/Components/NURBS/NurbsSurfaceInterpolator", NurbsSurfaceInterpolator_default_);
|
|
4543
4543
|
/* harmony default export */ const NURBS_NurbsSurfaceInterpolator = (NurbsSurfaceInterpolator_default_);
|
|
4544
4544
|
;// CONCATENATED MODULE: external "window [Symbol .for (\"X_ITE.X3D\")] .require (\"x_ite/Components/Geometry3D/Extrusion\")"
|
|
4545
|
-
const Extrusion_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.
|
|
4545
|
+
const Extrusion_namespaceObject = window [Symbol .for ("X_ITE.X3D-8.6.7")] .require ("x_ite/Components/Geometry3D/Extrusion");
|
|
4546
4546
|
var Extrusion_default = /*#__PURE__*/__webpack_require__.n(Extrusion_namespaceObject);
|
|
4547
4547
|
;// CONCATENATED MODULE: ./src/x_ite/Components/NURBS/NurbsSweptSurface.js
|
|
4548
4548
|
/*******************************************************************************
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* X_ITE v8.6.6 */(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components");var n=t.n(e);const i=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Fields");var o=t.n(i);const s=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Base/X3DFieldDefinition");var r=t.n(s);const u=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Base/FieldDefinitionArray");var l=t.n(u);const a=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Core/X3DNode");var h=t.n(a);const d=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Base/X3DConstants");var c=t.n(d);const g=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Base/X3DCast");var f=t.n(g);const p=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Namespace");var _=t.n(p);function m(t){h().call(this,t),this.addType(c().Contour2D),this.childNodes=[]}function w(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}m.prototype=Object.assign(Object.create(h().prototype),{constructor:m,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"Contour2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"trimmingContour"},initialize:function(){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__:function(){this._addChildren.setTainted(!0),this._addChildren.erase(w(this._addChildren,0,this._addChildren.length,this._children,0,this._children.length),this._addChildren.length);for(const t of this._addChildren)this._children.push(t);this._addChildren.length=0,this._addChildren.setTainted(!1)},set_removeChildren__:function(){this._removeChildren.setTainted(!0),this._children.erase(w(this._children,0,this._children.length,this._removeChildren,0,this._removeChildren.length),this._children.length),this._removeChildren.length=0,this._removeChildren.setTainted(!1)},set_children__:function(){const t=this.childNodes;t.length=0;for(const e of this._children){const n=f()(c().NurbsCurve2D,e);if(n)t.push(n);else{const n=f()(c().ContourPolyline2D,e);if(n){t.push(n);continue}}}},addTrimmingContour:function(t){for(const e of this.childNodes)t.push(e.tessellate(2))}});const y=m;_().set("x_ite/Components/NURBS/Contour2D",y);const b=y;function v(t){h().call(this,t),this.addType(c().X3DNurbsControlCurveNode)}v.prototype=Object.assign(Object.create(h().prototype),{constructor:v});const C=v;_().set("x_ite/Components/NURBS/X3DNurbsControlCurveNode",C);const N=C,S=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Numbers/Vector3");var O=t.n(S);function D(t){N.call(this,t),this.addType(c().ContourPolyline2D),this.controlPoints=[]}D.prototype=Object.assign(Object.create(N.prototype),{constructor:D,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),getTypeName:function(){return"ContourPolyline2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},tessellate:function(t){switch(t){case 0:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i;e[n+0]=t[n+0],e[n+1]=t[n+1]}return e.length=2*n,e}case 1:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i,o=3*i;e[o+0]=t[n+0],e[o+1]=0,e[o+2]=t[n+1]}return e.length=3*n,e}case 3:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i;e[i]=new(O())(t[n+0],t[n+1],0)}return e.length=n,e}}}});const P=D;_().set("x_ite/Components/NURBS/ContourPolyline2D",P);const T=P,F=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Rendering/X3DCoordinateNode");var I=t.n(F);function V(t){I().call(this,t),this.addType(c().CoordinateDouble)}V.prototype=Object.assign(Object.create(I().prototype),{constructor:V,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"point",new(o().MFVec3d))]),getTypeName:function(){return"CoordinateDouble"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"coord"}});const x=V;_().set("x_ite/Components/NURBS/CoordinateDouble",x);const R=x,z=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Rendering/X3DGeometryNode");var j=t.n(z);const k=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Numbers/Vector2");var A=t.n(k);const B=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Numbers/Vector4");var X=t.n(B);const E={getTessellation:function(t,e){return t>0?t+1:t<0?-t*e+1:2*e+1},getClosed2D:function(t,e,n,i){const o=i.length;return(!(n.length===o)||n[0]===n[o-1])&&(!!i[0].equals(i[o-1])&&!!this.isPeriodic(t,o,e))},getClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s){const r=s.getSize();return(!(o.length===r)||o[0]===o[r-1])&&(!!s.get1Point(0,t).equals(s.get1Point(r-1,e))&&!!this.isPeriodic(n,r,i))}}(),getUClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s,r,u){const l=r.length===u.getSize();for(let n=0,s=o;n<s;++n){const o=n*i,s=n*i+i-1;if(l&&r[o]!==r[s])return!1;if(!u.get1Point(o,t).equals(u.get1Point(s,e)))return!1}return!!this.isPeriodic(n,i,s)}}(),getVClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s,r,u){const l=r.length===u.getSize();for(let n=0,s=i;n<s;++n){const s=n,a=(o-1)*i+n;if(l&&r[s]!==r[a])return!1;if(!u.get1Point(s,t).equals(u.get1Point(a,e)))return!1}return!!this.isPeriodic(n,o,s)}}(),isPeriodic:function(t,e,n){if(n.length===e+t){{let e=1;for(let i=1,o=t;i<o;++i)e+=n[i]===n[0];if(e===t)return!1}{let e=1;for(let i=n.length-t,o=n.length-1;i<o;++i)e+=n[i]===n[o];if(e===t)return!1}}return!0},getKnots:function(t,e,n,i,o){const s=t||[];for(let t=0,e=o.length;t<e;++t)s[t]=o[t];s.length=o.length;let r=!0;if(s.length===i+n){r=!1;let t=0;for(let e=1,i=s.length;e<i;++e)s[e]==s[e-1]?++t:t=0,t>n-1&&(r=!0),s[e-1]>s[e]&&(r=!0)}if(r)for(let t=0,e=i+n;t<e;++t)s[t]=t/(e-1);if(e)for(let t=1,e=n-1;t<e;++t)s.push(s.at(-1)+(s[t]-s[t-1]));return s},getWeights:function(t,e,n){if(n.length!==e)return;const i=t||[];for(let t=0;t<e;++t)i[t]=n[t];return i.length=e,i},getUVWeights:function(t,e,n,i){const o=e*n;if(i.length!==o)return;const s=t||[];for(let t=0,o=0;t<e;++t)for(let t=0;t<n;++t,++o)s[o]=i[o];return s.length=o,s},getControlPoints2D:function(t,e,n,i,o){const s=t||[],r=o.getValue(),u=o.length,l=Boolean(i),a=l?O():A();s.haveWeights!==l&&(s.haveWeights=l,s.length=0);for(let t=0;t<u;++t){const e=2*t,n=s[t]||new a(0,0,0);s[t]=n.set(r[e+0],r[e+1],l?i[t]:0)}if(s.length=u,e)for(let t=1,e=n-1;t<e;++t)s.push(s[t]);return s},getControlPoints:function(t,e,n,i,o){const s=t||[],r=o.getSize(),u=Boolean(i),l=u?X():O();s.haveWeights!==u&&(s.haveWeights=u,s.length=0);for(let t=0;t<r;++t){const e=s[t]=o.get1Point(t,s[t]||new l(0,0,0,0));u&&(e.w=i[t])}if(s.length=r,e)for(let t=1,e=n-1;t<e;++t)s.push(s[t]);return s},getUVControlPoints:function(t,e,n,i,o,s,r,u,l){const a=t||[],h=Boolean(u),d=h?X():O();a.haveWeights!==h&&(a.haveWeights=h,a.length=0);for(let t=0;t<s;++t){let e=a[t];e||(e=a[t]=[]);for(let n=0;n<r;++n){const i=n*s+t;e[n]=l.get1Point(i,e[n]||new d(0,0,0,0)),h&&(e[n].w=u[i])}if(e.length=r,n)for(let t=1,n=o-1;t<n;++t)e.push(e[t])}if(a.length=s,e)for(let t=1,e=i-1;t<e;++t)a.push(a[t]);return a},getTexControlPoints:function(t,e,n,i,o,s,r,u){const l=t||[];for(let t=0;t<s;++t){let e=l[t];e||(e=l[t]=[]);for(let n=0;n<r;++n){const i=n*s+t;e[n]=u.get1Point(i,e[n]||new(X())(0,0,0,0))}if(e.length=r,n)for(let t=1,n=o-1;t<n;++t)e.push(e[t])}if(l.length=s,e)for(let t=1,e=i-1;t<e;++t)l.push(l[t]);return l}};_().set("x_ite/Browser/NURBS/NURBS",E);const q=E;function K(t){j().call(this,t),this.addType(c().X3DParametricGeometryNode)}K.prototype=Object.assign(Object.create(j().prototype),{constructor:K,getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)}});const M=K;_().set("x_ite/Components/NURBS/X3DParametricGeometryNode",M);const U=M,G=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Rendering/X3DLineGeometryNode");var W=t.n(G);const Y=function(t){return!!t&&(!!t.dtype&&new RegExp("function View[0-9]+d(:?"+t.dtype+")+").test(String(t.constructor)))};_().set("lib/nurbs/src/utils/is-ndarray",Y);const J=Y,L=function(t){return!!t&&(void 0!==t.data&&Array.isArray(t.shape)&&void 0!==t.offset&&void 0!==t.stride)};_().set("lib/nurbs/src/utils/is-ndarray-like",L);const Z=L,H=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)||void 0!==t.length};_().set("lib/nurbs/src/utils/is-array-like",H);const Q=H;function $(t){if(t){if(J(t)||Z(t))return"generic"===t.dtype?$.GENERIC_NDARRAY:$.NDARRAY;if(Q(t)){for(var e=t;Q(e[0]);e=e[0]);return"x"in e?$.ARRAY_OF_OBJECTS:$.ARRAY_OF_ARRAYS}throw new Error("Unhandled data type. Got type: "+typeof t)}}$.ARRAY_OF_OBJECTS="Obj",$.ARRAY_OF_ARRAYS="Arr",$.NDARRAY="Nd",$.GENERIC_NDARRAY="GenNd",$.PACKED="PackArr";const tt=$;_().set("lib/nurbs/src/utils/infer-type",tt);const et=tt;const nt=function(t,e,n,i,o,s){var r,u,l=[],a=!1;for(r=0;r<t.splineDimension;r++){var h=Q(t.knots)&&Q(t.knots[r]);h&&(a=!0),l.push("Deg"+t.degree[r]+(h?"":"Uniform")+((u=t.boundary[r])[0].toUpperCase()+u.slice(1)))}var d=[[a?"NU":"",t.weights?"RBS":"BS"].join("")+t.dimension+"D",l.join("_")];return i&&d.push(i+"Pts"),o&&d.push(o+"Wts"),s&&d.push(s+"Kts"),e&&d.push("debug"),n&&d.push("chk"),d.join("_")};_().set("lib/nurbs/src/utils/cache-key",nt);const it=nt;var ot=function t(e,n){return function(n,i){void 0===n||Array.isArray(n)||(n=[n]);for(var o=[],s=0;s<n.length;s++)o.push(t.sum(n[s]));if(i)for(n=0;n<o.length;n++)void 0!==i[n]&&(o[n]="("+o[n]+" + "+i[n]+") % "+i[n]);return e+o.join("_")}};ot.sum=function(t){return 0===(t=(t=Array.isArray(t)?t:[t]).filter((function(t){return void 0!==t&&0!==t}))).length&&t.push(0),t.join(" + ")};const st=ot;_().set("lib/nurbs/src/utils/variable",st);const rt=st;var ut=[".x",".y",".z",".w"];function lt(t){return function(e,n){void 0===e||Array.isArray(e)||(e=[e]);for(var i=[],o=0;o<e.length;o++)i.push(rt.sum(e[o]));if(n)for(e=0;e<i.length;e++)void 0!==n[e]&&(i[e]="("+i[e]+" + "+n[e]+") % "+n[e]);return t(i)}}function at(t,e){if(e)switch(et(e)){case et.ARRAY_OF_OBJECTS:return lt((function(e){var n=e.pop();return t+"["+e.join("][")+"]"+ut[n]}));case et.ARRAY_OF_ARRAYS:return lt((function(e){return t+"["+e.join("][")+"]"}));case et.GENERIC_NDARRAY:return lt((function(e){return t+".get("+e.join(",")+")"}));case et.NDARRAY:return lt((function(e){for(var n=[t+"Offset"],i=0;i<e.length;i++)n.push(t+"Stride"+i+" * ("+e[i]+")");return t+"["+n.join(" + ")+"]"}));case et.PACKED:default:return}}const ht=function(t){var e,n={};return(e=at("x",t.points))&&(n.point=e),(e=at("w",t.weights))&&(n.weight=e),(e=at("k",t.knots))&&(n.knot=e),n};_().set("lib/nurbs/src/utils/create-accessors",ht);const dt=ht;var ct=[],gt=[];const ft=function(t,e,n){if(1!==e)throw new Error("Numerical derivative not implemented for order n = "+e+".");var i,o=void 0===arguments[this.splineDimension+3]?1e-4:arguments[this.splineDimension+3];for(ct.length=this.splineDimension,i=0;i<this.splineDimension;i++)ct[i+1]=arguments[i+3];var s,r,u,l=this.domain,a=l[n][0],h=l[n][1],d=ct[n+1],c=(h-a)*o;for("closed"===this.boundary[n]?(s=a+(d-a-c+(u=h-a))%u,r=a+(d-a+c+u)%u,c*=2):(s=Math.min(h,Math.max(a,d-c)),c=(r=Math.min(h,Math.max(a,d+c)))-s),ct[n+1]=s,ct[0]=gt,this.evaluate.apply(null,ct),ct[n+1]=r,ct[0]=t,this.evaluate.apply(null,ct),i=0;i<this.dimension;i++)t[i]=(t[i]-gt[i])/c;return t};_().set("lib/nurbs/src/numerical-derivative",ft);const pt=ft,_t=function(t,e){for(var n=1,i=0,o=[];i<t.length;i++)n*=Array.isArray(t[i])?t[i][1]-t[i][0]:t[i],o[i]=Array.isArray(t[i])?t[i][0]:0;for(var s=0;s<n;s++)for(e(o.slice()),i=t.length-1;i>=0;i--){if(o[i]!==(Array.isArray(t[i])?t[i][1]:t[i])-1){o[i]++;break}o[i]=Array.isArray(t[i])?t[i][0]:0}};_().set("lib/nurbs/src/utils/ndloop",_t);const mt=_t,wt=function(t,e,n,i){var o=[];switch(et(i)){case et.NDARRAY:o.push(" var "+e+" = "+n+".data;"),o.push(" var "+e+"Offset = "+n+".offset;");for(var s=0;s<i.dimension;s++)o.push(" var "+e+"Stride"+s+" = "+n+".stride["+s+"];");break;case et.ARRAY_OF_OBJECTS:case et.ARRAY_OF_ARRAYS:o.push(" var "+e+" = "+n+";")}return o.join("\n")};_().set("lib/nurbs/src/utils/accessor-preamble",wt);const yt=wt,bt=function(t,e,n){if(t){if(Z(t))return e+".shape["+n+"]";for(var i=e,o=0;o<n;o++)i+="[0]";return i+".length"}return"this.size["+n+"]"};_().set("lib/nurbs/src/utils/size-getter",bt);const vt=bt;var Ct={},Nt={};const St=function(t,e,n,i,o,s,r){var u,l,a,h,d,c,g=e.splineDimension,f=e.points,p=e.degree,_=e.weights,m=void 0!==_,w=e.knots,y=e.dimension,b=e.boundary;if(null!=r){Array.isArray(r)||(r=[r]);var v=0;for(u=0;u<g;u++)void 0===r[u]&&(r[u]=0),v+=r[u];if(m&&v>1)throw new Error("Analytical derivative not implemented for rational b-splines with order n = "+v+".")}s&&(t="Basis"+t),r&&(t="Der"+r.join("_")+"_"+t);var C=Ct[t];if(i)var N="function"==typeof i?i:console.log;if(C)return i&&N(Nt[t]),C.bind(e);var S=[],O="evaluate"+t,D=n.point;s&&(D=function(t,e){for(var n=[],i=0;i<t.length;i++){for(var o=t[i],s=[],r=0;r<o.length;r++)0!==o[r]&&s.push(o[r]);o=s.join(" + "),e[i]&&(o="("+o+" + "+e[i]+") % "+e[i]),n.push(o+" === "+x(i))}return"(("+n.join(" && ")+") ? 1 : 0)"});var P=n.weight,T=n.knot,F=rt("k"),I=rt("x"),V=rt("w"),x=rt("i"),R=rt("t"),z=i?"domain":"d",j=rt(i?"size":"s"),k=rt(i?"knotIndex":"j"),A=!0;for(d=0;d<g;d++)Q(w)&&Q(w[d])&&(A=!1);function B(t){S.push(" "+(t||""))}function X(t){i&&B(t)}if(s)var E=[];var q=[];for(u=0;u<g;u++)s&&E.push(x([u])),q.push(R([u]));for(S.push("function "+O+" ("+(s?"":"out, ")+q.join(", ")+(s?", "+E.join(", "):"")+") {"),B("var h, m, a, b;"),o&&(B("var "+z+" = this.domain;"),B("for (var i = 0; i < this.splineDimension; i++) {"),B(" a = arguments[i + 1];"),B(" if (a < "+z+"[i][0] || a > "+z+"[i][1] || a === undefined || isNaN(a)) {"),B(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+z+'[i][0]+", "+'+z+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),B(" }"),B("}")),d=0;d<g;d++)B("var "+j(d)+" = "+vt(f,"this.points",d)+";");function K(t,e,n){return"("+t+") ? ("+e+") : ("+n+")"}S.push(yt(e,"x","this.points",f)),m&&S.push(yt(e,"w","this.weights",_)),A||S.push(yt(e,"k","this.knots",w));var M=[];for(d=0;d<g;d++)switch(et(w)){case et.NDARRAY:M[d]=!0;break;case et.ARRAY_OF_ARRAYS:M[d]=Q(w[d])}for(d=0;d<g;d++)if(M[d])for(X("\n // Bisect to locate the knot interval in dimension "+d+"\n"),B("var "+k(d)+" = 0;"),B("h = "+j(d)+";"),B("while(h > "+k(d)+" + 1) {"),B(" m = 0.5 * (h + "+k(d)+") | 0;"),B(" if ("+T([d,"m"])+" > "+R(d)+") h = m;"),B(" else "+k(d)+" = m;"),B("}"),X("\n // Fetch knots for dimension "+d+"\n"),u=1-p[d];u<=p[d];u++)"closed"===b[d]?B(u<0?"var "+F([d,u+p[d]-1])+" = "+K(k(d)+" < "+-u,T([d,0])+" + "+T([d,[j(d),k(d),u]])+" - "+T([d,[j(d)]]),T([d,[k(d),u]]))+";":u>0?"var "+F([d,u+p[d]-1])+" = "+K(k(d)+" + "+u+" > "+j(d),T([d,j(d)])+" + "+T([d,u+" + "+k(d)+" - "+j(d)])+" - "+T([d,0]),T([d,[k(d),u]]))+";":"var "+F([d,u+p[d]-1])+" = "+T([d,[k(d),u]])+";"):B("var "+F([d,u+p[d]-1])+" = "+T([d,[k(d),u]])+";");else{for(X("\n // Directly compute knot interval for dimension "+d+"\n"),"closed"===b[d]?B(k(d)+" = ("+R(d)+" | 0) % "+j(d)+";"):(B(k(d)+" = ("+R(d)+" | 0);"),B("if ("+k(d)+" < "+p[d]+") "+k(d)+" = "+p[d]+";"),B("if ("+k(d)+" > "+j(d)+" - 1) "+k(d)+" = "+j(d)+" - 1;")),X("\n // Compute and clamp knots for dimension "+d+"\n"),u=1-p[d];u<=p[d];u++)B("var "+(c=F([d,u+p[d]-1]))+" = "+k(d)+" + "+u+";");if("clamped"===b[d])for(u=1-p[d];u<=p[d];u++)c=F([d,u+p[d]-1]),u<0&&B("if ("+c+" < "+p[d]+") "+c+" = "+p[d]+";"),u>0&&B("if ("+c+" > "+j(d)+") "+c+" = "+j(d)+";");"closed"===b[d]&&(X("\n // Wrap the B-Spline parameter for closed boundary"),B(R(d)+" %= "+j(d)+";"))}for(d=0,a=[];d<g;d++)a[d]=p[d]+1;for(m&&(X("\n // Fetch weights\n"),mt(a,(function(t){for(var e=[],n=[],i=0;i<g;i++)e[i]=[k(i),t[i]-p[i]],"closed"===b[i]&&t[i]-p[i]<0&&(n[i]=j(i));B("var "+V(t)+" = "+P(e,n)+";")}))),i&&B(m?"\n // Fetch points and project into homogeneous (weighted) coordinates\n":"\n // Fetch points\n"),mt(a,(function(t){for(var e=[],n=[],i=0;i<g;i++)e[i]=[k(i),t[i]-p[i]],"closed"===b[i]&&t[i]-p[i]<0&&(n[i]=j(i));if(s)B(m?"var "+I(t)+" = "+D(e,n)+" * "+V(t)+";":"var "+I(t)+" = "+D(e,n)+";");else for(i=0;i<y;i++){var o=t.concat(i);e[g]=i,B(m?"var "+I(o)+" = "+D(e,n)+" * "+V(t)+";":"var "+I(o)+" = "+D(e,n)+";")}})),X("\n"),X('// Perform De Boor"s algorithm'),d=a.length-1;d>=0;d--)for(a[d]=[p[d],p[d]+1],u=0;u<p[d];u++)for(X("\n // Degree "+p[d]+" evaluation in dimension "+d+", step "+(u+1)+"\n"),l=p[d];l>u;l--){var U=r&&p[d]-u-r[d]<=0;U?(B("m = 1 / ("+F([d,l-u+p[d]-1])+" - "+F([d,l-1])+");"),m&&(B("a = ("+R(d)+" - "+F([d,l-1])+") * m;"),B("b = 1 - a;"))):(B("a = ("+R(d)+" - "+F([d,l-1])+") / ("+F([d,l-u+p[d]-1])+" - "+F([d,l-1])+");"),B("b = 1 - a;")),m&&mt(a,(function(t){var e=t.slice(),n=t.slice();e[d]=l,n[d]=l-1,U&&m&&B("h = "+V(e)+";"),B(V(e)+" = b * "+V(n)+" + a * "+V(e)+";")})),mt(a,(function(t){var e,n,i,o=t.slice(),r=t.slice();if(o[d]=l,r[d]=l-1,U){var a=u+1;if(s)e=m?"h * "+V(r)+" / "+V(o)+" * ":"",n=I(o)+(m?" / h":""),i=I(r)+(m?" / "+V(r):""),B(I(o)+" = "+a+" * "+e+"("+n+" - "+i+") * m;");else{var c=o.slice(),f=r.slice();for(h=0;h<y;h++)c[g]=f[g]=h,e=m?"h * "+V(r)+" / "+V(o)+" * ":"",n=I(c)+(m?" / h":""),i=I(f)+(m?" / "+V(r):""),B(I(c)+" = "+a+" * "+e+"("+n+" - "+i+") * m;")}}else if(s)B(I(o)+" = b * "+I(r)+" + a * "+I(o)+";");else for(h=0;h<y;h++)o[g]=r[g]=h,B(I(o)+" = b * "+I(r)+" + a * "+I(o)+";")})),X("\n")}if(i&&B(m?"\n // Project back from homogeneous coordinates and return final output\n":"\n // Return final output\n"),s)B(m?"return "+I(p)+" / "+V(p)+";":"return "+I(p)+";");else for(d=0;d<y;d++)B(m?"out["+d+"] = "+I(p.concat([d]))+" / "+V(p)+";":"out["+d+"] = "+I(p.concat([d]))+";");if(s||B("return out;"),S.push("}"),i){var G=S.join("\n");N(G),Nt[t]=G}var W=new Function([S.join("\n"),"; return ",O].join(""))();return Ct[t]=W,W.bind(e)};_().set("lib/nurbs/src/evaluate",St);const Ot=St;var Dt={};const Pt=function(t,e,n,i){var o,s,r,u,l,a,h,d,c=Dt[t];if(c)return c.bind(e);var g=[],f="transform"+t;g.push("function "+f+"(m) {"),g.push("var i, w;"),g.push(yt(e,"x","this.points",e.points));var p=rt(i?"size":"s");for(o=0;o<e.splineDimension;o++)g.push("var "+p(o)+" = "+vt(e.points,"this.points",o)+";");for(u=[],o=0;o<e.splineDimension;o++)r="i"+o,u.push(r),g.push("for ("+r+" = "+p(o)+"- 1; "+r+" >= 0; "+r+"--) {");for(o=0;o<e.dimension;o++)g.push("x"+o+" = "+n.point(u.concat([o])));for(l=[],o=0;o<e.dimension;o++)l.push("m["+((e.dimension+1)*(o+1)-1)+"] * x"+o);for(l.push("m["+((e.dimension+1)*(e.dimension+1)-1)+"]"),g.push("var w = ("+l.join(" + ")+") || 1.0;"),o=0;o<e.dimension;o++){for(l=[],a=e.dimension,s=0;s<a;s++)l.push("m["+(s*(a+1)+o)+"] * x"+s);l.push("m["+(s*(a+1)+o)+"]"),d=n.point(u.concat([o])),h="("+l.join(" + ")+") / w",g.push(d+" = "+h+";")}for(o=e.splineDimension-1;o>=0;o--)g.push("}");g.push("return this;"),g.push("}");var _=new Function([g.join("\n"),"; return ",f].join(""))();return i&&console.log(g.join("\n")),Dt[t]=_,_.bind(e)};_().set("lib/nurbs/src/transform",Pt);const Tt=Pt;var Ft={};const It=function(t,e,n,i,o){var s=Ft[t];if(s)return s.bind(e);var r,u,l,a=e.degree,h=e.knots,d=e.splineDimension,c=e.boundary,g=[],f="support"+t,p=n.knot,_=rt("t"),m=i?"domain":"d",w=rt(i?"size":"s"),y=rt(i?"knotIndex":"i"),b=!0;for(l=0;l<d;l++)Q(h)&&Q(h[l])&&(b=!1);function v(t){g.push(" "+(t||""))}var C=[];for(r=0;r<d;r++)C.push(_([r]));g.push("function "+f+" (out, "+C.join(", ")+") {");var N=0;function S(t,e){v(void 0===e?"out["+N+++"] = "+t.join(" + ")+";":"out["+N+++"] = ("+t.join(" + ")+" + "+e+") % "+e+";")}for(v("var h, m;"),v("var c = 0;"),o&&(v("var "+m+" = this.domain;"),v("for (var i = 0; i < this.splineDimension; i++) {"),v(" a = arguments[i + 1];"),v(" if (a < "+m+"[i][0] || a > "+m+"[i][1] || a === undefined || isNaN(a)) {"),v(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+m+'[i][0]+", "+'+m+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),v(" }"),v("}")),l=0;l<d;l++)v("var "+w(l)+" = "+vt(e.points,"this.points",l)+";");b||g.push(yt(e,"k","this.knots",h));var O=[];for(l=0;l<d;l++)switch(et(h)){case et.NDARRAY:O[l]=!0;break;case et.ARRAY_OF_ARRAYS:O[l]=Q(h[l])}for(l=0;l<d;l++)O[l]?(v("var "+y(l)+" = 0;"),v("h = "+w(l)+";"),v("while(h > "+y(l)+" + 1) {"),v(" m = 0.5 * (h + "+y(l)+") | 0;"),v(" if ("+p([l,"m"])+" > "+_(l)+") h = m;"),v(" else "+y(l)+" = m;"),v("}")):"closed"===c[l]?v(y(l)+" = ("+_(l)+" | 0) % "+w(l)+";"):(v(y(l)+" = ("+_(l)+" | 0);"),v("if ("+y(l)+" < "+a[l]+") "+y(l)+" = "+a[l]+";"),v("if ("+y(l)+" > "+w(l)+" - 1) "+y(l)+" = "+w(l)+" - 1;"));for(l=0,u=[];l<d;l++)u[l]=a[l]+1;mt(u,(function(t){for(var e=[],n=[],i=0;i<d;i++)e[i]=[y(i),t[i]-a[i]],"closed"===c[i]&&t[i]-a[i]<0&&(n[i]=w(i));for(i=0;i<d;i++)S(e[i],n[i])})),v("out.length = "+N+";"),v("return out;"),g.push("}"),i&&console.log(g.join("\n"));var D=new Function([g.join("\n"),"; return ",f].join(""))();return Ft[t]=D,D.bind(e)};_().set("lib/nurbs/src/support",It);const Vt=It,xt=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Geometry/Triangle3");var Rt=t.n(xt),zt=[];const jt=function(t,e,n){n=n||{};var i=(t=t||{}).points=t.points||[],o=t.faces=t.faces||[],s=n.haveWeights,r=e.dimension-s;if(Array.isArray(n.resolution))var u=n.resolution;else{var l=void 0===n.resolution?31:n.resolution;u=new Array(e.splineDimension).fill(l)}switch(e.splineDimension){case 1:for(var a=(_=(w=u[0])+!(b="closed"===e.boundary[0]))*r,h=(C=(m=n.domain||e.domain)[0])[1]-C[0],d=0;d<_;++d){var c=C[0]+h*d/w,g=d*r;if(e.evaluate(zt,c),s)for(var f=zt[r],p=0;p<r;++p)i[g+p]=zt[p]/f;else for(p=0;p<r;++p)i[g+p]=zt[p]}i.length=a;break;case 2:var _,m,w=u[0],y=u[1],b="closed"===e.boundary[0],v=y+!(P="closed"===e.boundary[1]),C=(a=(_=w+!b)*v*r,(m=n.domain||e.domain)[0]),N=m[1],S=(h=C[1]-C[0],N[1]-N[0]);for(d=0;d<_;++d){c=C[0]+h*d/w;for(var O=0;O<v;++O){var D=N[0]+S*O/y;g=(d+_*O)*r;if(e.evaluate(zt,c,D),s)for(f=zt[r],p=0;p<r;++p)i[g+p]=zt[p]/f;else for(p=0;p<r;++p)i[g+p]=zt[p]}}i.length=a;b=n.closed[0];var P=n.closed[1],T=0;for(d=0;d<w;++d){var F=d,I=d+1;b&&(I%=w);for(O=0;O<y;++O){var V=O,x=O+1;P&&(x%=y),o[T++]=F+_*V,o[T++]=I+_*V,o[T++]=I+_*x,o[T++]=F+_*V,o[T++]=I+_*x,o[T++]=F+_*x}}o.length=T;break;default:throw new Error("Can only sample contours and surfaces")}return t};_().set("lib/nurbs/extras/sample",jt);const kt=jt;var At={open:"open",closed:"closed",clamped:"clamped"};function Bt(t){return null==t}function Xt(t,e,n,i,o,s){var r,u;!t||Q(t)||J(t)?(s=s||{},this.weights=i,this.knots=n,this.degree=e,this.points=t,this.boundary=o,this.debug=s.debug,this.checkBounds=!!s.checkBounds,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0})):(s=t,this.debug=t.debug,this.checkBounds=!!t.checkBounds,this.weights=t.weights,this.knots=t.knots,this.degree=t.degree,this.boundary=t.boundary,this.points=t.points,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0}));var l=et(this.points),a=et(this.weights),h=et(this.knots);if(this.points)switch(l){case et.GENERIC_NDARRAY:case et.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 et.ARRAY_OF_OBJECTS:case et.ARRAY_OF_ARRAYS:var d=0,c=this.size||[];c.length=0;for(var g=this.points;Q(g[0]);g=g[0])d++,c.push(g.length);if(0===d)throw new Error("Expected an array of points");Object.defineProperties(this,{splineDimension:{value:d,writable:!1,configurable:!0},dimension:{value:g.length,writable:!1,configurable:!0},size:{get:function(){var t=[];t.length=0;for(var e=0,n=this.points;e<this.splineDimension;e++,n=n[0])t[e]=n.length;return t},set:function(){throw new Error('Cannot assign to read only property "size"')},configurable:!0}});break;case et.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(Bt(this.degree[r]))throw new Error("Missing degree in dimension "+(r+1))}else{var f=!Bt(this.degree),p=Bt(this.degree)?2:this.degree;for(this.degree=[],r=0;r<this.splineDimension;r++)if(this.size[r]<=p){if(f)throw new Error("Expected at least "+(p+1)+" points for degree "+p+" spline in dimension "+(r+1)+" but got only "+this.size[r]);this.degree[r]=this.size[r]-1}else this.degree[r]=p}if(u="string"!=typeof this.boundary?"open":this.boundary,!At[u])throw new Error("Boundary type must be one of "+Object.keys(At)+". Got "+u);for(this.boundary=Q(this.boundary)?this.boundary:[],this.boundary.length=this.splineDimension,r=0;r<this.splineDimension;r++)if(this.boundary[r]=Bt(this.boundary[r])?u:this.boundary[r],!At[u])throw new Error("Boundary type must be one of "+Object.keys(At)+". Got "+u+" for dimension "+(r+1));switch(h){case et.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 et.NDARRAY:}var _=it(this,this.debug,this.checkBounds,l,a,h);if(_!==this.__cacheKey){this.__cacheKey=_;var m=dt(this);this.evaluate=Ot(this.__cacheKey,this,m,this.debug,this.checkBounds,!1),this.transform=Tt(this.__cacheKey,this,m,this.debug),this.support=Vt(this.__cacheKey,this,m,this.debug,this.checkBounds),this.evaluator=function(t,e){return Ot(this.__cacheKey,this,m,this.debug,this.checkBounds,e,t)}}return this.numericalDerivative=pt.bind(this),this}function Et(){var t,e=[],n=this.points;n?Z(n)&&(t=n.shape):t=this.size;for(var i=0;i<this.splineDimension;i++){var o=t?t[i]:n.length,s=this.degree[i],r="closed"===this.boundary[i];if(this.knots&&this.knots[i]){var u=this.knots[i];e[i]=[u[r?0:s],u[o]]}else e[i]=[r?0:s,o];n&&(n=n[0])}return e}function qt(t,e,n,i,o,s){var r=function(t,e,n,i,o,s){return u(t,e,n,i,o,s),r},u=Xt.bind(r);return Object.defineProperty(r,"domain",{get:Et}),u(t,e,n,i,o,s),r}qt.sample=kt;const Kt=qt;_().set("lib/nurbs/nurbs",Kt);const Mt=Kt;function Ut(t){U.call(this,t),W().call(this,t),this.addType(c().NurbsCurve),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]}}Ut.prototype=Object.assign(Object.create(U.prototype),W().prototype,{constructor:Ut,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsCurve"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_controlPoint__()},set_controlPoint__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},getTessellation:function(t){return q.getTessellation(this._tessellation.getValue(),t-this._order.getValue())},getClosed:function(t,e,n,i){return!!this._closed.getValue()&&q.getClosed(t,e,n,i)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},tessellate:function(){if(this._order.getValue()<2)return[];if(!this.controlPointNode)return[];if(this.controlPointNode.getSize()<this._order.getValue())return[];const t=this.getVertices(),e=[];if(t.length){const n=t.length;for(let i=0;i<n;i+=8)e.push(t[i],t[i+1],t[i+2]);e.push(t[n-4],t[n-3],t[n-2])}return e},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=(i.at(-1),i[0],this._order.getValue()-1),s=this.surface=(this.surface||Mt)({boundary:["open"],degree:[o],knots:[i],points:n,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(i.length),this.sampleOptions.haveWeights=Boolean(e);const r=Mt.sample(this.mesh,s,this.sampleOptions).points,u=this.getVertices();for(let t=3,e=r.length;t<e;t+=3){const e=t-3;u.push(r[e],r[e+1],r[e+2],1),u.push(r[t],r[t+1],r[t+2],1)}},dispose:function(){U.prototype.dispose.call(this)}});const Gt=Ut;_().set("x_ite/Components/NURBS/NurbsCurve",Gt);const Wt=Gt;function Yt(t){N.call(this,t),this.addType(c().NurbsCurve2D),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]},this.array=[]}Yt.prototype=Object.assign(Object.create(N.prototype),{constructor:Yt,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsCurve2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},getTessellation:function(t){return q.getTessellation(this._tessellation.getValue(),t-this._order.getValue())},getClosed:function(t,e,n,i){return!!this._closed.getValue()&&q.getClosed2D(t,e,n,i)},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints2D(t,e,n,i,o)},tessellate:function(t){const e=this.array;if(e.length=0,this._order.getValue()<2)return e;if(this._controlPoint.length<this._order.getValue())return e;const n=this.getClosed(this._order.getValue(),this._knot,this._weight,this._controlPoint),i=this.getWeights(this.weights,this._controlPoint.length,this._weight),o=this.getControlPoints(this.controlPoints,n,this._order.getValue(),i,this._controlPoint),s=this.getKnots(this.knots,n,this._order.getValue(),this._controlPoint.length,this._knot),r=(s.at(-1),s[0],this._order.getValue()-1),u=this.surface=(this.surface||Mt)({boundary:["open"],degree:[r],knots:[s],points:o,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(s.length),this.sampleOptions.haveWeights=Boolean(i);const l=Mt.sample(this.mesh,u,this.sampleOptions).points;switch(t){case 0:for(let t=0,n=l.length;t<n;t+=2)e.push(l[t],l[t+1]);break;case 1:for(let t=0,n=l.length;t<n;t+=2)e.push(l[t],0,l[t+1]);break;case 2:for(let t=0,n=l.length;t<n;t+=2)e.push(new(O())(l[t],l[t+1],0))}return e}});const Jt=Yt;_().set("x_ite/Components/NURBS/NurbsCurve2D",Jt);const Lt=Jt,Zt=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Core/X3DChildNode");var Ht=t.n(Zt);const Qt=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Interpolation/OrientationInterpolator");var $t=t.n(Qt);const te=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Numbers/Rotation4");var ee=t.n(te);function ne(t){Ht().call(this,t),this.addType(c().NurbsOrientationInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new($t())(t),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}ne.prototype=Object.assign(Object.create(Ht().prototype),{constructor:ne,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsOrientationInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().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__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:function(t,e,n,i){return!1},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},requestRebuild:function(){this._rebuild.addEvent()},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=i.at(-1)-i[0],s=this._order.getValue()-1,r=this.surface=(this.surface||Mt)({boundary:["open"],degree:[s],knots:[i],points:n,debug:!1});this.sampleOptions.haveWeights=Boolean(e);const u=Mt.sample(this.mesh,r,this.sampleOptions).points,l=this.interpolator;l._key.length=0,l._keyValue.length=0;for(let e=0,n=u.length-3;e<n;e+=3){const s=new(O())(u[e+3]-u[e+0],u[e+4]-u[e+1],u[e+5]-u[e+2]);l._key.push(i[0]+e/(n-3+3*t)*o),l._keyValue.push(new(ee())(O().zAxis,s))}t&&(l._key.push(i[0]+o),l._keyValue.push(l._keyValue[0]))}});const ie=ne;_().set("x_ite/Components/NURBS/NurbsOrientationInterpolator",ie);const oe=ie,se=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Algorithm");var re=t.n(se);function ue(t){U.call(this,t),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={}}ue.prototype=Object.assign(Object.create(U.prototype),{constructor:ue,initialize:function(){U.prototype.initialize.call(this),this._texCoord.addInterest("set_texCoord__",this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_texCoord__(),this.set_controlPoint__()},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("requestRebuild",this),this.nurbsTexCoordNode&&this.nurbsTexCoordNode.removeInterest("requestRebuild",this),this.texCoordNode=f()(c().X3DTextureCoordinateNode,this._texCoord),this.nurbsTexCoordNode=f()(c().NurbsTextureCoordinate,this._texCoord),this.texCoordNode&&this.texCoordNode.addInterest("requestRebuild",this),this.nurbsTexCoordNode&&this.nurbsTexCoordNode.addInterest("requestRebuild",this)},set_controlPoint__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},setTessellationScale:function(t){this.tessellationScale=t,this.requestRebuild()},getUTessellation:function(t){return Math.floor(q.getTessellation(this._uTessellation.getValue(),t-this._uOrder.getValue())*this.tessellationScale)},getVTessellation:function(t){return Math.floor(q.getTessellation(this._vTessellation.getValue(),t-this._vOrder.getValue())*this.tessellationScale)},getUClosed:function(t,e,n,i,o,s){return!!this._uClosed.getValue()&&q.getUClosed(t,e,n,i,o,s)},getVClosed:function(t,e,n,i,o,s){return!!this._vClosed.getValue()&&q.getVClosed(t,e,n,i,o,s)},getUVWeights:function(t,e,n,i){return q.getUVWeights(t,e,n,i)},getTexControlPoints:function(t,e,n,i,o,s,r,u){return q.getTexControlPoints(t,e,n,i,o,s,r,u)},getUVControlPoints:function(t,e,n,i,o,s,r,u,l){return q.getUVControlPoints(t,e,n,i,o,s,r,u,l)},getTrimmingContours:function(){},build:function(){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 t=this.getUClosed(this._uOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._uKnot,this._weight,this.controlPointNode),e=this.getVClosed(this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._vKnot,this._weight,this.controlPointNode),n=this.getUVWeights(this.weights,this._uDimension.getValue(),this._vDimension.getValue(),this._weight),i=this.getUVControlPoints(this.controlPoints,t,e,this._uOrder.getValue(),this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),n,this.controlPointNode),o=this.getKnots(this.uKnots,t,this._uOrder.getValue(),this._uDimension.getValue(),this._uKnot),s=this.getKnots(this.vKnots,e,this._vOrder.getValue(),this._vDimension.getValue(),this._vKnot),r=(o.at(-1),o[0],s.at(-1),s[0],this._uOrder.getValue()-1),u=this._vOrder.getValue()-1,l=this.surface=(this.surface||Mt)({boundary:["open","open"],degree:[r,u],knots:[o,s],points:i,debug:!1}),a=this.sampleOptions;a.resolution[0]=this.getUTessellation(o.length),a.resolution[1]=this.getVTessellation(s.length),a.closed[0]=t,a.closed[1]=e,a.domain=void 0,a.haveWeights=Boolean(n),a.trimmingContours=this.getTrimmingContours();const h=Mt.sample(this.mesh,l,a),d=h.faces,c=h.points,g=this.getVertices();for(let t=0,e=d.length;t<e;++t){const e=3*d[t];g.push(c[e],c[e+1],c[e+2],1)}this.buildNurbsTexCoords(t,e,this._uOrder.getValue(),this._vOrder.getValue(),o,s,this._uDimension.getValue(),this._vDimension.getValue(),l.domain),this.buildNormals(d,c),this.setSolid(this._solid.getValue()),this.setCCW(!0)},buildNurbsTexCoords:function(){const t=[],e=[],n=[[[0,0,0,1],[0,1,0,1]],[[1,0,0,1],[1,1,0,1]]];function i(t,e){return t[0]=t[1]=e[0],t[2]=t[3]=e.at(-1),t}return function(o,s,r,u,l,a,h,d,c){const g=this.sampleOptions;if(this.texCoordNode&&this.texCoordNode.getSize()===h*d)var f=r-1,p=u-1,_=l,m=a,w=this.getTexControlPoints(this.texControlPoints,o,s,r,u,h,d,this.texCoordNode);else if(this.nurbsTexCoordNode&&this.nurbsTexCoordNode.isValid()){var y=this.nurbsTexCoordNode,b=(f=y._uOrder.getValue()-1,p=y._vOrder.getValue()-1,_=this.getKnots(this.texUKnots,!1,y._uOrder.getValue(),y._uDimension.getValue(),y._uKnot),m=this.getKnots(this.texVKnots,!1,y._vOrder.getValue(),y._vDimension.getValue(),y._vKnot),this.getUVWeights(this.texWeights,y._uDimension.getValue(),y._vDimension.getValue(),y._weight));w=y.getControlPoints(b)}else{f=1,p=1,_=i(t,l),m=i(e,a),w=n;g.domain=c}const v=this.texSurface=(this.texSurface||Mt)({boundary:["open","open"],degree:[f,p],knots:[_,m],points:w});g.closed[0]=!1,g.closed[1]=!1,g.haveWeights=!1;const C=Mt.sample(this.texMesh,v,g),N=C.faces,S=C.points,O=this.getTexCoords();for(let t=0,e=N.length;t<e;++t){const e=4*N[t];O.push(S[e],S[e+1],S[e+2],S[e+3])}this.getMultiTexCoords().push(this.getTexCoords())}}(),buildNormals:function(t,e){const n=this.createNormals(t,e),i=this.getNormals();for(const t of n)i.push(t.x,t.y,t.z)},createNormals:function(t,e){const n=this.createFaceNormals(t,e),i=[];for(let e=0,n=t.length;e<n;++e){const n=t[e];let o=i[n];o||(o=i[n]=[]),o.push(e)}return this.refineNormals(i,n,re().radians(85))},createFaceNormals:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0),n=new(O())(0,0,0);return function(i,o){const s=this.faceNormals||[],r=i.length;for(let u=0;u<r;u+=3){const r=3*i[u],l=3*i[u+1],a=3*i[u+2];t.set(o[r],o[r+1],o[r+2]),e.set(o[l],o[l+1],o[l+2]),n.set(o[a],o[a+1],o[a+2]);const h=Rt().normal(t,e,n,s[u]||new(O())(0,0,0));s[u]=h,s[u+1]=h,s[u+2]=h}return s.length=r,s}}()});const le=ue;_().set("x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode",le);const ae=le;function he(t){ae.call(this,t),this.addType(c().NurbsPatchSurface)}he.prototype=Object.assign(Object.create(ae.prototype),{constructor:he,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),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))]),getTypeName:function(){return"NurbsPatchSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"}});const de=he;_().set("x_ite/Components/NURBS/NurbsPatchSurface",de);const ce=de,ge=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Interpolation/PositionInterpolator");var fe=t.n(ge);function pe(t){Ht().call(this,t),this.addType(c().NurbsPositionInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new(fe())(t),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}pe.prototype=Object.assign(Object.create(Ht().prototype),{constructor:pe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsPositionInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().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__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:function(t,e,n,i){return!1},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},requestRebuild:function(){this._rebuild.addEvent()},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),s=i.at(-1)-i[0],r=this._order.getValue()-1,u=this.surface=(this.surface||Mt)({boundary:["open"],degree:[r],knots:[i],points:n,debug:!1});this.sampleOptions.haveWeights=Boolean(e);const l=Mt.sample(this.mesh,u,this.sampleOptions).points,a=this.interpolator;a._key.length=0,a._keyValue.length=0;for(let t=0,e=l.length;t<e;t+=3)a._key.push(i[0]+t/(e-3)*s),a._keyValue.push(new(o().SFVec3f)(l[t],l[t+1],l[t+2]))}});const _e=pe;_().set("x_ite/Components/NURBS/NurbsPositionInterpolator",_e);const me=_e,we=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Grouping/X3DBoundedObject");var ye=t.n(we);function be(t){Ht().call(this,t),ye().call(this,t),this.addType(c().NurbsSet),this.geometryNodes=[]}function ve(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}be.prototype=Object.assign(Object.create(Ht().prototype),ye().prototype,{constructor:be,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSet"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().prototype.initialize.call(this),ye().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:function(t,e){for(const e of this.geometryNodes)t.add(e.getBBox());return t},set_tessellationScale__:function(){const t=Math.max(0,this._tessellationScale.getValue());for(const e of this.geometryNodes)e.setTessellationScale(t)},set_addGeometry__:function(){this._addGeometry.setTainted(!0),this._addGeometry.erase(ve(this._addGeometry,0,this._addGeometry.length,this._geometry,0,this._geometry.length),this._addGeometry.length);for(const t of this._addGeometry)this._geometry.push(t);this._addGeometry.length=0,this._addGeometry.setTainted(!1)},set_removeGeometry__:function(){this._removeGeometry.setTainted(!0),this._geometry.erase(ve(this._geometry,0,this._geometry.length,this._removeGeometry,0,this._removeGeometry.length),this._geometry.length),this._removeGeometry.length=0,this._removeGeometry.setTainted(!1)},set_geometry__:function(){for(const t of this.geometryNodes)t.setTessellationScale(1);this.geometryNodes.length=0;for(const t of this._geometry){const e=f()(c().X3DNurbsSurfaceGeometryNode,t);e&&this.geometryNodes.push(e)}this.set_tessellationScale__()},dispose:function(){ye().prototype.dispose.call(this),Ht().prototype.dispose.call(this)}});const Ce=be;_().set("x_ite/Components/NURBS/NurbsSet",Ce);const Ne=Ce,Se=window[Symbol.for("X_ITE.X3D-8.6.6")].require("standard/Math/Geometry/Line3");var Oe=t.n(Se);const De={isPointInTriangle:function(t,e,n,i){const o=(e.y-n.y)*(t.x-n.x)+(n.x-e.x)*(t.y-n.y);if(0==o)return!1;const s=((e.y-n.y)*(i.x-n.x)+(n.x-e.x)*(i.y-n.y))/o;if(s<0||s>1)return!1;const r=((n.y-t.y)*(i.x-n.x)+(t.x-n.x)*(i.y-n.y))/o;if(r<0||r>1)return!1;const u=1-s-r;return!(u<0||u>1)}};_().set("standard/Math/Geometry/Triangle2",De);const Pe=De;function Te(t){Ht().call(this,t),this.addType(c().NurbsSurfaceInterpolator),this.geometry=new ce(t)}Te.prototype=Object.assign(Object.create(Ht().prototype),{constructor:Te,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSurfaceInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){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__:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0),n=new(O())(0,0,0),i=new(O())(0,0,0),o=new(Oe())(O().Zero,O().zAxis),s={};return function(){const r=this._set_fraction.getValue(),u=this.geometry.getTexCoords(),l=this.geometry.getNormals(),a=this.geometry.getVertices();for(let h=0,d=0,c=u.length;h<c;h+=12,d+=9)if(t.set(u[h+0],u[h+1],0),e.set(u[h+4],u[h+5],0),n.set(u[h+7],u[h+9],0),Pe.isPointInTriangle(t,e,n,r)&&(o.set(i.set(r.x,r.y,0),O().zAxis),o.intersectsTriangle(t,e,n,s))){const t=s.u,e=s.v,n=s.t,i=new(O())(n*l[d+0]+t*l[d+3]+e*l[d+6],n*l[d+1]+t*l[d+4]+e*l[d+7],n*l[d+2]+t*l[d+5]+e*l[d+8]),o=new(O())(n*a[h+0]+t*a[h+4]+e*a[h+8],n*a[h+1]+t*a[h+5]+e*a[h+9],n*a[h+2]+t*a[h+6]+e*a[h+10]);this._normal_changed=i,this._position_changed=o}}}()});const Fe=Te;_().set("x_ite/Components/NURBS/NurbsSurfaceInterpolator",Fe);const Ie=Fe,Ve=window[Symbol.for("X_ITE.X3D-8.6.6")].require("x_ite/Components/Geometry3D/Extrusion");var xe=t.n(Ve);function Re(t){U.call(this,t),this.addType(c().NurbsSweptSurface),this.extrusion=new(xe())(t)}Re.prototype=Object.assign(Object.create(U.prototype),{constructor:Re,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSweptSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._crossSectionCurve.addInterest("set_crossSectionCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const t=this.extrusion;t._beginCap=!1,t._endCap=!1,t._solid=!0,t._ccw=!0,t._convex=!0,t._creaseAngle=Math.PI,t.setup(),t._crossSection.setTainted(!0),t._spine.setTainted(!0),this.set_crossSectionCurve__(),this.set_trajectoryCurve__()},set_crossSectionCurve__:function(){this.crossSectionCurveNode&&this.crossSectionCurveNode.removeInterest("requestRebuild",this),this.crossSectionCurveNode=f()(c().X3DNurbsControlCurveNode,this._crossSectionCurve),this.crossSectionCurveNode&&this.crossSectionCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__:function(){this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.removeInterest("requestRebuild",this),this.trajectoryCurveNode=f()(c().NurbsCurve,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.addInterest("requestRebuild",this)},build:function(){if(!this.crossSectionCurveNode)return;if(!this.trajectoryCurveNode)return;const t=this.extrusion;if(t._crossSection=this.crossSectionCurveNode.tessellate(0),t._spine=this.trajectoryCurveNode.tessellate(0),t.rebuild(),this.getColors().assign(t.getColors()),this.getTexCoords().assign(t.getTexCoords()),this.getNormals().assign(t.getNormals()),this.getVertices().assign(t.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const t=this.getNormals();for(let e=0,n=t.length;e<n;++e)t[e]=-t[e]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}});const ze=Re;_().set("x_ite/Components/NURBS/NurbsSweptSurface",ze);const je=ze;function ke(t){U.call(this,t),this.addType(c().NurbsSwungSurface),this.extrusion=new(xe())(t)}ke.prototype=Object.assign(Object.create(U.prototype),{constructor:ke,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSwungSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._profileCurve.addInterest("set_profileCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const t=this.extrusion;t._beginCap=!1,t._endCap=!1,t._solid=!0,t._ccw=!0,t._convex=!0,t._creaseAngle=Math.PI,t.setup(),t._crossSection.setTainted(!0),t._spine.setTainted(!0),this.set_profileCurve__(),this.set_trajectoryCurve__()},set_profileCurve__:function(){this.profileCurveNode&&this.profileCurveNode.removeInterest("requestRebuild",this),this.profileCurveNode=f()(c().X3DNurbsControlCurveNode,this._profileCurve),this.profileCurveNode&&this.profileCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__:function(){this.trajectoryCurveNode&&this.trajectoryCurveNode.removeInterest("requestRebuild",this),this.trajectoryCurveNode=f()(c().X3DNurbsControlCurveNode,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode.addInterest("requestRebuild",this)},build:function(){if(!this.profileCurveNode)return;if(!this.trajectoryCurveNode)return;const t=this.extrusion;if(t._crossSection=this.profileCurveNode.tessellate(0),t._spine=this.trajectoryCurveNode.tessellate(1),t.rebuild(),this.getColors().assign(t.getColors()),this.getTexCoords().assign(t.getTexCoords()),this.getNormals().assign(t.getNormals()),this.getVertices().assign(t.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const t=this.getNormals();for(let e=0,n=t.length;e<n;++e)t[e]=-t[e]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}});const Ae=ke;_().set("x_ite/Components/NURBS/NurbsSwungSurface",Ae);const Be=Ae;function Xe(t){h().call(this,t),this.addType(c().NurbsTextureCoordinate),this.controlPoints=[]}Xe.prototype=Object.assign(Object.create(h().prototype),{constructor:Xe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsTextureCoordinate"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"texCoord"},initialize:function(){h().prototype.initialize.call(this)},getControlPoints:function(t){const e=this._controlPoint.getValue(),n=this.controlPoints;for(let i=0,o=this._uDimension.getValue();i<o;++i){let s=n[i];s||(s=n[i]=[]);for(let n=0,r=this._vDimension.getValue();n<r;++n){const r=n*o+i,u=s[n]||new(X()),l=2*r;s[n]=u.set(e[l],e[l+1],0,t?t[r]:1)}}return n},isValid:function(){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())))}});const Ee=Xe;_().set("x_ite/Components/NURBS/NurbsTextureCoordinate",Ee);const qe=Ee;function Ke(t){ae.call(this,t),this.addType(c().NurbsTrimmedSurface),this.trimmingContourNodes=[]}function Me(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}Ke.prototype=Object.assign(Object.create(ae.prototype),{constructor:Ke,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),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))]),getTypeName:function(){return"NurbsTrimmedSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){ae.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__:function(){this._addTrimmingContour.setTainted(!0),this._addTrimmingContour.erase(Me(this._addTrimmingContour,0,this._addTrimmingContour.length,this._trimmingContour,0,this._trimmingContour.length),this._addTrimmingContour.length);for(const t of this._addTrimmingContour)this._trimmingContour.push(t);this._addTrimmingContour.length=0,this._addTrimmingContour.setTainted(!1)},set_removeTrimmingContour__:function(){this._removeTrimmingContour.setTainted(!0),this._trimmingContour.erase(Me(this._trimmingContour,0,this._trimmingContour.length,this._removeTrimmingContour,0,this._removeTrimmingContour.length),this._trimmingContour.length),this._removeTrimmingContour.length=0,this._removeTrimmingContour.setTainted(!1)},set_trimmingContour__:function(){const t=this.trimmingContourNodes;t.length=0;for(const e of this._trimmingContour){const n=f()(c().Contour2D,e);n&&t.push(n)}},getTrimmingContours:function(){const t=this.trimmingContourNodes,e=[];for(const n of t)n.addTrimmingContour(e);return e}});const Ue=Ke;_().set("x_ite/Components/NURBS/NurbsTrimmedSurface",Ue);const Ge=Ue;n().addComponent({name:"NURBS",types:{Contour2D:b,ContourPolyline2D:T,CoordinateDouble:R,NurbsCurve:Wt,NurbsCurve2D:Lt,NurbsOrientationInterpolator:oe,NurbsPatchSurface:ce,NurbsPositionInterpolator:me,NurbsSet:Ne,NurbsSurfaceInterpolator:Ie,NurbsSweptSurface:je,NurbsSwungSurface:Be,NurbsTextureCoordinate:qe,NurbsTrimmedSurface:Ge},abstractTypes:{X3DNurbsControlCurveNode:N,X3DNurbsSurfaceGeometryNode:ae,X3DParametricGeometryNode:U}});const We=void 0;_().set("assets/components/NURBS",We)})();
|
|
1
|
+
/* X_ITE v8.6.7 */(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components");var n=t.n(e);const i=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Fields");var o=t.n(i);const s=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Base/X3DFieldDefinition");var r=t.n(s);const u=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Base/FieldDefinitionArray");var l=t.n(u);const a=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Core/X3DNode");var h=t.n(a);const d=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Base/X3DConstants");var c=t.n(d);const g=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Base/X3DCast");var f=t.n(g);const p=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Namespace");var _=t.n(p);function m(t){h().call(this,t),this.addType(c().Contour2D),this.childNodes=[]}function w(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}m.prototype=Object.assign(Object.create(h().prototype),{constructor:m,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"Contour2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"trimmingContour"},initialize:function(){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__:function(){this._addChildren.setTainted(!0),this._addChildren.erase(w(this._addChildren,0,this._addChildren.length,this._children,0,this._children.length),this._addChildren.length);for(const t of this._addChildren)this._children.push(t);this._addChildren.length=0,this._addChildren.setTainted(!1)},set_removeChildren__:function(){this._removeChildren.setTainted(!0),this._children.erase(w(this._children,0,this._children.length,this._removeChildren,0,this._removeChildren.length),this._children.length),this._removeChildren.length=0,this._removeChildren.setTainted(!1)},set_children__:function(){const t=this.childNodes;t.length=0;for(const e of this._children){const n=f()(c().NurbsCurve2D,e);if(n)t.push(n);else{const n=f()(c().ContourPolyline2D,e);if(n){t.push(n);continue}}}},addTrimmingContour:function(t){for(const e of this.childNodes)t.push(e.tessellate(2))}});const y=m;_().set("x_ite/Components/NURBS/Contour2D",y);const b=y;function v(t){h().call(this,t),this.addType(c().X3DNurbsControlCurveNode)}v.prototype=Object.assign(Object.create(h().prototype),{constructor:v});const C=v;_().set("x_ite/Components/NURBS/X3DNurbsControlCurveNode",C);const N=C,S=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Numbers/Vector3");var O=t.n(S);function D(t){N.call(this,t),this.addType(c().ContourPolyline2D),this.controlPoints=[]}D.prototype=Object.assign(Object.create(N.prototype),{constructor:D,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"controlPoint",new(o().MFVec2d))]),getTypeName:function(){return"ContourPolyline2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},tessellate:function(t){switch(t){case 0:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i;e[n+0]=t[n+0],e[n+1]=t[n+1]}return e.length=2*n,e}case 1:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i,o=3*i;e[o+0]=t[n+0],e[o+1]=0,e[o+2]=t[n+1]}return e.length=3*n,e}case 3:{const t=this._controlPoint.getValue(),e=this.controlPoints,n=this._controlPoint.length;for(let i=0;i<n;++i){const n=2*i;e[i]=new(O())(t[n+0],t[n+1],0)}return e.length=n,e}}}});const P=D;_().set("x_ite/Components/NURBS/ContourPolyline2D",P);const T=P,F=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Rendering/X3DCoordinateNode");var I=t.n(F);function V(t){I().call(this,t),this.addType(c().CoordinateDouble)}V.prototype=Object.assign(Object.create(I().prototype),{constructor:V,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().inputOutput,"point",new(o().MFVec3d))]),getTypeName:function(){return"CoordinateDouble"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"coord"}});const x=V;_().set("x_ite/Components/NURBS/CoordinateDouble",x);const R=x,z=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Rendering/X3DGeometryNode");var j=t.n(z);const k=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Numbers/Vector2");var A=t.n(k);const B=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Numbers/Vector4");var X=t.n(B);const E={getTessellation:function(t,e){return t>0?t+1:t<0?-t*e+1:2*e+1},getClosed2D:function(t,e,n,i){const o=i.length;return(!(n.length===o)||n[0]===n[o-1])&&(!!i[0].equals(i[o-1])&&!!this.isPeriodic(t,o,e))},getClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s){const r=s.getSize();return(!(o.length===r)||o[0]===o[r-1])&&(!!s.get1Point(0,t).equals(s.get1Point(r-1,e))&&!!this.isPeriodic(n,r,i))}}(),getUClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s,r,u){const l=r.length===u.getSize();for(let n=0,s=o;n<s;++n){const o=n*i,s=n*i+i-1;if(l&&r[o]!==r[s])return!1;if(!u.get1Point(o,t).equals(u.get1Point(s,e)))return!1}return!!this.isPeriodic(n,i,s)}}(),getVClosed:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0);return function(n,i,o,s,r,u){const l=r.length===u.getSize();for(let n=0,s=i;n<s;++n){const s=n,a=(o-1)*i+n;if(l&&r[s]!==r[a])return!1;if(!u.get1Point(s,t).equals(u.get1Point(a,e)))return!1}return!!this.isPeriodic(n,o,s)}}(),isPeriodic:function(t,e,n){if(n.length===e+t){{let e=1;for(let i=1,o=t;i<o;++i)e+=n[i]===n[0];if(e===t)return!1}{let e=1;for(let i=n.length-t,o=n.length-1;i<o;++i)e+=n[i]===n[o];if(e===t)return!1}}return!0},getKnots:function(t,e,n,i,o){const s=t||[];for(let t=0,e=o.length;t<e;++t)s[t]=o[t];s.length=o.length;let r=!0;if(s.length===i+n){r=!1;let t=0;for(let e=1,i=s.length;e<i;++e)s[e]==s[e-1]?++t:t=0,t>n-1&&(r=!0),s[e-1]>s[e]&&(r=!0)}if(r)for(let t=0,e=i+n;t<e;++t)s[t]=t/(e-1);if(e)for(let t=1,e=n-1;t<e;++t)s.push(s.at(-1)+(s[t]-s[t-1]));return s},getWeights:function(t,e,n){if(n.length!==e)return;const i=t||[];for(let t=0;t<e;++t)i[t]=n[t];return i.length=e,i},getUVWeights:function(t,e,n,i){const o=e*n;if(i.length!==o)return;const s=t||[];for(let t=0,o=0;t<e;++t)for(let t=0;t<n;++t,++o)s[o]=i[o];return s.length=o,s},getControlPoints2D:function(t,e,n,i,o){const s=t||[],r=o.getValue(),u=o.length,l=Boolean(i),a=l?O():A();s.haveWeights!==l&&(s.haveWeights=l,s.length=0);for(let t=0;t<u;++t){const e=2*t,n=s[t]||new a(0,0,0);s[t]=n.set(r[e+0],r[e+1],l?i[t]:0)}if(s.length=u,e)for(let t=1,e=n-1;t<e;++t)s.push(s[t]);return s},getControlPoints:function(t,e,n,i,o){const s=t||[],r=o.getSize(),u=Boolean(i),l=u?X():O();s.haveWeights!==u&&(s.haveWeights=u,s.length=0);for(let t=0;t<r;++t){const e=s[t]=o.get1Point(t,s[t]||new l(0,0,0,0));u&&(e.w=i[t])}if(s.length=r,e)for(let t=1,e=n-1;t<e;++t)s.push(s[t]);return s},getUVControlPoints:function(t,e,n,i,o,s,r,u,l){const a=t||[],h=Boolean(u),d=h?X():O();a.haveWeights!==h&&(a.haveWeights=h,a.length=0);for(let t=0;t<s;++t){let e=a[t];e||(e=a[t]=[]);for(let n=0;n<r;++n){const i=n*s+t;e[n]=l.get1Point(i,e[n]||new d(0,0,0,0)),h&&(e[n].w=u[i])}if(e.length=r,n)for(let t=1,n=o-1;t<n;++t)e.push(e[t])}if(a.length=s,e)for(let t=1,e=i-1;t<e;++t)a.push(a[t]);return a},getTexControlPoints:function(t,e,n,i,o,s,r,u){const l=t||[];for(let t=0;t<s;++t){let e=l[t];e||(e=l[t]=[]);for(let n=0;n<r;++n){const i=n*s+t;e[n]=u.get1Point(i,e[n]||new(X())(0,0,0,0))}if(e.length=r,n)for(let t=1,n=o-1;t<n;++t)e.push(e[t])}if(l.length=s,e)for(let t=1,e=i-1;t<e;++t)l.push(l[t]);return l}};_().set("x_ite/Browser/NURBS/NURBS",E);const q=E;function K(t){j().call(this,t),this.addType(c().X3DParametricGeometryNode)}K.prototype=Object.assign(Object.create(j().prototype),{constructor:K,getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)}});const M=K;_().set("x_ite/Components/NURBS/X3DParametricGeometryNode",M);const U=M,G=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Rendering/X3DLineGeometryNode");var W=t.n(G);const Y=function(t){return!!t&&(!!t.dtype&&new RegExp("function View[0-9]+d(:?"+t.dtype+")+").test(String(t.constructor)))};_().set("lib/nurbs/src/utils/is-ndarray",Y);const J=Y,L=function(t){return!!t&&(void 0!==t.data&&Array.isArray(t.shape)&&void 0!==t.offset&&void 0!==t.stride)};_().set("lib/nurbs/src/utils/is-ndarray-like",L);const Z=L,H=function(t){return Array.isArray(t)||ArrayBuffer.isView(t)||void 0!==t.length};_().set("lib/nurbs/src/utils/is-array-like",H);const Q=H;function $(t){if(t){if(J(t)||Z(t))return"generic"===t.dtype?$.GENERIC_NDARRAY:$.NDARRAY;if(Q(t)){for(var e=t;Q(e[0]);e=e[0]);return"x"in e?$.ARRAY_OF_OBJECTS:$.ARRAY_OF_ARRAYS}throw new Error("Unhandled data type. Got type: "+typeof t)}}$.ARRAY_OF_OBJECTS="Obj",$.ARRAY_OF_ARRAYS="Arr",$.NDARRAY="Nd",$.GENERIC_NDARRAY="GenNd",$.PACKED="PackArr";const tt=$;_().set("lib/nurbs/src/utils/infer-type",tt);const et=tt;const nt=function(t,e,n,i,o,s){var r,u,l=[],a=!1;for(r=0;r<t.splineDimension;r++){var h=Q(t.knots)&&Q(t.knots[r]);h&&(a=!0),l.push("Deg"+t.degree[r]+(h?"":"Uniform")+((u=t.boundary[r])[0].toUpperCase()+u.slice(1)))}var d=[[a?"NU":"",t.weights?"RBS":"BS"].join("")+t.dimension+"D",l.join("_")];return i&&d.push(i+"Pts"),o&&d.push(o+"Wts"),s&&d.push(s+"Kts"),e&&d.push("debug"),n&&d.push("chk"),d.join("_")};_().set("lib/nurbs/src/utils/cache-key",nt);const it=nt;var ot=function t(e,n){return function(n,i){void 0===n||Array.isArray(n)||(n=[n]);for(var o=[],s=0;s<n.length;s++)o.push(t.sum(n[s]));if(i)for(n=0;n<o.length;n++)void 0!==i[n]&&(o[n]="("+o[n]+" + "+i[n]+") % "+i[n]);return e+o.join("_")}};ot.sum=function(t){return 0===(t=(t=Array.isArray(t)?t:[t]).filter((function(t){return void 0!==t&&0!==t}))).length&&t.push(0),t.join(" + ")};const st=ot;_().set("lib/nurbs/src/utils/variable",st);const rt=st;var ut=[".x",".y",".z",".w"];function lt(t){return function(e,n){void 0===e||Array.isArray(e)||(e=[e]);for(var i=[],o=0;o<e.length;o++)i.push(rt.sum(e[o]));if(n)for(e=0;e<i.length;e++)void 0!==n[e]&&(i[e]="("+i[e]+" + "+n[e]+") % "+n[e]);return t(i)}}function at(t,e){if(e)switch(et(e)){case et.ARRAY_OF_OBJECTS:return lt((function(e){var n=e.pop();return t+"["+e.join("][")+"]"+ut[n]}));case et.ARRAY_OF_ARRAYS:return lt((function(e){return t+"["+e.join("][")+"]"}));case et.GENERIC_NDARRAY:return lt((function(e){return t+".get("+e.join(",")+")"}));case et.NDARRAY:return lt((function(e){for(var n=[t+"Offset"],i=0;i<e.length;i++)n.push(t+"Stride"+i+" * ("+e[i]+")");return t+"["+n.join(" + ")+"]"}));case et.PACKED:default:return}}const ht=function(t){var e,n={};return(e=at("x",t.points))&&(n.point=e),(e=at("w",t.weights))&&(n.weight=e),(e=at("k",t.knots))&&(n.knot=e),n};_().set("lib/nurbs/src/utils/create-accessors",ht);const dt=ht;var ct=[],gt=[];const ft=function(t,e,n){if(1!==e)throw new Error("Numerical derivative not implemented for order n = "+e+".");var i,o=void 0===arguments[this.splineDimension+3]?1e-4:arguments[this.splineDimension+3];for(ct.length=this.splineDimension,i=0;i<this.splineDimension;i++)ct[i+1]=arguments[i+3];var s,r,u,l=this.domain,a=l[n][0],h=l[n][1],d=ct[n+1],c=(h-a)*o;for("closed"===this.boundary[n]?(s=a+(d-a-c+(u=h-a))%u,r=a+(d-a+c+u)%u,c*=2):(s=Math.min(h,Math.max(a,d-c)),c=(r=Math.min(h,Math.max(a,d+c)))-s),ct[n+1]=s,ct[0]=gt,this.evaluate.apply(null,ct),ct[n+1]=r,ct[0]=t,this.evaluate.apply(null,ct),i=0;i<this.dimension;i++)t[i]=(t[i]-gt[i])/c;return t};_().set("lib/nurbs/src/numerical-derivative",ft);const pt=ft,_t=function(t,e){for(var n=1,i=0,o=[];i<t.length;i++)n*=Array.isArray(t[i])?t[i][1]-t[i][0]:t[i],o[i]=Array.isArray(t[i])?t[i][0]:0;for(var s=0;s<n;s++)for(e(o.slice()),i=t.length-1;i>=0;i--){if(o[i]!==(Array.isArray(t[i])?t[i][1]:t[i])-1){o[i]++;break}o[i]=Array.isArray(t[i])?t[i][0]:0}};_().set("lib/nurbs/src/utils/ndloop",_t);const mt=_t,wt=function(t,e,n,i){var o=[];switch(et(i)){case et.NDARRAY:o.push(" var "+e+" = "+n+".data;"),o.push(" var "+e+"Offset = "+n+".offset;");for(var s=0;s<i.dimension;s++)o.push(" var "+e+"Stride"+s+" = "+n+".stride["+s+"];");break;case et.ARRAY_OF_OBJECTS:case et.ARRAY_OF_ARRAYS:o.push(" var "+e+" = "+n+";")}return o.join("\n")};_().set("lib/nurbs/src/utils/accessor-preamble",wt);const yt=wt,bt=function(t,e,n){if(t){if(Z(t))return e+".shape["+n+"]";for(var i=e,o=0;o<n;o++)i+="[0]";return i+".length"}return"this.size["+n+"]"};_().set("lib/nurbs/src/utils/size-getter",bt);const vt=bt;var Ct={},Nt={};const St=function(t,e,n,i,o,s,r){var u,l,a,h,d,c,g=e.splineDimension,f=e.points,p=e.degree,_=e.weights,m=void 0!==_,w=e.knots,y=e.dimension,b=e.boundary;if(null!=r){Array.isArray(r)||(r=[r]);var v=0;for(u=0;u<g;u++)void 0===r[u]&&(r[u]=0),v+=r[u];if(m&&v>1)throw new Error("Analytical derivative not implemented for rational b-splines with order n = "+v+".")}s&&(t="Basis"+t),r&&(t="Der"+r.join("_")+"_"+t);var C=Ct[t];if(i)var N="function"==typeof i?i:console.log;if(C)return i&&N(Nt[t]),C.bind(e);var S=[],O="evaluate"+t,D=n.point;s&&(D=function(t,e){for(var n=[],i=0;i<t.length;i++){for(var o=t[i],s=[],r=0;r<o.length;r++)0!==o[r]&&s.push(o[r]);o=s.join(" + "),e[i]&&(o="("+o+" + "+e[i]+") % "+e[i]),n.push(o+" === "+x(i))}return"(("+n.join(" && ")+") ? 1 : 0)"});var P=n.weight,T=n.knot,F=rt("k"),I=rt("x"),V=rt("w"),x=rt("i"),R=rt("t"),z=i?"domain":"d",j=rt(i?"size":"s"),k=rt(i?"knotIndex":"j"),A=!0;for(d=0;d<g;d++)Q(w)&&Q(w[d])&&(A=!1);function B(t){S.push(" "+(t||""))}function X(t){i&&B(t)}if(s)var E=[];var q=[];for(u=0;u<g;u++)s&&E.push(x([u])),q.push(R([u]));for(S.push("function "+O+" ("+(s?"":"out, ")+q.join(", ")+(s?", "+E.join(", "):"")+") {"),B("var h, m, a, b;"),o&&(B("var "+z+" = this.domain;"),B("for (var i = 0; i < this.splineDimension; i++) {"),B(" a = arguments[i + 1];"),B(" if (a < "+z+"[i][0] || a > "+z+"[i][1] || a === undefined || isNaN(a)) {"),B(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+z+'[i][0]+", "+'+z+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),B(" }"),B("}")),d=0;d<g;d++)B("var "+j(d)+" = "+vt(f,"this.points",d)+";");function K(t,e,n){return"("+t+") ? ("+e+") : ("+n+")"}S.push(yt(e,"x","this.points",f)),m&&S.push(yt(e,"w","this.weights",_)),A||S.push(yt(e,"k","this.knots",w));var M=[];for(d=0;d<g;d++)switch(et(w)){case et.NDARRAY:M[d]=!0;break;case et.ARRAY_OF_ARRAYS:M[d]=Q(w[d])}for(d=0;d<g;d++)if(M[d])for(X("\n // Bisect to locate the knot interval in dimension "+d+"\n"),B("var "+k(d)+" = 0;"),B("h = "+j(d)+";"),B("while(h > "+k(d)+" + 1) {"),B(" m = 0.5 * (h + "+k(d)+") | 0;"),B(" if ("+T([d,"m"])+" > "+R(d)+") h = m;"),B(" else "+k(d)+" = m;"),B("}"),X("\n // Fetch knots for dimension "+d+"\n"),u=1-p[d];u<=p[d];u++)"closed"===b[d]?B(u<0?"var "+F([d,u+p[d]-1])+" = "+K(k(d)+" < "+-u,T([d,0])+" + "+T([d,[j(d),k(d),u]])+" - "+T([d,[j(d)]]),T([d,[k(d),u]]))+";":u>0?"var "+F([d,u+p[d]-1])+" = "+K(k(d)+" + "+u+" > "+j(d),T([d,j(d)])+" + "+T([d,u+" + "+k(d)+" - "+j(d)])+" - "+T([d,0]),T([d,[k(d),u]]))+";":"var "+F([d,u+p[d]-1])+" = "+T([d,[k(d),u]])+";"):B("var "+F([d,u+p[d]-1])+" = "+T([d,[k(d),u]])+";");else{for(X("\n // Directly compute knot interval for dimension "+d+"\n"),"closed"===b[d]?B(k(d)+" = ("+R(d)+" | 0) % "+j(d)+";"):(B(k(d)+" = ("+R(d)+" | 0);"),B("if ("+k(d)+" < "+p[d]+") "+k(d)+" = "+p[d]+";"),B("if ("+k(d)+" > "+j(d)+" - 1) "+k(d)+" = "+j(d)+" - 1;")),X("\n // Compute and clamp knots for dimension "+d+"\n"),u=1-p[d];u<=p[d];u++)B("var "+(c=F([d,u+p[d]-1]))+" = "+k(d)+" + "+u+";");if("clamped"===b[d])for(u=1-p[d];u<=p[d];u++)c=F([d,u+p[d]-1]),u<0&&B("if ("+c+" < "+p[d]+") "+c+" = "+p[d]+";"),u>0&&B("if ("+c+" > "+j(d)+") "+c+" = "+j(d)+";");"closed"===b[d]&&(X("\n // Wrap the B-Spline parameter for closed boundary"),B(R(d)+" %= "+j(d)+";"))}for(d=0,a=[];d<g;d++)a[d]=p[d]+1;for(m&&(X("\n // Fetch weights\n"),mt(a,(function(t){for(var e=[],n=[],i=0;i<g;i++)e[i]=[k(i),t[i]-p[i]],"closed"===b[i]&&t[i]-p[i]<0&&(n[i]=j(i));B("var "+V(t)+" = "+P(e,n)+";")}))),i&&B(m?"\n // Fetch points and project into homogeneous (weighted) coordinates\n":"\n // Fetch points\n"),mt(a,(function(t){for(var e=[],n=[],i=0;i<g;i++)e[i]=[k(i),t[i]-p[i]],"closed"===b[i]&&t[i]-p[i]<0&&(n[i]=j(i));if(s)B(m?"var "+I(t)+" = "+D(e,n)+" * "+V(t)+";":"var "+I(t)+" = "+D(e,n)+";");else for(i=0;i<y;i++){var o=t.concat(i);e[g]=i,B(m?"var "+I(o)+" = "+D(e,n)+" * "+V(t)+";":"var "+I(o)+" = "+D(e,n)+";")}})),X("\n"),X('// Perform De Boor"s algorithm'),d=a.length-1;d>=0;d--)for(a[d]=[p[d],p[d]+1],u=0;u<p[d];u++)for(X("\n // Degree "+p[d]+" evaluation in dimension "+d+", step "+(u+1)+"\n"),l=p[d];l>u;l--){var U=r&&p[d]-u-r[d]<=0;U?(B("m = 1 / ("+F([d,l-u+p[d]-1])+" - "+F([d,l-1])+");"),m&&(B("a = ("+R(d)+" - "+F([d,l-1])+") * m;"),B("b = 1 - a;"))):(B("a = ("+R(d)+" - "+F([d,l-1])+") / ("+F([d,l-u+p[d]-1])+" - "+F([d,l-1])+");"),B("b = 1 - a;")),m&&mt(a,(function(t){var e=t.slice(),n=t.slice();e[d]=l,n[d]=l-1,U&&m&&B("h = "+V(e)+";"),B(V(e)+" = b * "+V(n)+" + a * "+V(e)+";")})),mt(a,(function(t){var e,n,i,o=t.slice(),r=t.slice();if(o[d]=l,r[d]=l-1,U){var a=u+1;if(s)e=m?"h * "+V(r)+" / "+V(o)+" * ":"",n=I(o)+(m?" / h":""),i=I(r)+(m?" / "+V(r):""),B(I(o)+" = "+a+" * "+e+"("+n+" - "+i+") * m;");else{var c=o.slice(),f=r.slice();for(h=0;h<y;h++)c[g]=f[g]=h,e=m?"h * "+V(r)+" / "+V(o)+" * ":"",n=I(c)+(m?" / h":""),i=I(f)+(m?" / "+V(r):""),B(I(c)+" = "+a+" * "+e+"("+n+" - "+i+") * m;")}}else if(s)B(I(o)+" = b * "+I(r)+" + a * "+I(o)+";");else for(h=0;h<y;h++)o[g]=r[g]=h,B(I(o)+" = b * "+I(r)+" + a * "+I(o)+";")})),X("\n")}if(i&&B(m?"\n // Project back from homogeneous coordinates and return final output\n":"\n // Return final output\n"),s)B(m?"return "+I(p)+" / "+V(p)+";":"return "+I(p)+";");else for(d=0;d<y;d++)B(m?"out["+d+"] = "+I(p.concat([d]))+" / "+V(p)+";":"out["+d+"] = "+I(p.concat([d]))+";");if(s||B("return out;"),S.push("}"),i){var G=S.join("\n");N(G),Nt[t]=G}var W=new Function([S.join("\n"),"; return ",O].join(""))();return Ct[t]=W,W.bind(e)};_().set("lib/nurbs/src/evaluate",St);const Ot=St;var Dt={};const Pt=function(t,e,n,i){var o,s,r,u,l,a,h,d,c=Dt[t];if(c)return c.bind(e);var g=[],f="transform"+t;g.push("function "+f+"(m) {"),g.push("var i, w;"),g.push(yt(e,"x","this.points",e.points));var p=rt(i?"size":"s");for(o=0;o<e.splineDimension;o++)g.push("var "+p(o)+" = "+vt(e.points,"this.points",o)+";");for(u=[],o=0;o<e.splineDimension;o++)r="i"+o,u.push(r),g.push("for ("+r+" = "+p(o)+"- 1; "+r+" >= 0; "+r+"--) {");for(o=0;o<e.dimension;o++)g.push("x"+o+" = "+n.point(u.concat([o])));for(l=[],o=0;o<e.dimension;o++)l.push("m["+((e.dimension+1)*(o+1)-1)+"] * x"+o);for(l.push("m["+((e.dimension+1)*(e.dimension+1)-1)+"]"),g.push("var w = ("+l.join(" + ")+") || 1.0;"),o=0;o<e.dimension;o++){for(l=[],a=e.dimension,s=0;s<a;s++)l.push("m["+(s*(a+1)+o)+"] * x"+s);l.push("m["+(s*(a+1)+o)+"]"),d=n.point(u.concat([o])),h="("+l.join(" + ")+") / w",g.push(d+" = "+h+";")}for(o=e.splineDimension-1;o>=0;o--)g.push("}");g.push("return this;"),g.push("}");var _=new Function([g.join("\n"),"; return ",f].join(""))();return i&&console.log(g.join("\n")),Dt[t]=_,_.bind(e)};_().set("lib/nurbs/src/transform",Pt);const Tt=Pt;var Ft={};const It=function(t,e,n,i,o){var s=Ft[t];if(s)return s.bind(e);var r,u,l,a=e.degree,h=e.knots,d=e.splineDimension,c=e.boundary,g=[],f="support"+t,p=n.knot,_=rt("t"),m=i?"domain":"d",w=rt(i?"size":"s"),y=rt(i?"knotIndex":"i"),b=!0;for(l=0;l<d;l++)Q(h)&&Q(h[l])&&(b=!1);function v(t){g.push(" "+(t||""))}var C=[];for(r=0;r<d;r++)C.push(_([r]));g.push("function "+f+" (out, "+C.join(", ")+") {");var N=0;function S(t,e){v(void 0===e?"out["+N+++"] = "+t.join(" + ")+";":"out["+N+++"] = ("+t.join(" + ")+" + "+e+") % "+e+";")}for(v("var h, m;"),v("var c = 0;"),o&&(v("var "+m+" = this.domain;"),v("for (var i = 0; i < this.splineDimension; i++) {"),v(" a = arguments[i + 1];"),v(" if (a < "+m+"[i][0] || a > "+m+"[i][1] || a === undefined || isNaN(a)) {"),v(' throw new Error("Invalid Spline parameter in dimension "+i+". Valid domain is ["+'+m+'[i][0]+", "+'+m+'[i][1]+"]. but got t"+i+" = "+arguments[i + 1]+".");'),v(" }"),v("}")),l=0;l<d;l++)v("var "+w(l)+" = "+vt(e.points,"this.points",l)+";");b||g.push(yt(e,"k","this.knots",h));var O=[];for(l=0;l<d;l++)switch(et(h)){case et.NDARRAY:O[l]=!0;break;case et.ARRAY_OF_ARRAYS:O[l]=Q(h[l])}for(l=0;l<d;l++)O[l]?(v("var "+y(l)+" = 0;"),v("h = "+w(l)+";"),v("while(h > "+y(l)+" + 1) {"),v(" m = 0.5 * (h + "+y(l)+") | 0;"),v(" if ("+p([l,"m"])+" > "+_(l)+") h = m;"),v(" else "+y(l)+" = m;"),v("}")):"closed"===c[l]?v(y(l)+" = ("+_(l)+" | 0) % "+w(l)+";"):(v(y(l)+" = ("+_(l)+" | 0);"),v("if ("+y(l)+" < "+a[l]+") "+y(l)+" = "+a[l]+";"),v("if ("+y(l)+" > "+w(l)+" - 1) "+y(l)+" = "+w(l)+" - 1;"));for(l=0,u=[];l<d;l++)u[l]=a[l]+1;mt(u,(function(t){for(var e=[],n=[],i=0;i<d;i++)e[i]=[y(i),t[i]-a[i]],"closed"===c[i]&&t[i]-a[i]<0&&(n[i]=w(i));for(i=0;i<d;i++)S(e[i],n[i])})),v("out.length = "+N+";"),v("return out;"),g.push("}"),i&&console.log(g.join("\n"));var D=new Function([g.join("\n"),"; return ",f].join(""))();return Ft[t]=D,D.bind(e)};_().set("lib/nurbs/src/support",It);const Vt=It,xt=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Geometry/Triangle3");var Rt=t.n(xt),zt=[];const jt=function(t,e,n){n=n||{};var i=(t=t||{}).points=t.points||[],o=t.faces=t.faces||[],s=n.haveWeights,r=e.dimension-s;if(Array.isArray(n.resolution))var u=n.resolution;else{var l=void 0===n.resolution?31:n.resolution;u=new Array(e.splineDimension).fill(l)}switch(e.splineDimension){case 1:for(var a=(_=(w=u[0])+!(b="closed"===e.boundary[0]))*r,h=(C=(m=n.domain||e.domain)[0])[1]-C[0],d=0;d<_;++d){var c=C[0]+h*d/w,g=d*r;if(e.evaluate(zt,c),s)for(var f=zt[r],p=0;p<r;++p)i[g+p]=zt[p]/f;else for(p=0;p<r;++p)i[g+p]=zt[p]}i.length=a;break;case 2:var _,m,w=u[0],y=u[1],b="closed"===e.boundary[0],v=y+!(P="closed"===e.boundary[1]),C=(a=(_=w+!b)*v*r,(m=n.domain||e.domain)[0]),N=m[1],S=(h=C[1]-C[0],N[1]-N[0]);for(d=0;d<_;++d){c=C[0]+h*d/w;for(var O=0;O<v;++O){var D=N[0]+S*O/y;g=(d+_*O)*r;if(e.evaluate(zt,c,D),s)for(f=zt[r],p=0;p<r;++p)i[g+p]=zt[p]/f;else for(p=0;p<r;++p)i[g+p]=zt[p]}}i.length=a;b=n.closed[0];var P=n.closed[1],T=0;for(d=0;d<w;++d){var F=d,I=d+1;b&&(I%=w);for(O=0;O<y;++O){var V=O,x=O+1;P&&(x%=y),o[T++]=F+_*V,o[T++]=I+_*V,o[T++]=I+_*x,o[T++]=F+_*V,o[T++]=I+_*x,o[T++]=F+_*x}}o.length=T;break;default:throw new Error("Can only sample contours and surfaces")}return t};_().set("lib/nurbs/extras/sample",jt);const kt=jt;var At={open:"open",closed:"closed",clamped:"clamped"};function Bt(t){return null==t}function Xt(t,e,n,i,o,s){var r,u;!t||Q(t)||J(t)?(s=s||{},this.weights=i,this.knots=n,this.degree=e,this.points=t,this.boundary=o,this.debug=s.debug,this.checkBounds=!!s.checkBounds,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0})):(s=t,this.debug=t.debug,this.checkBounds=!!t.checkBounds,this.weights=t.weights,this.knots=t.knots,this.degree=t.degree,this.boundary=t.boundary,this.points=t.points,Object.defineProperty(this,"size",{value:s.size,writable:!0,configurable:!0}));var l=et(this.points),a=et(this.weights),h=et(this.knots);if(this.points)switch(l){case et.GENERIC_NDARRAY:case et.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 et.ARRAY_OF_OBJECTS:case et.ARRAY_OF_ARRAYS:var d=0,c=this.size||[];c.length=0;for(var g=this.points;Q(g[0]);g=g[0])d++,c.push(g.length);if(0===d)throw new Error("Expected an array of points");Object.defineProperties(this,{splineDimension:{value:d,writable:!1,configurable:!0},dimension:{value:g.length,writable:!1,configurable:!0},size:{get:function(){var t=[];t.length=0;for(var e=0,n=this.points;e<this.splineDimension;e++,n=n[0])t[e]=n.length;return t},set:function(){throw new Error('Cannot assign to read only property "size"')},configurable:!0}});break;case et.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(Bt(this.degree[r]))throw new Error("Missing degree in dimension "+(r+1))}else{var f=!Bt(this.degree),p=Bt(this.degree)?2:this.degree;for(this.degree=[],r=0;r<this.splineDimension;r++)if(this.size[r]<=p){if(f)throw new Error("Expected at least "+(p+1)+" points for degree "+p+" spline in dimension "+(r+1)+" but got only "+this.size[r]);this.degree[r]=this.size[r]-1}else this.degree[r]=p}if(u="string"!=typeof this.boundary?"open":this.boundary,!At[u])throw new Error("Boundary type must be one of "+Object.keys(At)+". Got "+u);for(this.boundary=Q(this.boundary)?this.boundary:[],this.boundary.length=this.splineDimension,r=0;r<this.splineDimension;r++)if(this.boundary[r]=Bt(this.boundary[r])?u:this.boundary[r],!At[u])throw new Error("Boundary type must be one of "+Object.keys(At)+". Got "+u+" for dimension "+(r+1));switch(h){case et.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 et.NDARRAY:}var _=it(this,this.debug,this.checkBounds,l,a,h);if(_!==this.__cacheKey){this.__cacheKey=_;var m=dt(this);this.evaluate=Ot(this.__cacheKey,this,m,this.debug,this.checkBounds,!1),this.transform=Tt(this.__cacheKey,this,m,this.debug),this.support=Vt(this.__cacheKey,this,m,this.debug,this.checkBounds),this.evaluator=function(t,e){return Ot(this.__cacheKey,this,m,this.debug,this.checkBounds,e,t)}}return this.numericalDerivative=pt.bind(this),this}function Et(){var t,e=[],n=this.points;n?Z(n)&&(t=n.shape):t=this.size;for(var i=0;i<this.splineDimension;i++){var o=t?t[i]:n.length,s=this.degree[i],r="closed"===this.boundary[i];if(this.knots&&this.knots[i]){var u=this.knots[i];e[i]=[u[r?0:s],u[o]]}else e[i]=[r?0:s,o];n&&(n=n[0])}return e}function qt(t,e,n,i,o,s){var r=function(t,e,n,i,o,s){return u(t,e,n,i,o,s),r},u=Xt.bind(r);return Object.defineProperty(r,"domain",{get:Et}),u(t,e,n,i,o,s),r}qt.sample=kt;const Kt=qt;_().set("lib/nurbs/nurbs",Kt);const Mt=Kt;function Ut(t){U.call(this,t),W().call(this,t),this.addType(c().NurbsCurve),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]}}Ut.prototype=Object.assign(Object.create(U.prototype),W().prototype,{constructor:Ut,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsCurve"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_controlPoint__()},set_controlPoint__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},getTessellation:function(t){return q.getTessellation(this._tessellation.getValue(),t-this._order.getValue())},getClosed:function(t,e,n,i){return!!this._closed.getValue()&&q.getClosed(t,e,n,i)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},tessellate:function(){if(this._order.getValue()<2)return[];if(!this.controlPointNode)return[];if(this.controlPointNode.getSize()<this._order.getValue())return[];const t=this.getVertices(),e=[];if(t.length){const n=t.length;for(let i=0;i<n;i+=8)e.push(t[i],t[i+1],t[i+2]);e.push(t[n-4],t[n-3],t[n-2])}return e},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=(i.at(-1),i[0],this._order.getValue()-1),s=this.surface=(this.surface||Mt)({boundary:["open"],degree:[o],knots:[i],points:n,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(i.length),this.sampleOptions.haveWeights=Boolean(e);const r=Mt.sample(this.mesh,s,this.sampleOptions).points,u=this.getVertices();for(let t=3,e=r.length;t<e;t+=3){const e=t-3;u.push(r[e],r[e+1],r[e+2],1),u.push(r[t],r[t+1],r[t+2],1)}},dispose:function(){U.prototype.dispose.call(this)}});const Gt=Ut;_().set("x_ite/Components/NURBS/NurbsCurve",Gt);const Wt=Gt;function Yt(t){N.call(this,t),this.addType(c().NurbsCurve2D),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[]},this.array=[]}Yt.prototype=Object.assign(Object.create(N.prototype),{constructor:Yt,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsCurve2D"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},getTessellation:function(t){return q.getTessellation(this._tessellation.getValue(),t-this._order.getValue())},getClosed:function(t,e,n,i){return!!this._closed.getValue()&&q.getClosed2D(t,e,n,i)},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints2D(t,e,n,i,o)},tessellate:function(t){const e=this.array;if(e.length=0,this._order.getValue()<2)return e;if(this._controlPoint.length<this._order.getValue())return e;const n=this.getClosed(this._order.getValue(),this._knot,this._weight,this._controlPoint),i=this.getWeights(this.weights,this._controlPoint.length,this._weight),o=this.getControlPoints(this.controlPoints,n,this._order.getValue(),i,this._controlPoint),s=this.getKnots(this.knots,n,this._order.getValue(),this._controlPoint.length,this._knot),r=(s.at(-1),s[0],this._order.getValue()-1),u=this.surface=(this.surface||Mt)({boundary:["open"],degree:[r],knots:[s],points:o,debug:!1});this.sampleOptions.resolution[0]=this.getTessellation(s.length),this.sampleOptions.haveWeights=Boolean(i);const l=Mt.sample(this.mesh,u,this.sampleOptions).points;switch(t){case 0:for(let t=0,n=l.length;t<n;t+=2)e.push(l[t],l[t+1]);break;case 1:for(let t=0,n=l.length;t<n;t+=2)e.push(l[t],0,l[t+1]);break;case 2:for(let t=0,n=l.length;t<n;t+=2)e.push(new(O())(l[t],l[t+1],0))}return e}});const Jt=Yt;_().set("x_ite/Components/NURBS/NurbsCurve2D",Jt);const Lt=Jt,Zt=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Core/X3DChildNode");var Ht=t.n(Zt);const Qt=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Interpolation/OrientationInterpolator");var $t=t.n(Qt);const te=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Numbers/Rotation4");var ee=t.n(te);function ne(t){Ht().call(this,t),this.addType(c().NurbsOrientationInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new($t())(t),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}ne.prototype=Object.assign(Object.create(Ht().prototype),{constructor:ne,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsOrientationInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().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__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:function(t,e,n,i){return!1},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},requestRebuild:function(){this._rebuild.addEvent()},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),o=i.at(-1)-i[0],s=this._order.getValue()-1,r=this.surface=(this.surface||Mt)({boundary:["open"],degree:[s],knots:[i],points:n,debug:!1});this.sampleOptions.haveWeights=Boolean(e);const u=Mt.sample(this.mesh,r,this.sampleOptions).points,l=this.interpolator;l._key.length=0,l._keyValue.length=0;for(let e=0,n=u.length-3;e<n;e+=3){const s=new(O())(u[e+3]-u[e+0],u[e+4]-u[e+1],u[e+5]-u[e+2]);l._key.push(i[0]+e/(n-3+3*t)*o),l._keyValue.push(new(ee())(O().zAxis,s))}t&&(l._key.push(i[0]+o),l._keyValue.push(l._keyValue[0]))}});const ie=ne;_().set("x_ite/Components/NURBS/NurbsOrientationInterpolator",ie);const oe=ie,se=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Algorithm");var re=t.n(se);function ue(t){U.call(this,t),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={}}ue.prototype=Object.assign(Object.create(U.prototype),{constructor:ue,initialize:function(){U.prototype.initialize.call(this),this._texCoord.addInterest("set_texCoord__",this),this._controlPoint.addInterest("set_controlPoint__",this),this.set_texCoord__(),this.set_controlPoint__()},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("requestRebuild",this),this.nurbsTexCoordNode&&this.nurbsTexCoordNode.removeInterest("requestRebuild",this),this.texCoordNode=f()(c().X3DTextureCoordinateNode,this._texCoord),this.nurbsTexCoordNode=f()(c().NurbsTextureCoordinate,this._texCoord),this.texCoordNode&&this.texCoordNode.addInterest("requestRebuild",this),this.nurbsTexCoordNode&&this.nurbsTexCoordNode.addInterest("requestRebuild",this)},set_controlPoint__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this)},setTessellationScale:function(t){this.tessellationScale=t,this.requestRebuild()},getUTessellation:function(t){return Math.floor(q.getTessellation(this._uTessellation.getValue(),t-this._uOrder.getValue())*this.tessellationScale)},getVTessellation:function(t){return Math.floor(q.getTessellation(this._vTessellation.getValue(),t-this._vOrder.getValue())*this.tessellationScale)},getUClosed:function(t,e,n,i,o,s){return!!this._uClosed.getValue()&&q.getUClosed(t,e,n,i,o,s)},getVClosed:function(t,e,n,i,o,s){return!!this._vClosed.getValue()&&q.getVClosed(t,e,n,i,o,s)},getUVWeights:function(t,e,n,i){return q.getUVWeights(t,e,n,i)},getTexControlPoints:function(t,e,n,i,o,s,r,u){return q.getTexControlPoints(t,e,n,i,o,s,r,u)},getUVControlPoints:function(t,e,n,i,o,s,r,u,l){return q.getUVControlPoints(t,e,n,i,o,s,r,u,l)},getTrimmingContours:function(){},build:function(){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 t=this.getUClosed(this._uOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._uKnot,this._weight,this.controlPointNode),e=this.getVClosed(this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),this._vKnot,this._weight,this.controlPointNode),n=this.getUVWeights(this.weights,this._uDimension.getValue(),this._vDimension.getValue(),this._weight),i=this.getUVControlPoints(this.controlPoints,t,e,this._uOrder.getValue(),this._vOrder.getValue(),this._uDimension.getValue(),this._vDimension.getValue(),n,this.controlPointNode),o=this.getKnots(this.uKnots,t,this._uOrder.getValue(),this._uDimension.getValue(),this._uKnot),s=this.getKnots(this.vKnots,e,this._vOrder.getValue(),this._vDimension.getValue(),this._vKnot),r=(o.at(-1),o[0],s.at(-1),s[0],this._uOrder.getValue()-1),u=this._vOrder.getValue()-1,l=this.surface=(this.surface||Mt)({boundary:["open","open"],degree:[r,u],knots:[o,s],points:i,debug:!1}),a=this.sampleOptions;a.resolution[0]=this.getUTessellation(o.length),a.resolution[1]=this.getVTessellation(s.length),a.closed[0]=t,a.closed[1]=e,a.domain=void 0,a.haveWeights=Boolean(n),a.trimmingContours=this.getTrimmingContours();const h=Mt.sample(this.mesh,l,a),d=h.faces,c=h.points,g=this.getVertices();for(let t=0,e=d.length;t<e;++t){const e=3*d[t];g.push(c[e],c[e+1],c[e+2],1)}this.buildNurbsTexCoords(t,e,this._uOrder.getValue(),this._vOrder.getValue(),o,s,this._uDimension.getValue(),this._vDimension.getValue(),l.domain),this.buildNormals(d,c),this.setSolid(this._solid.getValue()),this.setCCW(!0)},buildNurbsTexCoords:function(){const t=[],e=[],n=[[[0,0,0,1],[0,1,0,1]],[[1,0,0,1],[1,1,0,1]]];function i(t,e){return t[0]=t[1]=e[0],t[2]=t[3]=e.at(-1),t}return function(o,s,r,u,l,a,h,d,c){const g=this.sampleOptions;if(this.texCoordNode&&this.texCoordNode.getSize()===h*d)var f=r-1,p=u-1,_=l,m=a,w=this.getTexControlPoints(this.texControlPoints,o,s,r,u,h,d,this.texCoordNode);else if(this.nurbsTexCoordNode&&this.nurbsTexCoordNode.isValid()){var y=this.nurbsTexCoordNode,b=(f=y._uOrder.getValue()-1,p=y._vOrder.getValue()-1,_=this.getKnots(this.texUKnots,!1,y._uOrder.getValue(),y._uDimension.getValue(),y._uKnot),m=this.getKnots(this.texVKnots,!1,y._vOrder.getValue(),y._vDimension.getValue(),y._vKnot),this.getUVWeights(this.texWeights,y._uDimension.getValue(),y._vDimension.getValue(),y._weight));w=y.getControlPoints(b)}else{f=1,p=1,_=i(t,l),m=i(e,a),w=n;g.domain=c}const v=this.texSurface=(this.texSurface||Mt)({boundary:["open","open"],degree:[f,p],knots:[_,m],points:w});g.closed[0]=!1,g.closed[1]=!1,g.haveWeights=!1;const C=Mt.sample(this.texMesh,v,g),N=C.faces,S=C.points,O=this.getTexCoords();for(let t=0,e=N.length;t<e;++t){const e=4*N[t];O.push(S[e],S[e+1],S[e+2],S[e+3])}this.getMultiTexCoords().push(this.getTexCoords())}}(),buildNormals:function(t,e){const n=this.createNormals(t,e),i=this.getNormals();for(const t of n)i.push(t.x,t.y,t.z)},createNormals:function(t,e){const n=this.createFaceNormals(t,e),i=[];for(let e=0,n=t.length;e<n;++e){const n=t[e];let o=i[n];o||(o=i[n]=[]),o.push(e)}return this.refineNormals(i,n,re().radians(85))},createFaceNormals:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0),n=new(O())(0,0,0);return function(i,o){const s=this.faceNormals||[],r=i.length;for(let u=0;u<r;u+=3){const r=3*i[u],l=3*i[u+1],a=3*i[u+2];t.set(o[r],o[r+1],o[r+2]),e.set(o[l],o[l+1],o[l+2]),n.set(o[a],o[a+1],o[a+2]);const h=Rt().normal(t,e,n,s[u]||new(O())(0,0,0));s[u]=h,s[u+1]=h,s[u+2]=h}return s.length=r,s}}()});const le=ue;_().set("x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode",le);const ae=le;function he(t){ae.call(this,t),this.addType(c().NurbsPatchSurface)}he.prototype=Object.assign(Object.create(ae.prototype),{constructor:he,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),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))]),getTypeName:function(){return"NurbsPatchSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"}});const de=he;_().set("x_ite/Components/NURBS/NurbsPatchSurface",de);const ce=de,ge=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Interpolation/PositionInterpolator");var fe=t.n(ge);function pe(t){Ht().call(this,t),this.addType(c().NurbsPositionInterpolator),this.addChildObjects("rebuild",new(o().SFTime)),this.interpolator=new(fe())(t),this.knots=[],this.weights=[],this.controlPoints=[],this.mesh={},this.sampleOptions={resolution:[128]}}pe.prototype=Object.assign(Object.create(Ht().prototype),{constructor:pe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsPositionInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().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__:function(){this.controlPointNode&&this.controlPointNode.removeInterest("requestRebuild",this),this.controlPointNode=f()(c().X3DCoordinateNode,this._controlPoint),this.controlPointNode&&this.controlPointNode.addInterest("requestRebuild",this),this.requestRebuild()},getClosed:function(t,e,n,i){return!1},getKnots:function(t,e,n,i,o){return q.getKnots(t,e,n,i,o)},getWeights:function(t,e,n){return q.getWeights(t,e,n)},getControlPoints:function(t,e,n,i,o){return q.getControlPoints(t,e,n,i,o)},requestRebuild:function(){this._rebuild.addEvent()},build:function(){if(this._order.getValue()<2)return;if(!this.controlPointNode)return;if(this.controlPointNode.getSize()<this._order.getValue())return;const t=this.getClosed(this._order.getValue(),this._knot,this._weight,this.controlPointNode),e=this.getWeights(this.weights,this.controlPointNode.getSize(),this._weight),n=this.getControlPoints(this.controlPoints,t,this._order.getValue(),e,this.controlPointNode),i=this.getKnots(this.knots,t,this._order.getValue(),this.controlPointNode.getSize(),this._knot),s=i.at(-1)-i[0],r=this._order.getValue()-1,u=this.surface=(this.surface||Mt)({boundary:["open"],degree:[r],knots:[i],points:n,debug:!1});this.sampleOptions.haveWeights=Boolean(e);const l=Mt.sample(this.mesh,u,this.sampleOptions).points,a=this.interpolator;a._key.length=0,a._keyValue.length=0;for(let t=0,e=l.length;t<e;t+=3)a._key.push(i[0]+t/(e-3)*s),a._keyValue.push(new(o().SFVec3f)(l[t],l[t+1],l[t+2]))}});const _e=pe;_().set("x_ite/Components/NURBS/NurbsPositionInterpolator",_e);const me=_e,we=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Grouping/X3DBoundedObject");var ye=t.n(we);function be(t){Ht().call(this,t),ye().call(this,t),this.addType(c().NurbsSet),this.geometryNodes=[]}function ve(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}be.prototype=Object.assign(Object.create(Ht().prototype),ye().prototype,{constructor:be,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSet"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){Ht().prototype.initialize.call(this),ye().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:function(t,e){for(const e of this.geometryNodes)t.add(e.getBBox());return t},set_tessellationScale__:function(){const t=Math.max(0,this._tessellationScale.getValue());for(const e of this.geometryNodes)e.setTessellationScale(t)},set_addGeometry__:function(){this._addGeometry.setTainted(!0),this._addGeometry.erase(ve(this._addGeometry,0,this._addGeometry.length,this._geometry,0,this._geometry.length),this._addGeometry.length);for(const t of this._addGeometry)this._geometry.push(t);this._addGeometry.length=0,this._addGeometry.setTainted(!1)},set_removeGeometry__:function(){this._removeGeometry.setTainted(!0),this._geometry.erase(ve(this._geometry,0,this._geometry.length,this._removeGeometry,0,this._removeGeometry.length),this._geometry.length),this._removeGeometry.length=0,this._removeGeometry.setTainted(!1)},set_geometry__:function(){for(const t of this.geometryNodes)t.setTessellationScale(1);this.geometryNodes.length=0;for(const t of this._geometry){const e=f()(c().X3DNurbsSurfaceGeometryNode,t);e&&this.geometryNodes.push(e)}this.set_tessellationScale__()},dispose:function(){ye().prototype.dispose.call(this),Ht().prototype.dispose.call(this)}});const Ce=be;_().set("x_ite/Components/NURBS/NurbsSet",Ce);const Ne=Ce,Se=window[Symbol.for("X_ITE.X3D-8.6.7")].require("standard/Math/Geometry/Line3");var Oe=t.n(Se);const De={isPointInTriangle:function(t,e,n,i){const o=(e.y-n.y)*(t.x-n.x)+(n.x-e.x)*(t.y-n.y);if(0==o)return!1;const s=((e.y-n.y)*(i.x-n.x)+(n.x-e.x)*(i.y-n.y))/o;if(s<0||s>1)return!1;const r=((n.y-t.y)*(i.x-n.x)+(t.x-n.x)*(i.y-n.y))/o;if(r<0||r>1)return!1;const u=1-s-r;return!(u<0||u>1)}};_().set("standard/Math/Geometry/Triangle2",De);const Pe=De;function Te(t){Ht().call(this,t),this.addType(c().NurbsSurfaceInterpolator),this.geometry=new ce(t)}Te.prototype=Object.assign(Object.create(Ht().prototype),{constructor:Te,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSurfaceInterpolator"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"children"},initialize:function(){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__:function(){const t=new(O())(0,0,0),e=new(O())(0,0,0),n=new(O())(0,0,0),i=new(O())(0,0,0),o=new(Oe())(O().Zero,O().zAxis),s={};return function(){const r=this._set_fraction.getValue(),u=this.geometry.getTexCoords(),l=this.geometry.getNormals(),a=this.geometry.getVertices();for(let h=0,d=0,c=u.length;h<c;h+=12,d+=9)if(t.set(u[h+0],u[h+1],0),e.set(u[h+4],u[h+5],0),n.set(u[h+7],u[h+9],0),Pe.isPointInTriangle(t,e,n,r)&&(o.set(i.set(r.x,r.y,0),O().zAxis),o.intersectsTriangle(t,e,n,s))){const t=s.u,e=s.v,n=s.t,i=new(O())(n*l[d+0]+t*l[d+3]+e*l[d+6],n*l[d+1]+t*l[d+4]+e*l[d+7],n*l[d+2]+t*l[d+5]+e*l[d+8]),o=new(O())(n*a[h+0]+t*a[h+4]+e*a[h+8],n*a[h+1]+t*a[h+5]+e*a[h+9],n*a[h+2]+t*a[h+6]+e*a[h+10]);this._normal_changed=i,this._position_changed=o}}}()});const Fe=Te;_().set("x_ite/Components/NURBS/NurbsSurfaceInterpolator",Fe);const Ie=Fe,Ve=window[Symbol.for("X_ITE.X3D-8.6.7")].require("x_ite/Components/Geometry3D/Extrusion");var xe=t.n(Ve);function Re(t){U.call(this,t),this.addType(c().NurbsSweptSurface),this.extrusion=new(xe())(t)}Re.prototype=Object.assign(Object.create(U.prototype),{constructor:Re,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSweptSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._crossSectionCurve.addInterest("set_crossSectionCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const t=this.extrusion;t._beginCap=!1,t._endCap=!1,t._solid=!0,t._ccw=!0,t._convex=!0,t._creaseAngle=Math.PI,t.setup(),t._crossSection.setTainted(!0),t._spine.setTainted(!0),this.set_crossSectionCurve__(),this.set_trajectoryCurve__()},set_crossSectionCurve__:function(){this.crossSectionCurveNode&&this.crossSectionCurveNode.removeInterest("requestRebuild",this),this.crossSectionCurveNode=f()(c().X3DNurbsControlCurveNode,this._crossSectionCurve),this.crossSectionCurveNode&&this.crossSectionCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__:function(){this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.removeInterest("requestRebuild",this),this.trajectoryCurveNode=f()(c().NurbsCurve,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode._rebuild.addInterest("requestRebuild",this)},build:function(){if(!this.crossSectionCurveNode)return;if(!this.trajectoryCurveNode)return;const t=this.extrusion;if(t._crossSection=this.crossSectionCurveNode.tessellate(0),t._spine=this.trajectoryCurveNode.tessellate(0),t.rebuild(),this.getColors().assign(t.getColors()),this.getTexCoords().assign(t.getTexCoords()),this.getNormals().assign(t.getNormals()),this.getVertices().assign(t.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const t=this.getNormals();for(let e=0,n=t.length;e<n;++e)t[e]=-t[e]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}});const ze=Re;_().set("x_ite/Components/NURBS/NurbsSweptSurface",ze);const je=ze;function ke(t){U.call(this,t),this.addType(c().NurbsSwungSurface),this.extrusion=new(xe())(t)}ke.prototype=Object.assign(Object.create(U.prototype),{constructor:ke,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsSwungSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){U.prototype.initialize.call(this),this._profileCurve.addInterest("set_profileCurve__",this),this._trajectoryCurve.addInterest("set_trajectoryCurve__",this);const t=this.extrusion;t._beginCap=!1,t._endCap=!1,t._solid=!0,t._ccw=!0,t._convex=!0,t._creaseAngle=Math.PI,t.setup(),t._crossSection.setTainted(!0),t._spine.setTainted(!0),this.set_profileCurve__(),this.set_trajectoryCurve__()},set_profileCurve__:function(){this.profileCurveNode&&this.profileCurveNode.removeInterest("requestRebuild",this),this.profileCurveNode=f()(c().X3DNurbsControlCurveNode,this._profileCurve),this.profileCurveNode&&this.profileCurveNode.addInterest("requestRebuild",this)},set_trajectoryCurve__:function(){this.trajectoryCurveNode&&this.trajectoryCurveNode.removeInterest("requestRebuild",this),this.trajectoryCurveNode=f()(c().X3DNurbsControlCurveNode,this._trajectoryCurve),this.trajectoryCurveNode&&this.trajectoryCurveNode.addInterest("requestRebuild",this)},build:function(){if(!this.profileCurveNode)return;if(!this.trajectoryCurveNode)return;const t=this.extrusion;if(t._crossSection=this.profileCurveNode.tessellate(0),t._spine=this.trajectoryCurveNode.tessellate(1),t.rebuild(),this.getColors().assign(t.getColors()),this.getTexCoords().assign(t.getTexCoords()),this.getNormals().assign(t.getNormals()),this.getVertices().assign(t.getVertices()),this.getMultiTexCoords().push(this.getTexCoords()),!this._ccw.getValue()){const t=this.getNormals();for(let e=0,n=t.length;e<n;++e)t[e]=-t[e]}this.setSolid(this._solid.getValue()),this.setCCW(this._ccw.getValue())}});const Ae=ke;_().set("x_ite/Components/NURBS/NurbsSwungSurface",Ae);const Be=Ae;function Xe(t){h().call(this,t),this.addType(c().NurbsTextureCoordinate),this.controlPoints=[]}Xe.prototype=Object.assign(Object.create(h().prototype),{constructor:Xe,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([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))]),getTypeName:function(){return"NurbsTextureCoordinate"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"texCoord"},initialize:function(){h().prototype.initialize.call(this)},getControlPoints:function(t){const e=this._controlPoint.getValue(),n=this.controlPoints;for(let i=0,o=this._uDimension.getValue();i<o;++i){let s=n[i];s||(s=n[i]=[]);for(let n=0,r=this._vDimension.getValue();n<r;++n){const r=n*o+i,u=s[n]||new(X()),l=2*r;s[n]=u.set(e[l],e[l+1],0,t?t[r]:1)}}return n},isValid:function(){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())))}});const Ee=Xe;_().set("x_ite/Components/NURBS/NurbsTextureCoordinate",Ee);const qe=Ee;function Ke(t){ae.call(this,t),this.addType(c().NurbsTrimmedSurface),this.trimmingContourNodes=[]}function Me(t,e,n,i,o,s){const r=new Set;for(let t=o;t<s;++t)r.add(i[t]);return t.remove(e,n,(function(t){return r.has(t)}))}Ke.prototype=Object.assign(Object.create(ae.prototype),{constructor:Ke,[Symbol.for("X_ITE.X3DBaseNode.fieldDefinitions")]:new(l())([new(r())(c().inputOutput,"metadata",new(o().SFNode)),new(r())(c().initializeOnly,"solid",new(o().SFBool)(!0)),new(r())(c().inputOutput,"uTessellation",new(o().SFInt32)),new(r())(c().inputOutput,"vTessellation",new(o().SFInt32)),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))]),getTypeName:function(){return"NurbsTrimmedSurface"},getComponentName:function(){return"NURBS"},getContainerField:function(){return"geometry"},initialize:function(){ae.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__:function(){this._addTrimmingContour.setTainted(!0),this._addTrimmingContour.erase(Me(this._addTrimmingContour,0,this._addTrimmingContour.length,this._trimmingContour,0,this._trimmingContour.length),this._addTrimmingContour.length);for(const t of this._addTrimmingContour)this._trimmingContour.push(t);this._addTrimmingContour.length=0,this._addTrimmingContour.setTainted(!1)},set_removeTrimmingContour__:function(){this._removeTrimmingContour.setTainted(!0),this._trimmingContour.erase(Me(this._trimmingContour,0,this._trimmingContour.length,this._removeTrimmingContour,0,this._removeTrimmingContour.length),this._trimmingContour.length),this._removeTrimmingContour.length=0,this._removeTrimmingContour.setTainted(!1)},set_trimmingContour__:function(){const t=this.trimmingContourNodes;t.length=0;for(const e of this._trimmingContour){const n=f()(c().Contour2D,e);n&&t.push(n)}},getTrimmingContours:function(){const t=this.trimmingContourNodes,e=[];for(const n of t)n.addTrimmingContour(e);return e}});const Ue=Ke;_().set("x_ite/Components/NURBS/NurbsTrimmedSurface",Ue);const Ge=Ue;n().addComponent({name:"NURBS",types:{Contour2D:b,ContourPolyline2D:T,CoordinateDouble:R,NurbsCurve:Wt,NurbsCurve2D:Lt,NurbsOrientationInterpolator:oe,NurbsPatchSurface:ce,NurbsPositionInterpolator:me,NurbsSet:Ne,NurbsSurfaceInterpolator:Ie,NurbsSweptSurface:je,NurbsSwungSurface:Be,NurbsTextureCoordinate:qe,NurbsTrimmedSurface:Ge},abstractTypes:{X3DNurbsControlCurveNode:N,X3DNurbsSurfaceGeometryNode:ae,X3DParametricGeometryNode:U}});const We=void 0;_().set("assets/components/NURBS",We)})();
|