opal-js_wrap-three 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (503) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile.lock +4 -4
  4. data/lib/opal/js_wrap/three/version.rb +1 -1
  5. data/lib-opal/js_wrap/three/WebGL.js +102 -0
  6. data/lib-opal/js_wrap/three/animation/AnimationClipCreator.js +116 -0
  7. data/lib-opal/js_wrap/three/animation/CCDIKSolver.js +436 -0
  8. data/lib-opal/js_wrap/three/animation/MMDAnimationHelper.js +941 -0
  9. data/lib-opal/js_wrap/three/animation/MMDPhysics.js +1183 -0
  10. data/lib-opal/js_wrap/three/cameras/CinematicCamera.js +204 -0
  11. data/lib-opal/js_wrap/three/controls/ArcballControls.js +2649 -0
  12. data/lib-opal/js_wrap/three/controls/DragControls.js +234 -0
  13. data/lib-opal/js_wrap/three/controls/FirstPersonControls.js +301 -0
  14. data/lib-opal/js_wrap/three/controls/FlyControls.js +357 -0
  15. data/lib-opal/js_wrap/three/controls/OrbitControls.js +908 -0
  16. data/lib-opal/js_wrap/three/controls/PointerLockControls.js +173 -0
  17. data/lib-opal/js_wrap/three/controls/TrackballControls.js +666 -0
  18. data/lib-opal/js_wrap/three/controls/TransformControls.js +1210 -0
  19. data/lib-opal/js_wrap/three/controls/experimental/CameraControls.js +860 -0
  20. data/lib-opal/js_wrap/three/csm/CSM.js +346 -0
  21. data/lib-opal/js_wrap/three/csm/CSMFrustum.js +123 -0
  22. data/lib-opal/js_wrap/three/csm/CSMHelper.js +197 -0
  23. data/lib-opal/js_wrap/three/csm/CSMShader.js +29 -0
  24. data/lib-opal/js_wrap/three/curves/CurveExtras.js +544 -0
  25. data/lib-opal/js_wrap/three/curves/NURBSCurve.js +122 -0
  26. data/lib-opal/js_wrap/three/curves/NURBSSurface.js +78 -0
  27. data/lib-opal/js_wrap/three/curves/NURBSUtils.js +413 -0
  28. data/lib-opal/js_wrap/three/deprecated/Geometry.js +1373 -0
  29. data/lib-opal/js_wrap/three/effects/AnaglyphEffect.js +113 -0
  30. data/lib-opal/js_wrap/three/effects/AsciiEffect.js +267 -0
  31. data/lib-opal/js_wrap/three/effects/OutlineEffect.js +400 -0
  32. data/lib-opal/js_wrap/three/effects/ParallaxBarrierEffect.js +90 -0
  33. data/lib-opal/js_wrap/three/effects/PeppersGhostEffect.js +160 -0
  34. data/lib-opal/js_wrap/three/effects/StereoEffect.js +63 -0
  35. data/lib-opal/js_wrap/three/environments/DebugEnvironment.js +107 -0
  36. data/lib-opal/js_wrap/three/environments/RoomEnvironment.js +166 -0
  37. data/lib-opal/js_wrap/three/exporters/ColladaExporter.js +442 -0
  38. data/lib-opal/js_wrap/three/exporters/DRACOExporter.js +205 -0
  39. data/lib-opal/js_wrap/three/exporters/GLTFExporter.js +2042 -0
  40. data/lib-opal/js_wrap/three/exporters/MMDExporter.js +189 -0
  41. data/lib-opal/js_wrap/three/exporters/OBJExporter.js +241 -0
  42. data/lib-opal/js_wrap/three/exporters/PLYExporter.js +370 -0
  43. data/lib-opal/js_wrap/three/exporters/STLExporter.js +186 -0
  44. data/lib-opal/js_wrap/three/exporters/USDZExporter.js +402 -0
  45. data/lib-opal/js_wrap/three/geometries/BoxLineGeometry.js +106 -0
  46. data/lib-opal/js_wrap/three/geometries/ConvexGeometry.js +88 -0
  47. data/lib-opal/js_wrap/three/geometries/DecalGeometry.js +302 -0
  48. data/lib-opal/js_wrap/three/geometries/LightningStrike.js +817 -0
  49. data/lib-opal/js_wrap/three/geometries/ParametricGeometries.js +280 -0
  50. data/lib-opal/js_wrap/three/geometries/ParametricGeometry.js +146 -0
  51. data/lib-opal/js_wrap/three/geometries/RoundedBoxGeometry.js +183 -0
  52. data/lib-opal/js_wrap/three/geometries/TeapotGeometry.js +352 -0
  53. data/lib-opal/js_wrap/three/geometries/TextGeometry.js +76 -0
  54. data/lib-opal/js_wrap/three/helpers/LightProbeHelper.js +95 -0
  55. data/lib-opal/js_wrap/three/helpers/PositionalAudioHelper.js +138 -0
  56. data/lib-opal/js_wrap/three/helpers/RectAreaLightHelper.js +115 -0
  57. data/lib-opal/js_wrap/three/helpers/VertexNormalsHelper.js +131 -0
  58. data/lib-opal/js_wrap/three/helpers/VertexTangentsHelper.js +118 -0
  59. data/lib-opal/js_wrap/three/interactive/HTMLMesh.js +307 -0
  60. data/lib-opal/js_wrap/three/interactive/InteractiveGroup.js +138 -0
  61. data/lib-opal/js_wrap/three/interactive/SelectionBox.js +264 -0
  62. data/lib-opal/js_wrap/three/interactive/SelectionHelper.js +88 -0
  63. data/lib-opal/js_wrap/three/libs/OimoPhysics/OimoPhysics.js +46059 -0
  64. data/lib-opal/js_wrap/three/libs/OimoPhysics/index.js +92 -0
  65. data/lib-opal/js_wrap/three/libs/chevrotain.module.min.js +6947 -0
  66. data/lib-opal/js_wrap/three/libs/ecsy.module.js +1999 -0
  67. data/lib-opal/js_wrap/three/libs/fflate.module.js +3002 -0
  68. data/lib-opal/js_wrap/three/libs/flow.module.js +3033 -0
  69. data/lib-opal/js_wrap/three/libs/ktx-parse.module.js +392 -0
  70. data/lib-opal/js_wrap/three/libs/lil-gui.module.min.js +821 -0
  71. data/lib-opal/js_wrap/three/libs/meshopt_decoder.module.js +136 -0
  72. data/lib-opal/js_wrap/three/libs/mmdparser.module.js +11022 -0
  73. data/lib-opal/js_wrap/three/libs/motion-controllers.module.js +589 -0
  74. data/lib-opal/js_wrap/three/libs/opentype.module.min.js +6132 -0
  75. data/lib-opal/js_wrap/three/libs/potpack.module.js +171 -0
  76. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.js +6781 -0
  77. data/lib-opal/js_wrap/three/libs/rhino3dm/rhino3dm.module.js +6783 -0
  78. data/lib-opal/js_wrap/three/libs/stats.module.js +139 -0
  79. data/lib-opal/js_wrap/three/libs/tween.module.min.js +349 -0
  80. data/lib-opal/js_wrap/three/lights/LightProbeGenerator.js +233 -0
  81. data/lib-opal/js_wrap/three/lights/RectAreaLightUniformsLib.js +75 -0
  82. data/lib-opal/js_wrap/three/lines/Line2.js +66 -0
  83. data/lib-opal/js_wrap/three/lines/LineGeometry.js +122 -0
  84. data/lib-opal/js_wrap/three/lines/LineMaterial.js +227 -0
  85. data/lib-opal/js_wrap/three/lines/LineSegments2.js +312 -0
  86. data/lib-opal/js_wrap/three/lines/LineSegmentsGeometry.js +238 -0
  87. data/lib-opal/js_wrap/three/lines/Wireframe.js +98 -0
  88. data/lib-opal/js_wrap/three/lines/WireframeGeometry2.js +65 -0
  89. data/lib-opal/js_wrap/three/loaders/3DMLoader.js +1230 -0
  90. data/lib-opal/js_wrap/three/loaders/3MFLoader.js +1123 -0
  91. data/lib-opal/js_wrap/three/loaders/AMFLoader.js +445 -0
  92. data/lib-opal/js_wrap/three/loaders/BVHLoader.js +365 -0
  93. data/lib-opal/js_wrap/three/loaders/BasisTextureLoader.js +692 -0
  94. data/lib-opal/js_wrap/three/loaders/ColladaLoader.js +3046 -0
  95. data/lib-opal/js_wrap/three/loaders/DDSLoader.js +264 -0
  96. data/lib-opal/js_wrap/three/loaders/DRACOLoader.js +531 -0
  97. data/lib-opal/js_wrap/three/loaders/EXRLoader.js +1834 -0
  98. data/lib-opal/js_wrap/three/loaders/FBXLoader.js +3125 -0
  99. data/lib-opal/js_wrap/three/loaders/FontLoader.js +201 -0
  100. data/lib-opal/js_wrap/three/loaders/GCodeLoader.js +248 -0
  101. data/lib-opal/js_wrap/three/loaders/GLTFLoader.js +3334 -0
  102. data/lib-opal/js_wrap/three/loaders/HDRCubeTextureLoader.js +144 -0
  103. data/lib-opal/js_wrap/three/loaders/IFCLoader.js +2395 -0
  104. data/lib-opal/js_wrap/three/loaders/KMZLoader.js +142 -0
  105. data/lib-opal/js_wrap/three/loaders/KTX2Loader.js +535 -0
  106. data/lib-opal/js_wrap/three/loaders/KTXLoader.js +202 -0
  107. data/lib-opal/js_wrap/three/loaders/LDrawLoader.js +1737 -0
  108. data/lib-opal/js_wrap/three/loaders/LUT3dlLoader.js +163 -0
  109. data/lib-opal/js_wrap/three/loaders/LUTCubeLoader.js +171 -0
  110. data/lib-opal/js_wrap/three/loaders/LWOLoader.js +831 -0
  111. data/lib-opal/js_wrap/three/loaders/LogLuvLoader.js +713 -0
  112. data/lib-opal/js_wrap/three/loaders/LottieLoader.js +103 -0
  113. data/lib-opal/js_wrap/three/loaders/MD2Loader.js +258 -0
  114. data/lib-opal/js_wrap/three/loaders/MDDLoader.js +116 -0
  115. data/lib-opal/js_wrap/three/loaders/MMDLoader.js +1687 -0
  116. data/lib-opal/js_wrap/three/loaders/MTLLoader.js +465 -0
  117. data/lib-opal/js_wrap/three/loaders/NRRDLoader.js +554 -0
  118. data/lib-opal/js_wrap/three/loaders/NodeMaterialLoader.js +248 -0
  119. data/lib-opal/js_wrap/three/loaders/OBJLoader.js +673 -0
  120. data/lib-opal/js_wrap/three/loaders/PCDLoader.js +322 -0
  121. data/lib-opal/js_wrap/three/loaders/PDBLoader.js +318 -0
  122. data/lib-opal/js_wrap/three/loaders/PLYLoader.js +489 -0
  123. data/lib-opal/js_wrap/three/loaders/PRWMLoader.js +247 -0
  124. data/lib-opal/js_wrap/three/loaders/PVRLoader.js +240 -0
  125. data/lib-opal/js_wrap/three/loaders/RGBELoader.js +462 -0
  126. data/lib-opal/js_wrap/three/loaders/RGBMLoader.js +1169 -0
  127. data/lib-opal/js_wrap/three/loaders/STLLoader.js +345 -0
  128. data/lib-opal/js_wrap/three/loaders/SVGLoader.js +2162 -0
  129. data/lib-opal/js_wrap/three/loaders/TDSLoader.js +982 -0
  130. data/lib-opal/js_wrap/three/loaders/TGALoader.js +444 -0
  131. data/lib-opal/js_wrap/three/loaders/TTFLoader.js +210 -0
  132. data/lib-opal/js_wrap/three/loaders/TiltLoader.js +391 -0
  133. data/lib-opal/js_wrap/three/loaders/VOXLoader.js +272 -0
  134. data/lib-opal/js_wrap/three/loaders/VRMLLoader.js +2685 -0
  135. data/lib-opal/js_wrap/three/loaders/VRMLoader.js +103 -0
  136. data/lib-opal/js_wrap/three/loaders/VTKLoader.js +894 -0
  137. data/lib-opal/js_wrap/three/loaders/XYZLoader.js +136 -0
  138. data/lib-opal/js_wrap/three/loaders/ifc/web-ifc-api.js +60504 -0
  139. data/lib-opal/js_wrap/three/loaders/lwo/IFFParser.js +931 -0
  140. data/lib-opal/js_wrap/three/loaders/lwo/LWO2Parser.js +450 -0
  141. data/lib-opal/js_wrap/three/loaders/lwo/LWO3Parser.js +406 -0
  142. data/lib-opal/js_wrap/three/math/Capsule.js +133 -0
  143. data/lib-opal/js_wrap/three/math/ColorConverter.js +104 -0
  144. data/lib-opal/js_wrap/three/math/ConvexHull.js +924 -0
  145. data/lib-opal/js_wrap/three/math/ImprovedNoise.js +86 -0
  146. data/lib-opal/js_wrap/three/math/Lut.js +170 -0
  147. data/lib-opal/js_wrap/three/math/MeshSurfaceSampler.js +187 -0
  148. data/lib-opal/js_wrap/three/math/OBB.js +345 -0
  149. data/lib-opal/js_wrap/three/math/Octree.js +409 -0
  150. data/lib-opal/js_wrap/three/math/SimplexNoise.js +425 -0
  151. data/lib-opal/js_wrap/three/misc/ConvexObjectBreaker.js +447 -0
  152. data/lib-opal/js_wrap/three/misc/GPUComputationRenderer.js +322 -0
  153. data/lib-opal/js_wrap/three/misc/Gyroscope.js +94 -0
  154. data/lib-opal/js_wrap/three/misc/MD2Character.js +225 -0
  155. data/lib-opal/js_wrap/three/misc/MD2CharacterComplex.js +424 -0
  156. data/lib-opal/js_wrap/three/misc/MorphAnimMesh.js +109 -0
  157. data/lib-opal/js_wrap/three/misc/MorphBlendMesh.js +283 -0
  158. data/lib-opal/js_wrap/three/misc/ProgressiveLightMap.js +324 -0
  159. data/lib-opal/js_wrap/three/misc/RollerCoaster.js +489 -0
  160. data/lib-opal/js_wrap/three/misc/TubePainter.js +158 -0
  161. data/lib-opal/js_wrap/three/misc/Volume.js +427 -0
  162. data/lib-opal/js_wrap/three/misc/VolumeSlice.js +210 -0
  163. data/lib-opal/js_wrap/three/modifiers/CurveModifier.js +291 -0
  164. data/lib-opal/js_wrap/three/modifiers/EdgeSplitModifier.js +308 -0
  165. data/lib-opal/js_wrap/three/modifiers/SimplifyModifier.js +435 -0
  166. data/lib-opal/js_wrap/three/modifiers/TessellateModifier.js +264 -0
  167. data/lib-opal/js_wrap/three/node-editor/NodeEditor.js +402 -0
  168. data/lib-opal/js_wrap/three/node-editor/accessors/NormalEditor.js +80 -0
  169. data/lib-opal/js_wrap/three/node-editor/accessors/PositionEditor.js +80 -0
  170. data/lib-opal/js_wrap/three/node-editor/accessors/UVEditor.js +71 -0
  171. data/lib-opal/js_wrap/three/node-editor/display/BlendEditor.js +78 -0
  172. data/lib-opal/js_wrap/three/node-editor/inputs/ColorEditor.js +111 -0
  173. data/lib-opal/js_wrap/three/node-editor/inputs/FloatEditor.js +69 -0
  174. data/lib-opal/js_wrap/three/node-editor/inputs/SliderEditor.js +97 -0
  175. data/lib-opal/js_wrap/three/node-editor/inputs/Vector2Editor.js +73 -0
  176. data/lib-opal/js_wrap/three/node-editor/inputs/Vector3Editor.js +75 -0
  177. data/lib-opal/js_wrap/three/node-editor/inputs/Vector4Editor.js +77 -0
  178. data/lib-opal/js_wrap/three/node-editor/materials/StandardMaterialEditor.js +121 -0
  179. data/lib-opal/js_wrap/three/node-editor/math/DotEditor.js +76 -0
  180. data/lib-opal/js_wrap/three/node-editor/math/InvertEditor.js +80 -0
  181. data/lib-opal/js_wrap/three/node-editor/math/LimiterEditor.js +85 -0
  182. data/lib-opal/js_wrap/three/node-editor/math/NormalizeEditor.js +69 -0
  183. data/lib-opal/js_wrap/three/node-editor/math/OperatorEditor.js +91 -0
  184. data/lib-opal/js_wrap/three/node-editor/math/PowerEditor.js +73 -0
  185. data/lib-opal/js_wrap/three/node-editor/math/TrigonometryEditor.js +83 -0
  186. data/lib-opal/js_wrap/three/node-editor/procedural/CheckerEditor.js +69 -0
  187. data/lib-opal/js_wrap/three/node-editor/utils/OscillatorEditor.js +87 -0
  188. data/lib-opal/js_wrap/three/node-editor/utils/TimerEditor.js +89 -0
  189. data/lib-opal/js_wrap/three/nodes/Nodes.js +481 -0
  190. data/lib-opal/js_wrap/three/nodes/accessors/CameraNode.js +222 -0
  191. data/lib-opal/js_wrap/three/nodes/accessors/ColorsNode.js +99 -0
  192. data/lib-opal/js_wrap/three/nodes/accessors/LightNode.js +100 -0
  193. data/lib-opal/js_wrap/three/nodes/accessors/NormalNode.js +152 -0
  194. data/lib-opal/js_wrap/three/nodes/accessors/PositionNode.js +163 -0
  195. data/lib-opal/js_wrap/three/nodes/accessors/ReflectNode.js +161 -0
  196. data/lib-opal/js_wrap/three/nodes/accessors/ResolutionNode.js +99 -0
  197. data/lib-opal/js_wrap/three/nodes/accessors/ScreenUVNode.js +101 -0
  198. data/lib-opal/js_wrap/three/nodes/accessors/UVNode.js +105 -0
  199. data/lib-opal/js_wrap/three/nodes/core/AttributeNode.js +106 -0
  200. data/lib-opal/js_wrap/three/nodes/core/ConstNode.js +149 -0
  201. data/lib-opal/js_wrap/three/nodes/core/ExpressionNode.js +57 -0
  202. data/lib-opal/js_wrap/three/nodes/core/FunctionCallNode.js +138 -0
  203. data/lib-opal/js_wrap/three/nodes/core/FunctionNode.js +259 -0
  204. data/lib-opal/js_wrap/three/nodes/core/InputNode.js +124 -0
  205. data/lib-opal/js_wrap/three/nodes/core/Node.js +193 -0
  206. data/lib-opal/js_wrap/three/nodes/core/NodeBuilder.js +782 -0
  207. data/lib-opal/js_wrap/three/nodes/core/NodeFrame.js +69 -0
  208. data/lib-opal/js_wrap/three/nodes/core/NodeLib.js +56 -0
  209. data/lib-opal/js_wrap/three/nodes/core/NodeUniform.js +53 -0
  210. data/lib-opal/js_wrap/three/nodes/core/NodeUtils.js +60 -0
  211. data/lib-opal/js_wrap/three/nodes/core/StructNode.js +131 -0
  212. data/lib-opal/js_wrap/three/nodes/core/TempNode.js +160 -0
  213. data/lib-opal/js_wrap/three/nodes/core/VarNode.js +105 -0
  214. data/lib-opal/js_wrap/three/nodes/effects/BlurNode.js +160 -0
  215. data/lib-opal/js_wrap/three/nodes/effects/ColorAdjustmentNode.js +139 -0
  216. data/lib-opal/js_wrap/three/nodes/effects/LuminanceNode.js +106 -0
  217. data/lib-opal/js_wrap/three/nodes/inputs/BoolNode.js +95 -0
  218. data/lib-opal/js_wrap/three/nodes/inputs/ColorNode.js +99 -0
  219. data/lib-opal/js_wrap/three/nodes/inputs/CubeTextureNode.js +136 -0
  220. data/lib-opal/js_wrap/three/nodes/inputs/FloatNode.js +95 -0
  221. data/lib-opal/js_wrap/three/nodes/inputs/IntNode.js +95 -0
  222. data/lib-opal/js_wrap/three/nodes/inputs/Matrix3Node.js +102 -0
  223. data/lib-opal/js_wrap/three/nodes/inputs/Matrix4Node.js +102 -0
  224. data/lib-opal/js_wrap/three/nodes/inputs/PropertyNode.js +85 -0
  225. data/lib-opal/js_wrap/three/nodes/inputs/RTTNode.js +164 -0
  226. data/lib-opal/js_wrap/three/nodes/inputs/ReflectorNode.js +111 -0
  227. data/lib-opal/js_wrap/three/nodes/inputs/ScreenNode.js +69 -0
  228. data/lib-opal/js_wrap/three/nodes/inputs/TextureNode.js +140 -0
  229. data/lib-opal/js_wrap/three/nodes/inputs/Vector2Node.js +98 -0
  230. data/lib-opal/js_wrap/three/nodes/inputs/Vector3Node.js +99 -0
  231. data/lib-opal/js_wrap/three/nodes/inputs/Vector4Node.js +100 -0
  232. data/lib-opal/js_wrap/three/nodes/materials/BasicNodeMaterial.js +63 -0
  233. data/lib-opal/js_wrap/three/nodes/materials/MeshStandardNodeMaterial.js +63 -0
  234. data/lib-opal/js_wrap/three/nodes/materials/NodeMaterial.js +202 -0
  235. data/lib-opal/js_wrap/three/nodes/materials/PhongNodeMaterial.js +63 -0
  236. data/lib-opal/js_wrap/three/nodes/materials/SpriteNodeMaterial.js +63 -0
  237. data/lib-opal/js_wrap/three/nodes/materials/StandardNodeMaterial.js +63 -0
  238. data/lib-opal/js_wrap/three/nodes/materials/nodes/BasicNode.js +146 -0
  239. data/lib-opal/js_wrap/three/nodes/materials/nodes/MeshStandardNode.js +133 -0
  240. data/lib-opal/js_wrap/three/nodes/materials/nodes/PhongNode.js +273 -0
  241. data/lib-opal/js_wrap/three/nodes/materials/nodes/RawNode.js +101 -0
  242. data/lib-opal/js_wrap/three/nodes/materials/nodes/SpriteNode.js +176 -0
  243. data/lib-opal/js_wrap/three/nodes/materials/nodes/StandardNode.js +397 -0
  244. data/lib-opal/js_wrap/three/nodes/math/CondNode.js +151 -0
  245. data/lib-opal/js_wrap/three/nodes/math/MathNode.js +266 -0
  246. data/lib-opal/js_wrap/three/nodes/math/OperatorNode.js +120 -0
  247. data/lib-opal/js_wrap/three/nodes/misc/BumpMapNode.js +139 -0
  248. data/lib-opal/js_wrap/three/nodes/misc/NormalMapNode.js +122 -0
  249. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeNode.js +107 -0
  250. data/lib-opal/js_wrap/three/nodes/misc/TextureCubeUVNode.js +191 -0
  251. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePass.js +117 -0
  252. data/lib-opal/js_wrap/three/nodes/postprocessing/NodePostProcessing.js +128 -0
  253. data/lib-opal/js_wrap/three/nodes/procedural/CheckerNode.js +104 -0
  254. data/lib-opal/js_wrap/three/nodes/procedural/Fractal3DNode.js +121 -0
  255. data/lib-opal/js_wrap/three/nodes/procedural/Noise2DNode.js +115 -0
  256. data/lib-opal/js_wrap/three/nodes/procedural/Noise3DNode.js +112 -0
  257. data/lib-opal/js_wrap/three/nodes/utils/BypassNode.js +115 -0
  258. data/lib-opal/js_wrap/three/nodes/utils/ColorSpaceNode.js +214 -0
  259. data/lib-opal/js_wrap/three/nodes/utils/JoinNode.js +138 -0
  260. data/lib-opal/js_wrap/three/nodes/utils/MaxMIPLevelNode.js +88 -0
  261. data/lib-opal/js_wrap/three/nodes/utils/RemapNode.js +117 -0
  262. data/lib-opal/js_wrap/three/nodes/utils/SpecularMIPLevelNode.js +121 -0
  263. data/lib-opal/js_wrap/three/nodes/utils/SubSlotNode.js +112 -0
  264. data/lib-opal/js_wrap/three/nodes/utils/SwitchNode.js +129 -0
  265. data/lib-opal/js_wrap/three/nodes/utils/TimerNode.js +126 -0
  266. data/lib-opal/js_wrap/three/nodes/utils/UVTransformNode.js +104 -0
  267. data/lib-opal/js_wrap/three/nodes/utils/VelocityNode.js +181 -0
  268. data/lib-opal/js_wrap/three/objects/Lensflare.js +285 -0
  269. data/lib-opal/js_wrap/three/objects/LightningStorm.js +238 -0
  270. data/lib-opal/js_wrap/three/objects/MarchingCubes.js +667 -0
  271. data/lib-opal/js_wrap/three/objects/Reflector.js +205 -0
  272. data/lib-opal/js_wrap/three/objects/ReflectorForSSRPass.js +288 -0
  273. data/lib-opal/js_wrap/three/objects/ReflectorRTT.js +63 -0
  274. data/lib-opal/js_wrap/three/objects/Refractor.js +243 -0
  275. data/lib-opal/js_wrap/three/objects/ShadowMesh.js +100 -0
  276. data/lib-opal/js_wrap/three/objects/Sky.js +107 -0
  277. data/lib-opal/js_wrap/three/objects/Water.js +246 -0
  278. data/lib-opal/js_wrap/three/objects/Water2.js +238 -0
  279. data/lib-opal/js_wrap/three/offscreen/jank.js +51 -0
  280. data/lib-opal/js_wrap/three/offscreen/offscreen.js +24 -0
  281. data/lib-opal/js_wrap/three/offscreen/scene.js +99 -0
  282. data/lib-opal/js_wrap/three/physics/AmmoPhysics.js +266 -0
  283. data/lib-opal/js_wrap/three/physics/OimoPhysics.js +214 -0
  284. data/lib-opal/js_wrap/three/postprocessing/AdaptiveToneMappingPass.js +307 -0
  285. data/lib-opal/js_wrap/three/postprocessing/AfterimagePass.js +116 -0
  286. data/lib-opal/js_wrap/three/postprocessing/BloomPass.js +132 -0
  287. data/lib-opal/js_wrap/three/postprocessing/BokehPass.js +143 -0
  288. data/lib-opal/js_wrap/three/postprocessing/ClearPass.js +85 -0
  289. data/lib-opal/js_wrap/three/postprocessing/CubeTexturePass.js +104 -0
  290. data/lib-opal/js_wrap/three/postprocessing/DotScreenPass.js +90 -0
  291. data/lib-opal/js_wrap/three/postprocessing/EffectComposer.js +272 -0
  292. data/lib-opal/js_wrap/three/postprocessing/FilmPass.js +91 -0
  293. data/lib-opal/js_wrap/three/postprocessing/GlitchPass.js +140 -0
  294. data/lib-opal/js_wrap/three/postprocessing/HalftonePass.js +108 -0
  295. data/lib-opal/js_wrap/three/postprocessing/LUTPass.js +132 -0
  296. data/lib-opal/js_wrap/three/postprocessing/MaskPass.js +142 -0
  297. data/lib-opal/js_wrap/three/postprocessing/OutlinePass.js +480 -0
  298. data/lib-opal/js_wrap/three/postprocessing/Pass.js +101 -0
  299. data/lib-opal/js_wrap/three/postprocessing/RenderPass.js +109 -0
  300. data/lib-opal/js_wrap/three/postprocessing/SAOPass.js +384 -0
  301. data/lib-opal/js_wrap/three/postprocessing/SMAAPass.js +199 -0
  302. data/lib-opal/js_wrap/three/postprocessing/SSAARenderPass.js +186 -0
  303. data/lib-opal/js_wrap/three/postprocessing/SSAOPass.js +388 -0
  304. data/lib-opal/js_wrap/three/postprocessing/SSRPass.js +537 -0
  305. data/lib-opal/js_wrap/three/postprocessing/SSRrPass.js +481 -0
  306. data/lib-opal/js_wrap/three/postprocessing/SavePass.js +96 -0
  307. data/lib-opal/js_wrap/three/postprocessing/ShaderPass.js +98 -0
  308. data/lib-opal/js_wrap/three/postprocessing/TAARenderPass.js +159 -0
  309. data/lib-opal/js_wrap/three/postprocessing/TexturePass.js +91 -0
  310. data/lib-opal/js_wrap/three/postprocessing/UnrealBloomPass.js +335 -0
  311. data/lib-opal/js_wrap/three/renderers/CSS2DRenderer.js +213 -0
  312. data/lib-opal/js_wrap/three/renderers/CSS3DRenderer.js +277 -0
  313. data/lib-opal/js_wrap/three/renderers/Projector.js +733 -0
  314. data/lib-opal/js_wrap/three/renderers/SVGRenderer.js +470 -0
  315. data/lib-opal/js_wrap/three/renderers/nodes/Nodes.js +531 -0
  316. data/lib-opal/js_wrap/three/renderers/nodes/ShaderNode.js +386 -0
  317. data/lib-opal/js_wrap/three/renderers/nodes/accessors/CameraNode.js +114 -0
  318. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialNode.js +140 -0
  319. data/lib-opal/js_wrap/three/renderers/nodes/accessors/MaterialReferenceNode.js +79 -0
  320. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelNode.js +62 -0
  321. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ModelViewProjectionNode.js +80 -0
  322. data/lib-opal/js_wrap/three/renderers/nodes/accessors/NormalNode.js +113 -0
  323. data/lib-opal/js_wrap/three/renderers/nodes/accessors/Object3DNode.js +136 -0
  324. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PointUVNode.js +70 -0
  325. data/lib-opal/js_wrap/three/renderers/nodes/accessors/PositionNode.js +117 -0
  326. data/lib-opal/js_wrap/three/renderers/nodes/accessors/ReferenceNode.js +124 -0
  327. data/lib-opal/js_wrap/three/renderers/nodes/accessors/SkinningNode.js +129 -0
  328. data/lib-opal/js_wrap/three/renderers/nodes/accessors/UVNode.js +77 -0
  329. data/lib-opal/js_wrap/three/renderers/nodes/core/ArrayInputNode.js +74 -0
  330. data/lib-opal/js_wrap/three/renderers/nodes/core/AttributeNode.js +97 -0
  331. data/lib-opal/js_wrap/three/renderers/nodes/core/BypassNode.js +84 -0
  332. data/lib-opal/js_wrap/three/renderers/nodes/core/CodeNode.js +131 -0
  333. data/lib-opal/js_wrap/three/renderers/nodes/core/ContextNode.js +84 -0
  334. data/lib-opal/js_wrap/three/renderers/nodes/core/ExpressionNode.js +81 -0
  335. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionCallNode.js +123 -0
  336. data/lib-opal/js_wrap/three/renderers/nodes/core/FunctionNode.js +126 -0
  337. data/lib-opal/js_wrap/three/renderers/nodes/core/InputNode.js +103 -0
  338. data/lib-opal/js_wrap/three/renderers/nodes/core/Node.js +120 -0
  339. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeAttribute.js +37 -0
  340. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeBuilder.js +650 -0
  341. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeCode.js +42 -0
  342. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFrame.js +70 -0
  343. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunction.js +55 -0
  344. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeFunctionInput.js +44 -0
  345. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeKeywords.js +117 -0
  346. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeParser.js +46 -0
  347. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeUniform.js +55 -0
  348. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVar.js +37 -0
  349. data/lib-opal/js_wrap/three/renderers/nodes/core/NodeVary.js +37 -0
  350. data/lib-opal/js_wrap/three/renderers/nodes/core/PropertyNode.js +90 -0
  351. data/lib-opal/js_wrap/three/renderers/nodes/core/TempNode.js +89 -0
  352. data/lib-opal/js_wrap/three/renderers/nodes/core/VarNode.js +101 -0
  353. data/lib-opal/js_wrap/three/renderers/nodes/core/VaryNode.js +101 -0
  354. data/lib-opal/js_wrap/three/renderers/nodes/core/constants.js +42 -0
  355. data/lib-opal/js_wrap/three/renderers/nodes/display/ColorSpaceNode.js +165 -0
  356. data/lib-opal/js_wrap/three/renderers/nodes/display/NormalMapNode.js +120 -0
  357. data/lib-opal/js_wrap/three/renderers/nodes/functions/BSDFs.js +133 -0
  358. data/lib-opal/js_wrap/three/renderers/nodes/inputs/BufferNode.js +78 -0
  359. data/lib-opal/js_wrap/three/renderers/nodes/inputs/ColorNode.js +67 -0
  360. data/lib-opal/js_wrap/three/renderers/nodes/inputs/FloatNode.js +67 -0
  361. data/lib-opal/js_wrap/three/renderers/nodes/inputs/IntNode.js +67 -0
  362. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix3Node.js +67 -0
  363. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Matrix4Node.js +67 -0
  364. data/lib-opal/js_wrap/three/renderers/nodes/inputs/TextureNode.js +120 -0
  365. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector2Node.js +67 -0
  366. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector3Node.js +67 -0
  367. data/lib-opal/js_wrap/three/renderers/nodes/inputs/Vector4Node.js +67 -0
  368. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightContextNode.js +103 -0
  369. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightNode.js +115 -0
  370. data/lib-opal/js_wrap/three/renderers/nodes/lights/LightsNode.js +117 -0
  371. data/lib-opal/js_wrap/three/renderers/nodes/materials/LineBasicNodeMaterial.js +82 -0
  372. data/lib-opal/js_wrap/three/renderers/nodes/materials/Materials.js +49 -0
  373. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshBasicNodeMaterial.js +82 -0
  374. data/lib-opal/js_wrap/three/renderers/nodes/materials/MeshStandardNodeMaterial.js +96 -0
  375. data/lib-opal/js_wrap/three/renderers/nodes/materials/PointsNodeMaterial.js +84 -0
  376. data/lib-opal/js_wrap/three/renderers/nodes/math/CondNode.js +98 -0
  377. data/lib-opal/js_wrap/three/renderers/nodes/math/MathNode.js +255 -0
  378. data/lib-opal/js_wrap/three/renderers/nodes/math/OperatorNode.js +163 -0
  379. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeFunction.js +158 -0
  380. data/lib-opal/js_wrap/three/renderers/nodes/parsers/GLSLNodeParser.js +68 -0
  381. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeFunction.js +126 -0
  382. data/lib-opal/js_wrap/three/renderers/nodes/parsers/WGSLNodeParser.js +68 -0
  383. data/lib-opal/js_wrap/three/renderers/nodes/procedural/CheckerNode.js +84 -0
  384. data/lib-opal/js_wrap/three/renderers/nodes/utils/ArrayElementNode.js +79 -0
  385. data/lib-opal/js_wrap/three/renderers/nodes/utils/ConvertNode.js +82 -0
  386. data/lib-opal/js_wrap/three/renderers/nodes/utils/JoinNode.js +88 -0
  387. data/lib-opal/js_wrap/three/renderers/nodes/utils/OscNode.js +105 -0
  388. data/lib-opal/js_wrap/three/renderers/nodes/utils/SplitNode.js +96 -0
  389. data/lib-opal/js_wrap/three/renderers/nodes/utils/SpriteSheetUVNode.js +98 -0
  390. data/lib-opal/js_wrap/three/renderers/nodes/utils/TimerNode.js +93 -0
  391. data/lib-opal/js_wrap/three/renderers/webgl/nodes/SlotNode.js +72 -0
  392. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodeBuilder.js +463 -0
  393. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLNodes.js +62 -0
  394. data/lib-opal/js_wrap/three/renderers/webgl/nodes/WebGLPhysicalContextNode.js +95 -0
  395. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPU.js +62 -0
  396. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUAttributes.js +118 -0
  397. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBackground.js +109 -0
  398. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBinding.js +52 -0
  399. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBindings.js +254 -0
  400. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUBufferUtils.js +39 -0
  401. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUComputePipelines.js +82 -0
  402. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUGeometries.js +84 -0
  403. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUInfo.js +86 -0
  404. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUObjects.js +64 -0
  405. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProgrammableStage.js +46 -0
  406. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUProperties.js +63 -0
  407. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderLists.js +180 -0
  408. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipeline.js +662 -0
  409. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderPipelines.js +275 -0
  410. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPURenderer.js +883 -0
  411. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampledTexture.js +139 -0
  412. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUSampler.js +76 -0
  413. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUStorageBuffer.js +69 -0
  414. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureRenderer.js +64 -0
  415. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextureUtils.js +125 -0
  416. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUTextures.js +681 -0
  417. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniform.js +237 -0
  418. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformBuffer.js +90 -0
  419. data/lib-opal/js_wrap/three/renderers/webgpu/WebGPUUniformsGroup.js +294 -0
  420. data/lib-opal/js_wrap/three/renderers/webgpu/constants.js +263 -0
  421. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeBuilder.js +619 -0
  422. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampledTexture.js +67 -0
  423. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeSampler.js +71 -0
  424. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniform.js +229 -0
  425. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodeUniformsGroup.js +68 -0
  426. data/lib-opal/js_wrap/three/renderers/webgpu/nodes/WebGPUNodes.js +106 -0
  427. data/lib-opal/js_wrap/three/shaders/ACESFilmicToneMappingShader.js +45 -0
  428. data/lib-opal/js_wrap/three/shaders/AfterimageShader.js +46 -0
  429. data/lib-opal/js_wrap/three/shaders/BasicShader.js +34 -0
  430. data/lib-opal/js_wrap/three/shaders/BleachBypassShader.js +43 -0
  431. data/lib-opal/js_wrap/three/shaders/BlendShader.js +47 -0
  432. data/lib-opal/js_wrap/three/shaders/BokehShader.js +65 -0
  433. data/lib-opal/js_wrap/three/shaders/BokehShader2.js +125 -0
  434. data/lib-opal/js_wrap/three/shaders/BrightnessContrastShader.js +47 -0
  435. data/lib-opal/js_wrap/three/shaders/ColorCorrectionShader.js +47 -0
  436. data/lib-opal/js_wrap/three/shaders/ColorifyShader.js +41 -0
  437. data/lib-opal/js_wrap/three/shaders/ConvolutionShader.js +75 -0
  438. data/lib-opal/js_wrap/three/shaders/CopyShader.js +41 -0
  439. data/lib-opal/js_wrap/three/shaders/DOFMipMapShader.js +49 -0
  440. data/lib-opal/js_wrap/three/shaders/DepthLimitedBlurShader.js +95 -0
  441. data/lib-opal/js_wrap/three/shaders/DigitalGlitch.js +79 -0
  442. data/lib-opal/js_wrap/three/shaders/DotScreenShader.js +52 -0
  443. data/lib-opal/js_wrap/three/shaders/FXAAShader.js +78 -0
  444. data/lib-opal/js_wrap/three/shaders/FilmShader.js +69 -0
  445. data/lib-opal/js_wrap/three/shaders/FocusShader.js +52 -0
  446. data/lib-opal/js_wrap/three/shaders/FreiChenShader.js +44 -0
  447. data/lib-opal/js_wrap/three/shaders/GammaCorrectionShader.js +39 -0
  448. data/lib-opal/js_wrap/three/shaders/GodRaysShader.js +140 -0
  449. data/lib-opal/js_wrap/three/shaders/HalftoneShader.js +77 -0
  450. data/lib-opal/js_wrap/three/shaders/HorizontalBlurShader.js +47 -0
  451. data/lib-opal/js_wrap/three/shaders/HorizontalTiltShiftShader.js +49 -0
  452. data/lib-opal/js_wrap/three/shaders/HueSaturationShader.js +47 -0
  453. data/lib-opal/js_wrap/three/shaders/KaleidoShader.js +50 -0
  454. data/lib-opal/js_wrap/three/shaders/LuminosityHighPassShader.js +52 -0
  455. data/lib-opal/js_wrap/three/shaders/LuminosityShader.js +39 -0
  456. data/lib-opal/js_wrap/three/shaders/MMDToonShader.js +48 -0
  457. data/lib-opal/js_wrap/three/shaders/MirrorShader.js +44 -0
  458. data/lib-opal/js_wrap/three/shaders/NormalMapShader.js +48 -0
  459. data/lib-opal/js_wrap/three/shaders/PixelShader.js +44 -0
  460. data/lib-opal/js_wrap/three/shaders/RGBShiftShader.js +50 -0
  461. data/lib-opal/js_wrap/three/shaders/SAOShader.js +85 -0
  462. data/lib-opal/js_wrap/three/shaders/SMAAShader.js +95 -0
  463. data/lib-opal/js_wrap/three/shaders/SSAOShader.js +113 -0
  464. data/lib-opal/js_wrap/three/shaders/SSRShader.js +126 -0
  465. data/lib-opal/js_wrap/three/shaders/SSRrShader.js +106 -0
  466. data/lib-opal/js_wrap/three/shaders/SepiaShader.js +43 -0
  467. data/lib-opal/js_wrap/three/shaders/SobelOperatorShader.js +44 -0
  468. data/lib-opal/js_wrap/three/shaders/SubsurfaceScatteringShader.js +64 -0
  469. data/lib-opal/js_wrap/three/shaders/TechnicolorShader.js +41 -0
  470. data/lib-opal/js_wrap/three/shaders/ToneMapShader.js +53 -0
  471. data/lib-opal/js_wrap/three/shaders/ToonShader.js +148 -0
  472. data/lib-opal/js_wrap/three/shaders/TriangleBlurShader.js +47 -0
  473. data/lib-opal/js_wrap/three/shaders/UnpackDepthRGBAShader.js +42 -0
  474. data/lib-opal/js_wrap/three/shaders/VerticalBlurShader.js +47 -0
  475. data/lib-opal/js_wrap/three/shaders/VerticalTiltShiftShader.js +49 -0
  476. data/lib-opal/js_wrap/three/shaders/VignetteShader.js +46 -0
  477. data/lib-opal/js_wrap/three/shaders/VolumeShader.js +55 -0
  478. data/lib-opal/js_wrap/three/shaders/WaterRefractionShader.js +46 -0
  479. data/lib-opal/js_wrap/three/textures/FlakesTexture.js +61 -0
  480. data/lib-opal/js_wrap/three/utils/BufferGeometryUtils.js +683 -0
  481. data/lib-opal/js_wrap/three/utils/CameraUtils.js +97 -0
  482. data/lib-opal/js_wrap/three/utils/GPUStatsPanel.js +154 -0
  483. data/lib-opal/js_wrap/three/utils/GeometryCompressionUtils.js +468 -0
  484. data/lib-opal/js_wrap/three/utils/GeometryUtils.js +192 -0
  485. data/lib-opal/js_wrap/three/utils/PackedPhongMaterial.js +77 -0
  486. data/lib-opal/js_wrap/three/utils/RoughnessMipmapper.js +169 -0
  487. data/lib-opal/js_wrap/three/utils/SceneUtils.js +62 -0
  488. data/lib-opal/js_wrap/three/utils/ShadowMapViewer.js +182 -0
  489. data/lib-opal/js_wrap/three/utils/SkeletonUtils.js +400 -0
  490. data/lib-opal/js_wrap/three/utils/UVsDebug.js +132 -0
  491. data/lib-opal/js_wrap/three/utils/WorkerPool.js +130 -0
  492. data/lib-opal/js_wrap/three/webxr/ARButton.js +203 -0
  493. data/lib-opal/js_wrap/three/webxr/OculusHandModel.js +131 -0
  494. data/lib-opal/js_wrap/three/webxr/OculusHandPointerModel.js +328 -0
  495. data/lib-opal/js_wrap/three/webxr/Text2D.js +54 -0
  496. data/lib-opal/js_wrap/three/webxr/VRButton.js +181 -0
  497. data/lib-opal/js_wrap/three/webxr/XRControllerModelFactory.js +266 -0
  498. data/lib-opal/js_wrap/three/webxr/XREstimatedLight.js +221 -0
  499. data/lib-opal/js_wrap/three/webxr/XRHandMeshModel.js +93 -0
  500. data/lib-opal/js_wrap/three/webxr/XRHandModelFactory.js +127 -0
  501. data/lib-opal/js_wrap/three/webxr/XRHandPrimitiveModel.js +85 -0
  502. data/opal-js_wrap-three.gemspec +4 -4
  503. metadata +502 -5
@@ -0,0 +1,435 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "three", "../utils/BufferGeometryUtils.js"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("three"), require("../utils/BufferGeometryUtils.js"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.three, global.BufferGeometryUtils);
11
+ global.SimplifyModifier = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three, BufferGeometryUtils) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.SimplifyModifier = void 0;
20
+ BufferGeometryUtils = _interopRequireWildcard(BufferGeometryUtils);
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+
28
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
29
+
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+
32
+ /**
33
+ * Simplification Geometry Modifier
34
+ * - based on code and technique
35
+ * - by Stan Melax in 1998
36
+ * - Progressive Mesh type Polygon Reduction Algorithm
37
+ * - http://www.melax.com/polychop/
38
+ */
39
+ var _cb = new _three.Vector3(),
40
+ _ab = new _three.Vector3();
41
+
42
+ var SimplifyModifier = /*#__PURE__*/function () {
43
+ function SimplifyModifier() {
44
+ _classCallCheck(this, SimplifyModifier);
45
+
46
+ if (BufferGeometryUtils === undefined) {
47
+ throw 'THREE.SimplifyModifier relies on BufferGeometryUtils';
48
+ }
49
+ }
50
+
51
+ _createClass(SimplifyModifier, [{
52
+ key: "modify",
53
+ value: function modify(geometry, count) {
54
+ if (geometry.isGeometry === true) {
55
+ console.error('THREE.SimplifyModifier no longer supports Geometry. Use BufferGeometry instead.');
56
+ return;
57
+ }
58
+
59
+ geometry = geometry.clone();
60
+ var attributes = geometry.attributes; // this modifier can only process indexed and non-indexed geomtries with a position attribute
61
+
62
+ for (var name in attributes) {
63
+ if (name !== 'position') geometry.deleteAttribute(name);
64
+ }
65
+
66
+ geometry = BufferGeometryUtils.mergeVertices(geometry); //
67
+ // put data of original geometry in different data structures
68
+ //
69
+
70
+ var vertices = [];
71
+ var faces = []; // add vertices
72
+
73
+ var positionAttribute = geometry.getAttribute('position');
74
+
75
+ for (var i = 0; i < positionAttribute.count; i++) {
76
+ var v = new _three.Vector3().fromBufferAttribute(positionAttribute, i);
77
+ var vertex = new Vertex(v);
78
+ vertices.push(vertex);
79
+ } // add faces
80
+
81
+
82
+ var index = geometry.getIndex();
83
+
84
+ if (index !== null) {
85
+ for (var _i = 0; _i < index.count; _i += 3) {
86
+ var a = index.getX(_i);
87
+ var b = index.getX(_i + 1);
88
+ var c = index.getX(_i + 2);
89
+ var triangle = new Triangle(vertices[a], vertices[b], vertices[c], a, b, c);
90
+ faces.push(triangle);
91
+ }
92
+ } else {
93
+ for (var _i2 = 0; _i2 < positionAttribute.count; _i2 += 3) {
94
+ var _a = _i2;
95
+
96
+ var _b = _i2 + 1;
97
+
98
+ var _c = _i2 + 2;
99
+
100
+ var _triangle = new Triangle(vertices[_a], vertices[_b], vertices[_c], _a, _b, _c);
101
+
102
+ faces.push(_triangle);
103
+ }
104
+ } // compute all edge collapse costs
105
+
106
+
107
+ for (var _i3 = 0, il = vertices.length; _i3 < il; _i3++) {
108
+ computeEdgeCostAtVertex(vertices[_i3]);
109
+ }
110
+
111
+ var nextVertex;
112
+ var z = count;
113
+
114
+ while (z--) {
115
+ nextVertex = minimumCostEdge(vertices);
116
+
117
+ if (!nextVertex) {
118
+ console.log('THREE.SimplifyModifier: No next vertex');
119
+ break;
120
+ }
121
+
122
+ collapse(vertices, faces, nextVertex, nextVertex.collapseNeighbor);
123
+ } //
124
+
125
+
126
+ var simplifiedGeometry = new _three.BufferGeometry();
127
+ var position = [];
128
+ index = []; //
129
+
130
+ for (var _i4 = 0; _i4 < vertices.length; _i4++) {
131
+ var _vertex = vertices[_i4].position;
132
+ position.push(_vertex.x, _vertex.y, _vertex.z); // cache final index to GREATLY speed up faces reconstruction
133
+
134
+ vertices[_i4].id = _i4;
135
+ } //
136
+
137
+
138
+ for (var _i5 = 0; _i5 < faces.length; _i5++) {
139
+ var face = faces[_i5];
140
+ index.push(face.v1.id, face.v2.id, face.v3.id);
141
+ } //
142
+
143
+
144
+ simplifiedGeometry.setAttribute('position', new _three.Float32BufferAttribute(position, 3));
145
+ simplifiedGeometry.setIndex(index);
146
+ return simplifiedGeometry;
147
+ }
148
+ }]);
149
+
150
+ return SimplifyModifier;
151
+ }();
152
+
153
+ _exports.SimplifyModifier = SimplifyModifier;
154
+
155
+ function pushIfUnique(array, object) {
156
+ if (array.indexOf(object) === -1) array.push(object);
157
+ }
158
+
159
+ function removeFromArray(array, object) {
160
+ var k = array.indexOf(object);
161
+ if (k > -1) array.splice(k, 1);
162
+ }
163
+
164
+ function computeEdgeCollapseCost(u, v) {
165
+ // if we collapse edge uv by moving u to v then how
166
+ // much different will the model change, i.e. the "error".
167
+ var edgelength = v.position.distanceTo(u.position);
168
+ var curvature = 0;
169
+ var sideFaces = []; // find the "sides" triangles that are on the edge uv
170
+
171
+ for (var i = 0, il = u.faces.length; i < il; i++) {
172
+ var face = u.faces[i];
173
+
174
+ if (face.hasVertex(v)) {
175
+ sideFaces.push(face);
176
+ }
177
+ } // use the triangle facing most away from the sides
178
+ // to determine our curvature term
179
+
180
+
181
+ for (var _i6 = 0, _il = u.faces.length; _i6 < _il; _i6++) {
182
+ var minCurvature = 1;
183
+ var _face = u.faces[_i6];
184
+
185
+ for (var j = 0; j < sideFaces.length; j++) {
186
+ var sideFace = sideFaces[j]; // use dot product of face normals.
187
+
188
+ var dotProd = _face.normal.dot(sideFace.normal);
189
+
190
+ minCurvature = Math.min(minCurvature, (1.001 - dotProd) / 2);
191
+ }
192
+
193
+ curvature = Math.max(curvature, minCurvature);
194
+ } // crude approach in attempt to preserve borders
195
+ // though it seems not to be totally correct
196
+
197
+
198
+ var borders = 0;
199
+
200
+ if (sideFaces.length < 2) {
201
+ // we add some arbitrary cost for borders,
202
+ // borders += 10;
203
+ curvature = 1;
204
+ }
205
+
206
+ var amt = edgelength * curvature + borders;
207
+ return amt;
208
+ }
209
+
210
+ function computeEdgeCostAtVertex(v) {
211
+ // compute the edge collapse cost for all edges that start
212
+ // from vertex v. Since we are only interested in reducing
213
+ // the object by selecting the min cost edge at each step, we
214
+ // only cache the cost of the least cost edge at this vertex
215
+ // (in member variable collapse) as well as the value of the
216
+ // cost (in member variable collapseCost).
217
+ if (v.neighbors.length === 0) {
218
+ // collapse if no neighbors.
219
+ v.collapseNeighbor = null;
220
+ v.collapseCost = -0.01;
221
+ return;
222
+ }
223
+
224
+ v.collapseCost = 100000;
225
+ v.collapseNeighbor = null; // search all neighboring edges for "least cost" edge
226
+
227
+ for (var i = 0; i < v.neighbors.length; i++) {
228
+ var collapseCost = computeEdgeCollapseCost(v, v.neighbors[i]);
229
+
230
+ if (!v.collapseNeighbor) {
231
+ v.collapseNeighbor = v.neighbors[i];
232
+ v.collapseCost = collapseCost;
233
+ v.minCost = collapseCost;
234
+ v.totalCost = 0;
235
+ v.costCount = 0;
236
+ }
237
+
238
+ v.costCount++;
239
+ v.totalCost += collapseCost;
240
+
241
+ if (collapseCost < v.minCost) {
242
+ v.collapseNeighbor = v.neighbors[i];
243
+ v.minCost = collapseCost;
244
+ }
245
+ } // we average the cost of collapsing at this vertex
246
+
247
+
248
+ v.collapseCost = v.totalCost / v.costCount; // v.collapseCost = v.minCost;
249
+ }
250
+
251
+ function removeVertex(v, vertices) {
252
+ console.assert(v.faces.length === 0);
253
+
254
+ while (v.neighbors.length) {
255
+ var n = v.neighbors.pop();
256
+ removeFromArray(n.neighbors, v);
257
+ }
258
+
259
+ removeFromArray(vertices, v);
260
+ }
261
+
262
+ function removeFace(f, faces) {
263
+ removeFromArray(faces, f);
264
+ if (f.v1) removeFromArray(f.v1.faces, f);
265
+ if (f.v2) removeFromArray(f.v2.faces, f);
266
+ if (f.v3) removeFromArray(f.v3.faces, f); // TODO optimize this!
267
+
268
+ var vs = [f.v1, f.v2, f.v3];
269
+
270
+ for (var i = 0; i < 3; i++) {
271
+ var v1 = vs[i];
272
+ var v2 = vs[(i + 1) % 3];
273
+ if (!v1 || !v2) continue;
274
+ v1.removeIfNonNeighbor(v2);
275
+ v2.removeIfNonNeighbor(v1);
276
+ }
277
+ }
278
+
279
+ function collapse(vertices, faces, u, v) {
280
+ // u and v are pointers to vertices of an edge
281
+ // Collapse the edge uv by moving vertex u onto v
282
+ if (!v) {
283
+ // u is a vertex all by itself so just delete it..
284
+ removeVertex(u, vertices);
285
+ return;
286
+ }
287
+
288
+ var tmpVertices = [];
289
+
290
+ for (var i = 0; i < u.neighbors.length; i++) {
291
+ tmpVertices.push(u.neighbors[i]);
292
+ } // delete triangles on edge uv:
293
+
294
+
295
+ for (var _i7 = u.faces.length - 1; _i7 >= 0; _i7--) {
296
+ if (u.faces[_i7].hasVertex(v)) {
297
+ removeFace(u.faces[_i7], faces);
298
+ }
299
+ } // update remaining triangles to have v instead of u
300
+
301
+
302
+ for (var _i8 = u.faces.length - 1; _i8 >= 0; _i8--) {
303
+ u.faces[_i8].replaceVertex(u, v);
304
+ }
305
+
306
+ removeVertex(u, vertices); // recompute the edge collapse costs in neighborhood
307
+
308
+ for (var _i9 = 0; _i9 < tmpVertices.length; _i9++) {
309
+ computeEdgeCostAtVertex(tmpVertices[_i9]);
310
+ }
311
+ }
312
+
313
+ function minimumCostEdge(vertices) {
314
+ // O(n * n) approach. TODO optimize this
315
+ var least = vertices[0];
316
+
317
+ for (var i = 0; i < vertices.length; i++) {
318
+ if (vertices[i].collapseCost < least.collapseCost) {
319
+ least = vertices[i];
320
+ }
321
+ }
322
+
323
+ return least;
324
+ } // we use a triangle class to represent structure of face slightly differently
325
+
326
+
327
+ var Triangle = /*#__PURE__*/function () {
328
+ function Triangle(v1, v2, v3, a, b, c) {
329
+ _classCallCheck(this, Triangle);
330
+
331
+ this.a = a;
332
+ this.b = b;
333
+ this.c = c;
334
+ this.v1 = v1;
335
+ this.v2 = v2;
336
+ this.v3 = v3;
337
+ this.normal = new _three.Vector3();
338
+ this.computeNormal();
339
+ v1.faces.push(this);
340
+ v1.addUniqueNeighbor(v2);
341
+ v1.addUniqueNeighbor(v3);
342
+ v2.faces.push(this);
343
+ v2.addUniqueNeighbor(v1);
344
+ v2.addUniqueNeighbor(v3);
345
+ v3.faces.push(this);
346
+ v3.addUniqueNeighbor(v1);
347
+ v3.addUniqueNeighbor(v2);
348
+ }
349
+
350
+ _createClass(Triangle, [{
351
+ key: "computeNormal",
352
+ value: function computeNormal() {
353
+ var vA = this.v1.position;
354
+ var vB = this.v2.position;
355
+ var vC = this.v3.position;
356
+
357
+ _cb.subVectors(vC, vB);
358
+
359
+ _ab.subVectors(vA, vB);
360
+
361
+ _cb.cross(_ab).normalize();
362
+
363
+ this.normal.copy(_cb);
364
+ }
365
+ }, {
366
+ key: "hasVertex",
367
+ value: function hasVertex(v) {
368
+ return v === this.v1 || v === this.v2 || v === this.v3;
369
+ }
370
+ }, {
371
+ key: "replaceVertex",
372
+ value: function replaceVertex(oldv, newv) {
373
+ if (oldv === this.v1) this.v1 = newv;else if (oldv === this.v2) this.v2 = newv;else if (oldv === this.v3) this.v3 = newv;
374
+ removeFromArray(oldv.faces, this);
375
+ newv.faces.push(this);
376
+ oldv.removeIfNonNeighbor(this.v1);
377
+ this.v1.removeIfNonNeighbor(oldv);
378
+ oldv.removeIfNonNeighbor(this.v2);
379
+ this.v2.removeIfNonNeighbor(oldv);
380
+ oldv.removeIfNonNeighbor(this.v3);
381
+ this.v3.removeIfNonNeighbor(oldv);
382
+ this.v1.addUniqueNeighbor(this.v2);
383
+ this.v1.addUniqueNeighbor(this.v3);
384
+ this.v2.addUniqueNeighbor(this.v1);
385
+ this.v2.addUniqueNeighbor(this.v3);
386
+ this.v3.addUniqueNeighbor(this.v1);
387
+ this.v3.addUniqueNeighbor(this.v2);
388
+ this.computeNormal();
389
+ }
390
+ }]);
391
+
392
+ return Triangle;
393
+ }();
394
+
395
+ var Vertex = /*#__PURE__*/function () {
396
+ function Vertex(v) {
397
+ _classCallCheck(this, Vertex);
398
+
399
+ this.position = v;
400
+ this.id = -1; // external use position in vertices list (for e.g. face generation)
401
+
402
+ this.faces = []; // faces vertex is connected
403
+
404
+ this.neighbors = []; // neighbouring vertices aka "adjacentVertices"
405
+ // these will be computed in computeEdgeCostAtVertex()
406
+
407
+ this.collapseCost = 0; // cost of collapsing this vertex, the less the better. aka objdist
408
+
409
+ this.collapseNeighbor = null; // best candinate for collapsing
410
+ }
411
+
412
+ _createClass(Vertex, [{
413
+ key: "addUniqueNeighbor",
414
+ value: function addUniqueNeighbor(vertex) {
415
+ pushIfUnique(this.neighbors, vertex);
416
+ }
417
+ }, {
418
+ key: "removeIfNonNeighbor",
419
+ value: function removeIfNonNeighbor(n) {
420
+ var neighbors = this.neighbors;
421
+ var faces = this.faces;
422
+ var offset = neighbors.indexOf(n);
423
+ if (offset === -1) return;
424
+
425
+ for (var i = 0; i < faces.length; i++) {
426
+ if (faces[i].hasVertex(n)) return;
427
+ }
428
+
429
+ neighbors.splice(offset, 1);
430
+ }
431
+ }]);
432
+
433
+ return Vertex;
434
+ }();
435
+ });
@@ -0,0 +1,264 @@
1
+ (function (global, factory) {
2
+ if (typeof define === "function" && define.amd) {
3
+ define(["exports", "three"], factory);
4
+ } else if (typeof exports !== "undefined") {
5
+ factory(exports, require("three"));
6
+ } else {
7
+ var mod = {
8
+ exports: {}
9
+ };
10
+ factory(mod.exports, global.three);
11
+ global.TessellateModifier = mod.exports;
12
+ }
13
+ })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _three) {
14
+ "use strict";
15
+
16
+ Object.defineProperty(_exports, "__esModule", {
17
+ value: true
18
+ });
19
+ _exports.TessellateModifier = void 0;
20
+
21
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
22
+
23
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
24
+
25
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
+
27
+ /**
28
+ * Break faces with edges longer than maxEdgeLength
29
+ */
30
+ var TessellateModifier = /*#__PURE__*/function () {
31
+ function TessellateModifier() {
32
+ var maxEdgeLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.1;
33
+ var maxIterations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
34
+
35
+ _classCallCheck(this, TessellateModifier);
36
+
37
+ this.maxEdgeLength = maxEdgeLength;
38
+ this.maxIterations = maxIterations;
39
+ }
40
+
41
+ _createClass(TessellateModifier, [{
42
+ key: "modify",
43
+ value: function modify(geometry) {
44
+ if (geometry.isGeometry === true) {
45
+ console.error('THREE.TessellateModifier no longer supports Geometry. Use BufferGeometry instead.');
46
+ return geometry;
47
+ }
48
+
49
+ if (geometry.index !== null) {
50
+ geometry = geometry.toNonIndexed();
51
+ } //
52
+
53
+
54
+ var maxIterations = this.maxIterations;
55
+ var maxEdgeLengthSquared = this.maxEdgeLength * this.maxEdgeLength;
56
+ var va = new _three.Vector3();
57
+ var vb = new _three.Vector3();
58
+ var vc = new _three.Vector3();
59
+ var vm = new _three.Vector3();
60
+ var vs = [va, vb, vc, vm];
61
+ var na = new _three.Vector3();
62
+ var nb = new _three.Vector3();
63
+ var nc = new _three.Vector3();
64
+ var nm = new _three.Vector3();
65
+ var ns = [na, nb, nc, nm];
66
+ var ca = new _three.Color();
67
+ var cb = new _three.Color();
68
+ var cc = new _three.Color();
69
+ var cm = new _three.Color();
70
+ var cs = [ca, cb, cc, cm];
71
+ var ua = new _three.Vector2();
72
+ var ub = new _three.Vector2();
73
+ var uc = new _three.Vector2();
74
+ var um = new _three.Vector2();
75
+ var us = [ua, ub, uc, um];
76
+ var u2a = new _three.Vector2();
77
+ var u2b = new _three.Vector2();
78
+ var u2c = new _three.Vector2();
79
+ var u2m = new _three.Vector2();
80
+ var u2s = [u2a, u2b, u2c, u2m];
81
+ var attributes = geometry.attributes;
82
+ var hasNormals = attributes.normal !== undefined;
83
+ var hasColors = attributes.color !== undefined;
84
+ var hasUVs = attributes.uv !== undefined;
85
+ var hasUV2s = attributes.uv2 !== undefined;
86
+ var positions = attributes.position.array;
87
+ var normals = hasNormals ? attributes.normal.array : null;
88
+ var colors = hasColors ? attributes.color.array : null;
89
+ var uvs = hasUVs ? attributes.uv.array : null;
90
+ var uv2s = hasUV2s ? attributes.uv2.array : null;
91
+ var positions2 = positions;
92
+ var normals2 = normals;
93
+ var colors2 = colors;
94
+ var uvs2 = uvs;
95
+ var uv2s2 = uv2s;
96
+ var iteration = 0;
97
+ var tessellating = true;
98
+
99
+ function addTriangle(a, b, c) {
100
+ var v1 = vs[a];
101
+ var v2 = vs[b];
102
+ var v3 = vs[c];
103
+ positions2.push(v1.x, v1.y, v1.z);
104
+ positions2.push(v2.x, v2.y, v2.z);
105
+ positions2.push(v3.x, v3.y, v3.z);
106
+
107
+ if (hasNormals) {
108
+ var n1 = ns[a];
109
+ var n2 = ns[b];
110
+ var n3 = ns[c];
111
+ normals2.push(n1.x, n1.y, n1.z);
112
+ normals2.push(n2.x, n2.y, n2.z);
113
+ normals2.push(n3.x, n3.y, n3.z);
114
+ }
115
+
116
+ if (hasColors) {
117
+ var c1 = cs[a];
118
+ var c2 = cs[b];
119
+ var c3 = cs[c];
120
+ colors2.push(c1.x, c1.y, c1.z);
121
+ colors2.push(c2.x, c2.y, c2.z);
122
+ colors2.push(c3.x, c3.y, c3.z);
123
+ }
124
+
125
+ if (hasUVs) {
126
+ var u1 = us[a];
127
+ var u2 = us[b];
128
+ var u3 = us[c];
129
+ uvs2.push(u1.x, u1.y);
130
+ uvs2.push(u2.x, u2.y);
131
+ uvs2.push(u3.x, u3.y);
132
+ }
133
+
134
+ if (hasUV2s) {
135
+ var u21 = u2s[a];
136
+ var u22 = u2s[b];
137
+ var u23 = u2s[c];
138
+ uv2s2.push(u21.x, u21.y);
139
+ uv2s2.push(u22.x, u22.y);
140
+ uv2s2.push(u23.x, u23.y);
141
+ }
142
+ }
143
+
144
+ while (tessellating && iteration < maxIterations) {
145
+ iteration++;
146
+ tessellating = false;
147
+ positions = positions2;
148
+ positions2 = [];
149
+
150
+ if (hasNormals) {
151
+ normals = normals2;
152
+ normals2 = [];
153
+ }
154
+
155
+ if (hasColors) {
156
+ colors = colors2;
157
+ colors2 = [];
158
+ }
159
+
160
+ if (hasUVs) {
161
+ uvs = uvs2;
162
+ uvs2 = [];
163
+ }
164
+
165
+ if (hasUV2s) {
166
+ uv2s = uv2s2;
167
+ uv2s2 = [];
168
+ }
169
+
170
+ for (var i = 0, i2 = 0, il = positions.length; i < il; i += 9, i2 += 6) {
171
+ va.fromArray(positions, i + 0);
172
+ vb.fromArray(positions, i + 3);
173
+ vc.fromArray(positions, i + 6);
174
+
175
+ if (hasNormals) {
176
+ na.fromArray(normals, i + 0);
177
+ nb.fromArray(normals, i + 3);
178
+ nc.fromArray(normals, i + 6);
179
+ }
180
+
181
+ if (hasColors) {
182
+ ca.fromArray(colors, i + 0);
183
+ cb.fromArray(colors, i + 3);
184
+ cc.fromArray(colors, i + 6);
185
+ }
186
+
187
+ if (hasUVs) {
188
+ ua.fromArray(uvs, i2 + 0);
189
+ ub.fromArray(uvs, i2 + 2);
190
+ uc.fromArray(uvs, i2 + 4);
191
+ }
192
+
193
+ if (hasUV2s) {
194
+ u2a.fromArray(uv2s, i2 + 0);
195
+ u2b.fromArray(uv2s, i2 + 2);
196
+ u2c.fromArray(uv2s, i2 + 4);
197
+ }
198
+
199
+ var dab = va.distanceToSquared(vb);
200
+ var dbc = vb.distanceToSquared(vc);
201
+ var dac = va.distanceToSquared(vc);
202
+
203
+ if (dab > maxEdgeLengthSquared || dbc > maxEdgeLengthSquared || dac > maxEdgeLengthSquared) {
204
+ tessellating = true;
205
+
206
+ if (dab >= dbc && dab >= dac) {
207
+ vm.lerpVectors(va, vb, 0.5);
208
+ if (hasNormals) nm.lerpVectors(na, nb, 0.5);
209
+ if (hasColors) cm.lerpColors(ca, cb, 0.5);
210
+ if (hasUVs) um.lerpVectors(ua, ub, 0.5);
211
+ if (hasUV2s) u2m.lerpVectors(u2a, u2b, 0.5);
212
+ addTriangle(0, 3, 2);
213
+ addTriangle(3, 1, 2);
214
+ } else if (dbc >= dab && dbc >= dac) {
215
+ vm.lerpVectors(vb, vc, 0.5);
216
+ if (hasNormals) nm.lerpVectors(nb, nc, 0.5);
217
+ if (hasColors) cm.lerpColors(cb, cc, 0.5);
218
+ if (hasUVs) um.lerpVectors(ub, uc, 0.5);
219
+ if (hasUV2s) u2m.lerpVectors(u2b, u2c, 0.5);
220
+ addTriangle(0, 1, 3);
221
+ addTriangle(3, 2, 0);
222
+ } else {
223
+ vm.lerpVectors(va, vc, 0.5);
224
+ if (hasNormals) nm.lerpVectors(na, nc, 0.5);
225
+ if (hasColors) cm.lerpColors(ca, cc, 0.5);
226
+ if (hasUVs) um.lerpVectors(ua, uc, 0.5);
227
+ if (hasUV2s) u2m.lerpVectors(u2a, u2c, 0.5);
228
+ addTriangle(0, 1, 3);
229
+ addTriangle(3, 1, 2);
230
+ }
231
+ } else {
232
+ addTriangle(0, 1, 2);
233
+ }
234
+ }
235
+ }
236
+
237
+ var geometry2 = new _three.BufferGeometry();
238
+ geometry2.setAttribute('position', new _three.Float32BufferAttribute(positions2, 3));
239
+
240
+ if (hasNormals) {
241
+ geometry2.setAttribute('normal', new _three.Float32BufferAttribute(normals2, 3));
242
+ }
243
+
244
+ if (hasColors) {
245
+ geometry2.setAttribute('color', new _three.Float32BufferAttribute(colors2, 3));
246
+ }
247
+
248
+ if (hasUVs) {
249
+ geometry2.setAttribute('uv', new _three.Float32BufferAttribute(uvs2, 2));
250
+ }
251
+
252
+ if (hasUV2s) {
253
+ geometry2.setAttribute('uv2', new _three.Float32BufferAttribute(uv2s2, 2));
254
+ }
255
+
256
+ return geometry2;
257
+ }
258
+ }]);
259
+
260
+ return TessellateModifier;
261
+ }();
262
+
263
+ _exports.TessellateModifier = TessellateModifier;
264
+ });