chili3d 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (472) hide show
  1. package/README.md +14 -175
  2. package/{packages/chili → chili}/package.json +6 -1
  3. package/{packages/chili-builder → chili-builder}/package.json +6 -1
  4. package/{packages/chili-controls → chili-controls}/package.json +6 -1
  5. package/{packages/chili-core → chili-core}/package.json +6 -1
  6. package/{packages/chili-geo → chili-geo}/package.json +6 -1
  7. package/{packages/chili-i18n → chili-i18n}/package.json +6 -1
  8. package/{packages/chili-storage → chili-storage}/package.json +6 -1
  9. package/{packages/chili-three → chili-three}/package.json +6 -1
  10. package/{packages/chili-ui → chili-ui}/package.json +6 -1
  11. package/{packages/chili-vis → chili-vis}/package.json +6 -1
  12. package/{packages/chili-wasm → chili-wasm}/package.json +6 -1
  13. package/{packages/chili-web → chili-web}/package.json +6 -1
  14. package/package.json +18 -48
  15. package/.github/workflows/main.yml +0 -26
  16. package/.vscode/c_cpp_properties.json +0 -30
  17. package/.vscode/launch.json +0 -21
  18. package/.vscode/settings.json +0 -8
  19. package/Dockerfile +0 -7
  20. package/LICENSE +0 -661
  21. package/biome.json +0 -67
  22. package/compose.yml +0 -7
  23. package/cpp/CMakeLists.txt +0 -96
  24. package/cpp/CMakePresets.json +0 -43
  25. package/cpp/README.md +0 -21
  26. package/cpp/src/converter.cpp +0 -413
  27. package/cpp/src/factory.cpp +0 -612
  28. package/cpp/src/geometry.cpp +0 -204
  29. package/cpp/src/mesher.cpp +0 -330
  30. package/cpp/src/opencascade.cpp +0 -414
  31. package/cpp/src/shape.cpp +0 -447
  32. package/cpp/src/shared.cpp +0 -83
  33. package/cpp/src/shared.hpp +0 -211
  34. package/cpp/src/transient.cpp +0 -29
  35. package/cpp/src/utils.cpp +0 -114
  36. package/cpp/src/utils.hpp +0 -25
  37. package/cpp/test/index.html +0 -146
  38. package/packages/chili/test/command.test.ts +0 -4
  39. package/packages/chili-controls/test/converter.test.ts +0 -70
  40. package/packages/chili-controls/test/styleMock.js +0 -4
  41. package/packages/chili-core/test/binding.test.ts +0 -95
  42. package/packages/chili-core/test/boundingBox.test.ts +0 -60
  43. package/packages/chili-core/test/collection.test.ts +0 -53
  44. package/packages/chili-core/test/history.test.ts +0 -42
  45. package/packages/chili-core/test/line.test.ts +0 -75
  46. package/packages/chili-core/test/linesegment.test.ts +0 -98
  47. package/packages/chili-core/test/linkedList.test.ts +0 -82
  48. package/packages/chili-core/test/math.test.ts +0 -34
  49. package/packages/chili-core/test/matrix.test.ts +0 -129
  50. package/packages/chili-core/test/node.test.ts +0 -122
  51. package/packages/chili-core/test/nodeList.test.ts +0 -247
  52. package/packages/chili-core/test/observer.test.ts +0 -91
  53. package/packages/chili-core/test/plane.test.ts +0 -31
  54. package/packages/chili-core/test/quaternion.test.ts +0 -14
  55. package/packages/chili-core/test/result.test.ts +0 -24
  56. package/packages/chili-core/test/serializer.test.ts +0 -58
  57. package/packages/chili-core/test/snapType.test.ts +0 -10
  58. package/packages/chili-core/test/task.test.ts +0 -41
  59. package/packages/chili-core/test/testDocument.ts +0 -70
  60. package/packages/chili-core/test/transaction.test.ts +0 -42
  61. package/packages/chili-core/test/visual.test.ts +0 -42
  62. package/packages/chili-core/test/xyz.test.ts +0 -260
  63. package/packages/chili-three/test/cameraControls.ts +0 -10
  64. package/packages/chili-three/test/testDocument.ts +0 -68
  65. package/packages/chili-three/test/testEdge.ts +0 -171
  66. package/packages/chili-three/test/testView.ts +0 -78
  67. package/packages/chili-three/test/three.test.ts +0 -44
  68. package/packages/chili-three/test/viewGizmo.ts +0 -12
  69. package/packages/global.d.ts +0 -31
  70. package/public/favicon.svg +0 -10
  71. package/public/fonts/fzhei.json +0 -46120
  72. package/public/iconfont.js +0 -1
  73. package/public/images/wechat.jpg +0 -0
  74. package/public/index.css +0 -13
  75. package/public/index.html +0 -24
  76. package/rspack.config.ts +0 -93
  77. package/rstest.config.ts +0 -27
  78. package/screenshots/screenshot.png +0 -0
  79. package/scripts/add_copyright.mjs +0 -59
  80. package/scripts/build-npm.mjs +0 -105
  81. package/scripts/common.mjs +0 -24
  82. package/scripts/release.mjs +0 -92
  83. package/scripts/restore-package-json.mjs +0 -27
  84. package/scripts/setup_wasm_deps.mjs +0 -97
  85. package/scripts/update-package-json.mjs +0 -27
  86. package/tsconfig.build.json +0 -14
  87. package/tsconfig.build.tsbuildinfo +0 -1
  88. package/tsconfig.json +0 -19
  89. /package/{packages/chili → chili}/src/application.ts +0 -0
  90. /package/{packages/chili → chili}/src/bodys/arc.ts +0 -0
  91. /package/{packages/chili → chili}/src/bodys/boolean.ts +0 -0
  92. /package/{packages/chili → chili}/src/bodys/box.ts +0 -0
  93. /package/{packages/chili → chili}/src/bodys/circle.ts +0 -0
  94. /package/{packages/chili → chili}/src/bodys/cone.ts +0 -0
  95. /package/{packages/chili → chili}/src/bodys/cylinder.ts +0 -0
  96. /package/{packages/chili → chili}/src/bodys/ellipse.ts +0 -0
  97. /package/{packages/chili → chili}/src/bodys/face.ts +0 -0
  98. /package/{packages/chili → chili}/src/bodys/fuse.ts +0 -0
  99. /package/{packages/chili → chili}/src/bodys/index.ts +0 -0
  100. /package/{packages/chili → chili}/src/bodys/line.ts +0 -0
  101. /package/{packages/chili → chili}/src/bodys/polygon.ts +0 -0
  102. /package/{packages/chili → chili}/src/bodys/prism.ts +0 -0
  103. /package/{packages/chili → chili}/src/bodys/pyramid.ts +0 -0
  104. /package/{packages/chili → chili}/src/bodys/rect.ts +0 -0
  105. /package/{packages/chili → chili}/src/bodys/revolve.ts +0 -0
  106. /package/{packages/chili → chili}/src/bodys/sphere.ts +0 -0
  107. /package/{packages/chili → chili}/src/bodys/sweep.ts +0 -0
  108. /package/{packages/chili → chili}/src/bodys/wire.ts +0 -0
  109. /package/{packages/chili → chili}/src/commands/application/index.ts +0 -0
  110. /package/{packages/chili → chili}/src/commands/application/newDocument.ts +0 -0
  111. /package/{packages/chili → chili}/src/commands/application/openDocument.ts +0 -0
  112. /package/{packages/chili → chili}/src/commands/application/performanceTest.ts +0 -0
  113. /package/{packages/chili → chili}/src/commands/application/saveDocument.ts +0 -0
  114. /package/{packages/chili → chili}/src/commands/application/toFile.ts +0 -0
  115. /package/{packages/chili → chili}/src/commands/application/toggleDynamicWorkplane.ts +0 -0
  116. /package/{packages/chili → chili}/src/commands/application/wechatGroup.ts +0 -0
  117. /package/{packages/chili → chili}/src/commands/boolean.ts +0 -0
  118. /package/{packages/chili → chili}/src/commands/create/arc.ts +0 -0
  119. /package/{packages/chili → chili}/src/commands/create/bezier.ts +0 -0
  120. /package/{packages/chili → chili}/src/commands/create/box.ts +0 -0
  121. /package/{packages/chili → chili}/src/commands/create/circle.ts +0 -0
  122. /package/{packages/chili → chili}/src/commands/create/cone.ts +0 -0
  123. /package/{packages/chili → chili}/src/commands/create/converter.ts +0 -0
  124. /package/{packages/chili → chili}/src/commands/create/copySubShape.ts +0 -0
  125. /package/{packages/chili → chili}/src/commands/create/curveProjection.ts +0 -0
  126. /package/{packages/chili → chili}/src/commands/create/cylinder.ts +0 -0
  127. /package/{packages/chili → chili}/src/commands/create/ellipse.ts +0 -0
  128. /package/{packages/chili → chili}/src/commands/create/group.ts +0 -0
  129. /package/{packages/chili → chili}/src/commands/create/index.ts +0 -0
  130. /package/{packages/chili → chili}/src/commands/create/line.ts +0 -0
  131. /package/{packages/chili → chili}/src/commands/create/loft.ts +0 -0
  132. /package/{packages/chili → chili}/src/commands/create/offset.ts +0 -0
  133. /package/{packages/chili → chili}/src/commands/create/polygon.ts +0 -0
  134. /package/{packages/chili → chili}/src/commands/create/prism.ts +0 -0
  135. /package/{packages/chili → chili}/src/commands/create/pyramid.ts +0 -0
  136. /package/{packages/chili → chili}/src/commands/create/rect.ts +0 -0
  137. /package/{packages/chili → chili}/src/commands/create/revolve.ts +0 -0
  138. /package/{packages/chili → chili}/src/commands/create/section.ts +0 -0
  139. /package/{packages/chili → chili}/src/commands/create/sphere.ts +0 -0
  140. /package/{packages/chili → chili}/src/commands/create/sweep.ts +0 -0
  141. /package/{packages/chili → chili}/src/commands/create/thickSolid.ts +0 -0
  142. /package/{packages/chili → chili}/src/commands/createActCommand.ts +0 -0
  143. /package/{packages/chili → chili}/src/commands/createCommand.ts +0 -0
  144. /package/{packages/chili → chili}/src/commands/delete.ts +0 -0
  145. /package/{packages/chili → chili}/src/commands/folder.ts +0 -0
  146. /package/{packages/chili → chili}/src/commands/importExport.ts +0 -0
  147. /package/{packages/chili → chili}/src/commands/index.ts +0 -0
  148. /package/{packages/chili → chili}/src/commands/measure/angle.ts +0 -0
  149. /package/{packages/chili → chili}/src/commands/measure/index.ts +0 -0
  150. /package/{packages/chili → chili}/src/commands/measure/length.ts +0 -0
  151. /package/{packages/chili → chili}/src/commands/measure/select.module.css +0 -0
  152. /package/{packages/chili → chili}/src/commands/measure/select.ts +0 -0
  153. /package/{packages/chili → chili}/src/commands/modify/array.ts +0 -0
  154. /package/{packages/chili → chili}/src/commands/modify/break.ts +0 -0
  155. /package/{packages/chili → chili}/src/commands/modify/brush.ts +0 -0
  156. /package/{packages/chili → chili}/src/commands/modify/chamfer.ts +0 -0
  157. /package/{packages/chili → chili}/src/commands/modify/explode.ts +0 -0
  158. /package/{packages/chili → chili}/src/commands/modify/fillet.ts +0 -0
  159. /package/{packages/chili → chili}/src/commands/modify/index.ts +0 -0
  160. /package/{packages/chili → chili}/src/commands/modify/mirror.ts +0 -0
  161. /package/{packages/chili → chili}/src/commands/modify/move.ts +0 -0
  162. /package/{packages/chili → chili}/src/commands/modify/removeFeature.ts +0 -0
  163. /package/{packages/chili → chili}/src/commands/modify/removeSubShapes.ts +0 -0
  164. /package/{packages/chili → chili}/src/commands/modify/rotate.ts +0 -0
  165. /package/{packages/chili → chili}/src/commands/modify/split.ts +0 -0
  166. /package/{packages/chili → chili}/src/commands/modify/transformedCommand.ts +0 -0
  167. /package/{packages/chili → chili}/src/commands/modify/trim.ts +0 -0
  168. /package/{packages/chili → chili}/src/commands/multistepCommand.ts +0 -0
  169. /package/{packages/chili → chili}/src/commands/redo.ts +0 -0
  170. /package/{packages/chili → chili}/src/commands/undo.ts +0 -0
  171. /package/{packages/chili → chili}/src/commands/workingPlane.ts +0 -0
  172. /package/{packages/chili → chili}/src/comparers/NumberEqualityComparer.ts +0 -0
  173. /package/{packages/chili → chili}/src/comparers/XYZEqualityComparer.ts +0 -0
  174. /package/{packages/chili → chili}/src/comparers/index.ts +0 -0
  175. /package/{packages/chili → chili}/src/document.ts +0 -0
  176. /package/{packages/chili → chili}/src/editEventHandler.ts +0 -0
  177. /package/{packages/chili → chili}/src/index.ts +0 -0
  178. /package/{packages/chili → chili}/src/selection.ts +0 -0
  179. /package/{packages/chili → chili}/src/services/commandService.ts +0 -0
  180. /package/{packages/chili → chili}/src/services/editorService.ts +0 -0
  181. /package/{packages/chili → chili}/src/services/hotkeyService.ts +0 -0
  182. /package/{packages/chili → chili}/src/services/index.ts +0 -0
  183. /package/{packages/chili → chili}/src/snap/dimension.ts +0 -0
  184. /package/{packages/chili → chili}/src/snap/handlers/angleSnapEventHandler.ts +0 -0
  185. /package/{packages/chili → chili}/src/snap/handlers/index.ts +0 -0
  186. /package/{packages/chili → chili}/src/snap/handlers/lengthSnapEventHandler.ts +0 -0
  187. /package/{packages/chili → chili}/src/snap/handlers/pointSnapEventHandler.ts +0 -0
  188. /package/{packages/chili → chili}/src/snap/handlers/snapEventHandler.ts +0 -0
  189. /package/{packages/chili → chili}/src/snap/index.ts +0 -0
  190. /package/{packages/chili → chili}/src/snap/snap.ts +0 -0
  191. /package/{packages/chili → chili}/src/snap/snaps/axisSnap.ts +0 -0
  192. /package/{packages/chili → chili}/src/snap/snaps/baseSnap.ts +0 -0
  193. /package/{packages/chili → chili}/src/snap/snaps/featurePointStrategy.ts +0 -0
  194. /package/{packages/chili → chili}/src/snap/snaps/index.ts +0 -0
  195. /package/{packages/chili → chili}/src/snap/snaps/objectSnap.ts +0 -0
  196. /package/{packages/chili → chili}/src/snap/snaps/planeSnap.ts +0 -0
  197. /package/{packages/chili → chili}/src/snap/snaps/pointOnCurveSnap.ts +0 -0
  198. /package/{packages/chili → chili}/src/snap/tracking/axis.ts +0 -0
  199. /package/{packages/chili → chili}/src/snap/tracking/axisTracking.ts +0 -0
  200. /package/{packages/chili → chili}/src/snap/tracking/index.ts +0 -0
  201. /package/{packages/chili → chili}/src/snap/tracking/objectTracking.ts +0 -0
  202. /package/{packages/chili → chili}/src/snap/tracking/trackingBase.ts +0 -0
  203. /package/{packages/chili → chili}/src/snap/tracking/trackingSnap.ts +0 -0
  204. /package/{packages/chili → chili}/src/step/angleStep.ts +0 -0
  205. /package/{packages/chili → chili}/src/step/index.ts +0 -0
  206. /package/{packages/chili → chili}/src/step/lengthStep.ts +0 -0
  207. /package/{packages/chili → chili}/src/step/pointStep.ts +0 -0
  208. /package/{packages/chili → chili}/src/step/selectStep.ts +0 -0
  209. /package/{packages/chili → chili}/src/step/step.ts +0 -0
  210. /package/{packages/chili → chili}/src/utils.ts +0 -0
  211. /package/{packages/chili-builder → chili-builder}/src/additionalModule.ts +0 -0
  212. /package/{packages/chili-builder → chili-builder}/src/appBuilder.ts +0 -0
  213. /package/{packages/chili-builder → chili-builder}/src/defaultDataExchange.ts +0 -0
  214. /package/{packages/chili-builder → chili-builder}/src/index.ts +0 -0
  215. /package/{packages/chili-builder → chili-builder}/src/ribbon.ts +0 -0
  216. /package/{packages/chili-controls → chili-controls}/src/collection.ts +0 -0
  217. /package/{packages/chili-controls → chili-controls}/src/controls.ts +0 -0
  218. /package/{packages/chili-controls → chili-controls}/src/converters/colorConverter.ts +0 -0
  219. /package/{packages/chili-controls → chili-controls}/src/converters/index.ts +0 -0
  220. /package/{packages/chili-controls → chili-controls}/src/converters/numberConverter.ts +0 -0
  221. /package/{packages/chili-controls → chili-controls}/src/converters/stringConverter.ts +0 -0
  222. /package/{packages/chili-controls → chili-controls}/src/converters/urlConverter.ts +0 -0
  223. /package/{packages/chili-controls → chili-controls}/src/converters/xyzConverter.ts +0 -0
  224. /package/{packages/chili-controls → chili-controls}/src/expander/expander.module.css +0 -0
  225. /package/{packages/chili-controls → chili-controls}/src/expander/expander.ts +0 -0
  226. /package/{packages/chili-controls → chili-controls}/src/expander/index.ts +0 -0
  227. /package/{packages/chili-controls → chili-controls}/src/htmlProps.ts +0 -0
  228. /package/{packages/chili-controls → chili-controls}/src/index.ts +0 -0
  229. /package/{packages/chili-controls → chili-controls}/src/radioGroup.module.css +0 -0
  230. /package/{packages/chili-controls → chili-controls}/src/radioGroup.ts +0 -0
  231. /package/{packages/chili-controls → chili-controls}/src/utils.ts +0 -0
  232. /package/{packages/chili-core → chili-core}/src/application.ts +0 -0
  233. /package/{packages/chili-core → chili-core}/src/command/command.ts +0 -0
  234. /package/{packages/chili-core → chili-core}/src/command/commandKeys.ts +0 -0
  235. /package/{packages/chili-core → chili-core}/src/command/decarator.ts +0 -0
  236. /package/{packages/chili-core → chili-core}/src/command/index.ts +0 -0
  237. /package/{packages/chili-core → chili-core}/src/config.ts +0 -0
  238. /package/{packages/chili-core → chili-core}/src/constants.ts +0 -0
  239. /package/{packages/chili-core → chili-core}/src/dataExchange.ts +0 -0
  240. /package/{packages/chili-core → chili-core}/src/document.ts +0 -0
  241. /package/{packages/chili-core → chili-core}/src/editor.ts +0 -0
  242. /package/{packages/chili-core → chili-core}/src/foundation/asyncController.ts +0 -0
  243. /package/{packages/chili-core → chili-core}/src/foundation/binding.ts +0 -0
  244. /package/{packages/chili-core → chili-core}/src/foundation/collection.ts +0 -0
  245. /package/{packages/chili-core → chili-core}/src/foundation/converter.ts +0 -0
  246. /package/{packages/chili-core → chili-core}/src/foundation/deepObserver.ts +0 -0
  247. /package/{packages/chili-core → chili-core}/src/foundation/disposable.ts +0 -0
  248. /package/{packages/chili-core → chili-core}/src/foundation/dto/index.ts +0 -0
  249. /package/{packages/chili-core → chili-core}/src/foundation/equalityComparer.ts +0 -0
  250. /package/{packages/chili-core → chili-core}/src/foundation/gc.ts +0 -0
  251. /package/{packages/chili-core → chili-core}/src/foundation/history.ts +0 -0
  252. /package/{packages/chili-core → chili-core}/src/foundation/id.ts +0 -0
  253. /package/{packages/chili-core → chili-core}/src/foundation/index.ts +0 -0
  254. /package/{packages/chili-core → chili-core}/src/foundation/lazy.ts +0 -0
  255. /package/{packages/chili-core → chili-core}/src/foundation/linkedList.ts +0 -0
  256. /package/{packages/chili-core → chili-core}/src/foundation/logger.ts +0 -0
  257. /package/{packages/chili-core → chili-core}/src/foundation/messageType.ts +0 -0
  258. /package/{packages/chili-core → chili-core}/src/foundation/objectStorage.ts +0 -0
  259. /package/{packages/chili-core → chili-core}/src/foundation/observer.ts +0 -0
  260. /package/{packages/chili-core → chili-core}/src/foundation/precision.ts +0 -0
  261. /package/{packages/chili-core → chili-core}/src/foundation/pubsub.ts +0 -0
  262. /package/{packages/chili-core → chili-core}/src/foundation/result.ts +0 -0
  263. /package/{packages/chili-core → chili-core}/src/foundation/storage.ts +0 -0
  264. /package/{packages/chili-core → chili-core}/src/foundation/transaction.ts +0 -0
  265. /package/{packages/chili-core → chili-core}/src/foundation/utils/debounce.ts +0 -0
  266. /package/{packages/chili-core → chili-core}/src/foundation/utils/download.ts +0 -0
  267. /package/{packages/chili-core → chili-core}/src/foundation/utils/index.ts +0 -0
  268. /package/{packages/chili-core → chili-core}/src/foundation/utils/readFileAsync.ts +0 -0
  269. /package/{packages/chili-core → chili-core}/src/i18n/i18n.ts +0 -0
  270. /package/{packages/chili-core → chili-core}/src/i18n/index.ts +0 -0
  271. /package/{packages/chili-core → chili-core}/src/i18n/keys.ts +0 -0
  272. /package/{packages/chili-core → chili-core}/src/index.ts +0 -0
  273. /package/{packages/chili-core → chili-core}/src/material.ts +0 -0
  274. /package/{packages/chili-core → chili-core}/src/math/boundingBox.ts +0 -0
  275. /package/{packages/chili-core → chili-core}/src/math/index.ts +0 -0
  276. /package/{packages/chili-core → chili-core}/src/math/line.ts +0 -0
  277. /package/{packages/chili-core → chili-core}/src/math/lineSegment.ts +0 -0
  278. /package/{packages/chili-core → chili-core}/src/math/mathUtils.ts +0 -0
  279. /package/{packages/chili-core → chili-core}/src/math/matrix4.ts +0 -0
  280. /package/{packages/chili-core → chili-core}/src/math/plane.ts +0 -0
  281. /package/{packages/chili-core → chili-core}/src/math/planeAngle.ts +0 -0
  282. /package/{packages/chili-core → chili-core}/src/math/quaternion.ts +0 -0
  283. /package/{packages/chili-core → chili-core}/src/math/ray.ts +0 -0
  284. /package/{packages/chili-core → chili-core}/src/math/xy.ts +0 -0
  285. /package/{packages/chili-core → chili-core}/src/math/xyz.ts +0 -0
  286. /package/{packages/chili-core → chili-core}/src/model/component.ts +0 -0
  287. /package/{packages/chili-core → chili-core}/src/model/facebaseNode.ts +0 -0
  288. /package/{packages/chili-core → chili-core}/src/model/folderNode.ts +0 -0
  289. /package/{packages/chili-core → chili-core}/src/model/geometryNode.ts +0 -0
  290. /package/{packages/chili-core → chili-core}/src/model/groupNode.ts +0 -0
  291. /package/{packages/chili-core → chili-core}/src/model/index.ts +0 -0
  292. /package/{packages/chili-core → chili-core}/src/model/meshNode.ts +0 -0
  293. /package/{packages/chili-core → chili-core}/src/model/node.ts +0 -0
  294. /package/{packages/chili-core → chili-core}/src/model/shapeNode.ts +0 -0
  295. /package/{packages/chili-core → chili-core}/src/model/visualNode.ts +0 -0
  296. /package/{packages/chili-core → chili-core}/src/modelManager.ts +0 -0
  297. /package/{packages/chili-core → chili-core}/src/navigation.ts +0 -0
  298. /package/{packages/chili-core → chili-core}/src/property.ts +0 -0
  299. /package/{packages/chili-core → chili-core}/src/selection.ts +0 -0
  300. /package/{packages/chili-core → chili-core}/src/selectionFilter.ts +0 -0
  301. /package/{packages/chili-core → chili-core}/src/serialize/index.ts +0 -0
  302. /package/{packages/chili-core → chili-core}/src/serialize/serializer.ts +0 -0
  303. /package/{packages/chili-core → chili-core}/src/service.ts +0 -0
  304. /package/{packages/chili-core → chili-core}/src/shape/curve.ts +0 -0
  305. /package/{packages/chili-core → chili-core}/src/shape/geometry.ts +0 -0
  306. /package/{packages/chili-core → chili-core}/src/shape/index.ts +0 -0
  307. /package/{packages/chili-core → chili-core}/src/shape/lineType.ts +0 -0
  308. /package/{packages/chili-core → chili-core}/src/shape/meshData.ts +0 -0
  309. /package/{packages/chili-core → chili-core}/src/shape/shape.ts +0 -0
  310. /package/{packages/chili-core → chili-core}/src/shape/shapeConverter.ts +0 -0
  311. /package/{packages/chili-core → chili-core}/src/shape/shapeFactory.ts +0 -0
  312. /package/{packages/chili-core → chili-core}/src/shape/shapeType.ts +0 -0
  313. /package/{packages/chili-core → chili-core}/src/shape/surface.ts +0 -0
  314. /package/{packages/chili-core → chili-core}/src/snapType.ts +0 -0
  315. /package/{packages/chili-core → chili-core}/src/ui/button.ts +0 -0
  316. /package/{packages/chili-core → chili-core}/src/ui/combobox.ts +0 -0
  317. /package/{packages/chili-core → chili-core}/src/ui/dialog.ts +0 -0
  318. /package/{packages/chili-core → chili-core}/src/ui/index.ts +0 -0
  319. /package/{packages/chili-core → chili-core}/src/ui/ribbon.ts +0 -0
  320. /package/{packages/chili-core → chili-core}/src/ui/window.ts +0 -0
  321. /package/{packages/chili-core → chili-core}/src/visual/act.ts +0 -0
  322. /package/{packages/chili-core → chili-core}/src/visual/cameraController.ts +0 -0
  323. /package/{packages/chili-core → chili-core}/src/visual/cursorType.ts +0 -0
  324. /package/{packages/chili-core → chili-core}/src/visual/detectedData.ts +0 -0
  325. /package/{packages/chili-core → chili-core}/src/visual/eventHandler.ts +0 -0
  326. /package/{packages/chili-core → chili-core}/src/visual/highlighter.ts +0 -0
  327. /package/{packages/chili-core → chili-core}/src/visual/index.ts +0 -0
  328. /package/{packages/chili-core → chili-core}/src/visual/meshExporter.ts +0 -0
  329. /package/{packages/chili-core → chili-core}/src/visual/meshUtils.ts +0 -0
  330. /package/{packages/chili-core → chili-core}/src/visual/textGenerator.ts +0 -0
  331. /package/{packages/chili-core → chili-core}/src/visual/view.ts +0 -0
  332. /package/{packages/chili-core → chili-core}/src/visual/viewGizmo.ts +0 -0
  333. /package/{packages/chili-core → chili-core}/src/visual/viewport.ts +0 -0
  334. /package/{packages/chili-core → chili-core}/src/visual/visual.ts +0 -0
  335. /package/{packages/chili-core → chili-core}/src/visual/visualContext.ts +0 -0
  336. /package/{packages/chili-core → chili-core}/src/visual/visualFactory.ts +0 -0
  337. /package/{packages/chili-core → chili-core}/src/visual/visualObject.ts +0 -0
  338. /package/{packages/chili-core → chili-core}/src/visual/visualShape.ts +0 -0
  339. /package/{packages/chili-geo → chili-geo}/src/index.ts +0 -0
  340. /package/{packages/chili-geo → chili-geo}/src/utils.ts +0 -0
  341. /package/{packages/chili-i18n → chili-i18n}/src/en.ts +0 -0
  342. /package/{packages/chili-i18n → chili-i18n}/src/index.ts +0 -0
  343. /package/{packages/chili-i18n → chili-i18n}/src/pt-br.ts +0 -0
  344. /package/{packages/chili-i18n → chili-i18n}/src/zh-cn.ts +0 -0
  345. /package/{packages/chili-storage → chili-storage}/src/index.ts +0 -0
  346. /package/{packages/chili-storage → chili-storage}/src/indexedDBStorage.ts +0 -0
  347. /package/{packages/chili-three → chili-three}/src/cameraController.ts +0 -0
  348. /package/{packages/chili-three → chili-three}/src/common.ts +0 -0
  349. /package/{packages/chili-three → chili-three}/src/constants.ts +0 -0
  350. /package/{packages/chili-three → chili-three}/src/highlightable.ts +0 -0
  351. /package/{packages/chili-three → chili-three}/src/index.ts +0 -0
  352. /package/{packages/chili-three → chili-three}/src/meshExporter.ts +0 -0
  353. /package/{packages/chili-three → chili-three}/src/outlinePass.js +0 -0
  354. /package/{packages/chili-three → chili-three}/src/texture_points.jpg +0 -0
  355. /package/{packages/chili-three → chili-three}/src/threeGeometry.ts +0 -0
  356. /package/{packages/chili-three → chili-three}/src/threeGeometryFactory.ts +0 -0
  357. /package/{packages/chili-three → chili-three}/src/threeHelper.ts +0 -0
  358. /package/{packages/chili-three → chili-three}/src/threeHighlighter.ts +0 -0
  359. /package/{packages/chili-three → chili-three}/src/threeView.module.css +0 -0
  360. /package/{packages/chili-three → chili-three}/src/threeView.ts +0 -0
  361. /package/{packages/chili-three → chili-three}/src/threeViewEventHandler.ts +0 -0
  362. /package/{packages/chili-three → chili-three}/src/threeVisual.ts +0 -0
  363. /package/{packages/chili-three → chili-three}/src/threeVisualContext.ts +0 -0
  364. /package/{packages/chili-three → chili-three}/src/threeVisualFactory.ts +0 -0
  365. /package/{packages/chili-three → chili-three}/src/threeVisualObject.ts +0 -0
  366. /package/{packages/chili-three → chili-three}/src/viewGizmo.ts +0 -0
  367. /package/{packages/chili-ui → chili-ui}/src/cursor/draw.cur +0 -0
  368. /package/{packages/chili-ui → chili-ui}/src/cursor/index.ts +0 -0
  369. /package/{packages/chili-ui → chili-ui}/src/dialog.module.css +0 -0
  370. /package/{packages/chili-ui → chili-ui}/src/dialog.ts +0 -0
  371. /package/{packages/chili-ui → chili-ui}/src/editor.module.css +0 -0
  372. /package/{packages/chili-ui → chili-ui}/src/editor.ts +0 -0
  373. /package/{packages/chili-ui → chili-ui}/src/home/home.module.css +0 -0
  374. /package/{packages/chili-ui → chili-ui}/src/home/home.ts +0 -0
  375. /package/{packages/chili-ui → chili-ui}/src/home/index.ts +0 -0
  376. /package/{packages/chili-ui → chili-ui}/src/home/languageSelector.ts +0 -0
  377. /package/{packages/chili-ui → chili-ui}/src/home/navigation3DSelector.ts +0 -0
  378. /package/{packages/chili-ui → chili-ui}/src/home/themeSelector.ts +0 -0
  379. /package/{packages/chili-ui → chili-ui}/src/index.ts +0 -0
  380. /package/{packages/chili-ui → chili-ui}/src/mainWindow.module.css +0 -0
  381. /package/{packages/chili-ui → chili-ui}/src/mainWindow.ts +0 -0
  382. /package/{packages/chili-ui → chili-ui}/src/okCancel.module.css +0 -0
  383. /package/{packages/chili-ui → chili-ui}/src/okCancel.ts +0 -0
  384. /package/{packages/chili-ui → chili-ui}/src/permanent.module.css +0 -0
  385. /package/{packages/chili-ui → chili-ui}/src/permanent.ts +0 -0
  386. /package/{packages/chili-ui → chili-ui}/src/project/index.ts +0 -0
  387. /package/{packages/chili-ui → chili-ui}/src/project/projectView.module.css +0 -0
  388. /package/{packages/chili-ui → chili-ui}/src/project/projectView.ts +0 -0
  389. /package/{packages/chili-ui → chili-ui}/src/project/toolBar.module.css +0 -0
  390. /package/{packages/chili-ui → chili-ui}/src/project/toolBar.ts +0 -0
  391. /package/{packages/chili-ui → chili-ui}/src/project/tree/index.ts +0 -0
  392. /package/{packages/chili-ui → chili-ui}/src/project/tree/tree.module.css +0 -0
  393. /package/{packages/chili-ui → chili-ui}/src/project/tree/tree.ts +0 -0
  394. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItem.module.css +0 -0
  395. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItem.ts +0 -0
  396. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItemGroup.module.css +0 -0
  397. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItemGroup.ts +0 -0
  398. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeModel.module.css +0 -0
  399. /package/{packages/chili-ui → chili-ui}/src/project/tree/treeModel.ts +0 -0
  400. /package/{packages/chili-ui → chili-ui}/src/property/check.ts +0 -0
  401. /package/{packages/chili-ui → chili-ui}/src/property/colorPorperty.module.css +0 -0
  402. /package/{packages/chili-ui → chili-ui}/src/property/colorProperty.ts +0 -0
  403. /package/{packages/chili-ui → chili-ui}/src/property/common.module.css +0 -0
  404. /package/{packages/chili-ui → chili-ui}/src/property/index.ts +0 -0
  405. /package/{packages/chili-ui → chili-ui}/src/property/input.module.css +0 -0
  406. /package/{packages/chili-ui → chili-ui}/src/property/input.ts +0 -0
  407. /package/{packages/chili-ui → chili-ui}/src/property/material/index.ts +0 -0
  408. /package/{packages/chili-ui → chili-ui}/src/property/material/materialDataContent.ts +0 -0
  409. /package/{packages/chili-ui → chili-ui}/src/property/material/materialEditor.module.css +0 -0
  410. /package/{packages/chili-ui → chili-ui}/src/property/material/materialEditor.ts +0 -0
  411. /package/{packages/chili-ui → chili-ui}/src/property/material/textureEditor.module.css +0 -0
  412. /package/{packages/chili-ui → chili-ui}/src/property/material/textureEditor.ts +0 -0
  413. /package/{packages/chili-ui → chili-ui}/src/property/materialProperty.module.css +0 -0
  414. /package/{packages/chili-ui → chili-ui}/src/property/materialProperty.ts +0 -0
  415. /package/{packages/chili-ui → chili-ui}/src/property/matrixProperty.ts +0 -0
  416. /package/{packages/chili-ui → chili-ui}/src/property/propertyBase.module.css +0 -0
  417. /package/{packages/chili-ui → chili-ui}/src/property/propertyBase.ts +0 -0
  418. /package/{packages/chili-ui → chili-ui}/src/property/propertyView.module.css +0 -0
  419. /package/{packages/chili-ui → chili-ui}/src/property/propertyView.ts +0 -0
  420. /package/{packages/chili-ui → chili-ui}/src/property/utils.ts +0 -0
  421. /package/{packages/chili-ui → chili-ui}/src/ribbon/commandContext.module.css +0 -0
  422. /package/{packages/chili-ui → chili-ui}/src/ribbon/commandContext.ts +0 -0
  423. /package/{packages/chili-ui → chili-ui}/src/ribbon/index.ts +0 -0
  424. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbon.module.css +0 -0
  425. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbon.ts +0 -0
  426. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonButton.module.css +0 -0
  427. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonButton.ts +0 -0
  428. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonData.ts +0 -0
  429. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonStack.module.css +0 -0
  430. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonStack.ts +0 -0
  431. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonToggleButton.module.css +0 -0
  432. /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonToggleButton.ts +0 -0
  433. /package/{packages/chili-ui → chili-ui}/src/statusbar/index.ts +0 -0
  434. /package/{packages/chili-ui → chili-ui}/src/statusbar/snapConfig.module.css +0 -0
  435. /package/{packages/chili-ui → chili-ui}/src/statusbar/snapConfig.ts +0 -0
  436. /package/{packages/chili-ui → chili-ui}/src/statusbar/statusbar.module.css +0 -0
  437. /package/{packages/chili-ui → chili-ui}/src/statusbar/statusbar.ts +0 -0
  438. /package/{packages/chili-ui → chili-ui}/src/toast/index.ts +0 -0
  439. /package/{packages/chili-ui → chili-ui}/src/toast/toast.module.css +0 -0
  440. /package/{packages/chili-ui → chili-ui}/src/toast/toast.ts +0 -0
  441. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/flyout.module.css +0 -0
  442. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/flyout.ts +0 -0
  443. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/index.ts +0 -0
  444. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/input.module.css +0 -0
  445. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/input.ts +0 -0
  446. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/tip.module.css +0 -0
  447. /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/tip.ts +0 -0
  448. /package/{packages/chili-ui → chili-ui}/src/viewport/index.ts +0 -0
  449. /package/{packages/chili-ui → chili-ui}/src/viewport/layoutViewport.module.css +0 -0
  450. /package/{packages/chili-ui → chili-ui}/src/viewport/layoutViewport.ts +0 -0
  451. /package/{packages/chili-ui → chili-ui}/src/viewport/viewport.module.css +0 -0
  452. /package/{packages/chili-ui → chili-ui}/src/viewport/viewport.ts +0 -0
  453. /package/{packages/chili-vis → chili-vis}/src/index.ts +0 -0
  454. /package/{packages/chili-vis → chili-vis}/src/nodeSelectionEventHandler.ts +0 -0
  455. /package/{packages/chili-vis → chili-vis}/src/selectionEventHandler.ts +0 -0
  456. /package/{packages/chili-vis → chili-vis}/src/shapeSelectionEventHandler.ts +0 -0
  457. /package/{packages/chili-vis → chili-vis}/src/viewUtils.ts +0 -0
  458. /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.d.ts +0 -0
  459. /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.js +0 -0
  460. /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.wasm +0 -0
  461. /package/{packages/chili-wasm → chili-wasm}/src/converter.ts +0 -0
  462. /package/{packages/chili-wasm → chili-wasm}/src/curve.ts +0 -0
  463. /package/{packages/chili-wasm → chili-wasm}/src/factory.ts +0 -0
  464. /package/{packages/chili-wasm → chili-wasm}/src/geometry.ts +0 -0
  465. /package/{packages/chili-wasm → chili-wasm}/src/helper.ts +0 -0
  466. /package/{packages/chili-wasm → chili-wasm}/src/index.ts +0 -0
  467. /package/{packages/chili-wasm → chili-wasm}/src/mesher.ts +0 -0
  468. /package/{packages/chili-wasm → chili-wasm}/src/shape.ts +0 -0
  469. /package/{packages/chili-wasm → chili-wasm}/src/surface.ts +0 -0
  470. /package/{packages/chili-wasm → chili-wasm}/src/wasm.ts +0 -0
  471. /package/{packages/chili-web → chili-web}/src/index.ts +0 -0
  472. /package/{packages/chili-web → chili-web}/src/loading.ts +0 -0
@@ -1,70 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import {
5
- type Act,
6
- History,
7
- type IApplication,
8
- type IDocument,
9
- type ISelection,
10
- type ISerialize,
11
- type IView,
12
- type IVisual,
13
- type Material,
14
- ModelManager,
15
- ObservableCollection,
16
- type PropertyChangedHandler,
17
- type Serialized,
18
- } from "chili-core";
19
-
20
- export class TestDocument implements IDocument, ISerialize {
21
- application: IApplication;
22
- name: string;
23
- id: string;
24
- history: History;
25
- selection: ISelection;
26
- visual: IVisual;
27
- activeView: IView | undefined;
28
- modelManager: ModelManager = new ModelManager(this);
29
- materials: ObservableCollection<Material> = new ObservableCollection<Material>();
30
- acts: ObservableCollection<Act> = new ObservableCollection<Act>();
31
- onPropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
32
- throw new Error("Method not implemented.");
33
- }
34
- removePropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
35
- throw new Error("Method not implemented.");
36
- }
37
- dispose() {
38
- throw new Error("Method not implemented.");
39
- }
40
-
41
- importFiles(files: File[] | FileList): Promise<void> {
42
- return Promise.resolve();
43
- }
44
-
45
- close(): Promise<void> {
46
- return Promise.resolve();
47
- }
48
-
49
- serialize(): Serialized {
50
- return {
51
- classKey: "TestDocument",
52
- properties: {},
53
- };
54
- }
55
-
56
- constructor() {
57
- this.name = "test";
58
- this.id = "test";
59
- this.visual = {} as any;
60
- this.history = new History();
61
- this.selection = {} as any;
62
- this.application = { views: [] } as any;
63
- }
64
- clearPropertyChanged(): void {
65
- throw new Error("Method not implemented.");
66
- }
67
- save(): Promise<void> {
68
- return Promise.resolve();
69
- }
70
- }
@@ -1,42 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import { History, type IDocument, type PropertyHistoryRecord, Transaction } from "../src";
5
-
6
- describe("test Transaction", () => {
7
- test("test static methods", () => {
8
- const doc: IDocument = { history: new History() } as any;
9
- const history: PropertyHistoryRecord = {} as any;
10
- Transaction.add(doc, history);
11
- expect(doc.history.undoCount()).toBe(1);
12
- Transaction.execute(doc, "Test", () => {
13
- Transaction.add(doc, history);
14
- Transaction.add(doc, history);
15
- });
16
- expect(doc.history.undoCount()).toBe(2);
17
-
18
- expect(() =>
19
- Transaction.execute(doc, "throw", () => {
20
- throw new Error("err");
21
- }),
22
- ).toThrow("err");
23
- expect(doc.history.undoCount()).toBe(2);
24
- });
25
-
26
- test("test methods", () => {
27
- const doc: IDocument = { history: new History() } as any;
28
- const trans = new Transaction(doc, "test");
29
- expect(() => trans.commit()).toThrow("Transaction has not started");
30
- trans.start();
31
- expect(() => trans.start()).toThrow("The document has started a transaction");
32
- trans.rollback();
33
- expect(() => trans.commit()).toThrow("Transaction has not started");
34
-
35
- trans.start();
36
- expect(doc.history.undoCount()).toBe(0);
37
- const history: PropertyHistoryRecord = {} as any;
38
- Transaction.add(doc, history);
39
- trans.commit();
40
- expect(doc.history.undoCount()).toBe(1);
41
- });
42
- });
@@ -1,42 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import { VisualState } from "../src";
5
-
6
- describe("visual test", () => {
7
- test("test VisualState", () => {
8
- let state = VisualState.normal;
9
- expect(state).toBe(0);
10
-
11
- state = VisualState.addState(state, VisualState.edgeHighlight);
12
- expect(state).toBe(1);
13
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeTruthy();
14
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeFalsy();
15
-
16
- state = VisualState.addState(state, VisualState.edgeSelected);
17
- expect(state).toBe(3);
18
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeTruthy();
19
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeTruthy();
20
-
21
- state = VisualState.removeState(state, VisualState.edgeHighlight);
22
- expect(state).toBe(2);
23
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeFalsy();
24
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeTruthy();
25
-
26
- state = VisualState.removeState(state, VisualState.edgeSelected);
27
- expect(state).toBe(0);
28
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeFalsy();
29
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeFalsy();
30
-
31
- state = VisualState.edgeHighlight;
32
- state = VisualState.addState(state, VisualState.edgeSelected);
33
- expect(state).toBe(3);
34
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeTruthy();
35
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeTruthy();
36
-
37
- state = VisualState.removeState(state, VisualState.edgeHighlight);
38
- expect(state).toBe(2);
39
- expect(VisualState.hasState(state, VisualState.edgeHighlight)).toBeFalsy();
40
- expect(VisualState.hasState(state, VisualState.edgeSelected)).toBeTruthy();
41
- });
42
- });
@@ -1,260 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import { Precision, XY, XYZ } from "../src";
5
-
6
- describe("XYZ class tests", () => {
7
- describe("Basic properties and constructor", () => {
8
- test("should create XYZ instance with given values", () => {
9
- const point = new XYZ(1, 2, 3);
10
- expect(point.x).toBe(1);
11
- expect(point.y).toBe(2);
12
- expect(point.z).toBe(3);
13
-
14
- expect(XYZ.fromArray(undefined as any)).toEqual(XYZ.zero);
15
- expect(XYZ.fromArray([1, 2, 3])).toEqual(point);
16
- expect(XYZ.fromArray([1, 2])).toEqual(new XYZ(1, 2, 0));
17
- expect(XYZ.fromArray([1, 2, 3, 4])).toEqual(new XYZ(1, 2, 3));
18
- });
19
-
20
- test("should have correct static properties", () => {
21
- expect(XYZ.zero).toEqual(new XYZ(0, 0, 0));
22
- expect(XYZ.unitX).toEqual(new XYZ(1, 0, 0));
23
- expect(XYZ.unitY).toEqual(new XYZ(0, 1, 0));
24
- expect(XYZ.unitZ).toEqual(new XYZ(0, 0, 1));
25
- expect(XYZ.unitNX).toEqual(new XYZ(-1, 0, 0));
26
- expect(XYZ.unitNY).toEqual(new XYZ(0, -1, 0));
27
- expect(XYZ.unitNZ).toEqual(new XYZ(0, 0, -1));
28
- expect(XYZ.one).toEqual(new XYZ(1, 1, 1));
29
- });
30
-
31
- test("should convert to string and array correctly", () => {
32
- const point = new XYZ(1, 2, 3);
33
- expect(point.toString()).toBe("1, 2, 3");
34
- expect(point.toArray()).toEqual([1, 2, 3]);
35
- });
36
- });
37
-
38
- describe("Arithmetic operations", () => {
39
- test("should add vectors correctly", () => {
40
- const a = new XYZ(1, 2, 3);
41
- const b = new XYZ(4, 5, 6);
42
- const result = a.add(b);
43
- expect(result).toEqual(new XYZ(5, 7, 9));
44
- });
45
-
46
- test("should subtract vectors correctly", () => {
47
- const a = new XYZ(5, 7, 9);
48
- const b = new XYZ(1, 2, 3);
49
- const result = a.sub(b);
50
- expect(result).toEqual(new XYZ(4, 5, 6));
51
- });
52
-
53
- test("should multiply by scalar correctly", () => {
54
- const point = new XYZ(1, 2, 3);
55
- const result = point.multiply(3);
56
- expect(result).toEqual(new XYZ(3, 6, 9));
57
- });
58
-
59
- test("should divide by scalar correctly", () => {
60
- const point = new XYZ(10, 20, 30);
61
- const result = point.divided(2);
62
- expect(result).toEqual(new XYZ(5, 10, 15));
63
- });
64
-
65
- test("should return undefined when dividing by zero", () => {
66
- const point = new XYZ(10, 20, 30);
67
- const result = point.divided(0);
68
- expect(result).toBeUndefined();
69
-
70
- const result2 = point.divided(Precision.Float / 2); // very small number
71
- expect(result2).toBeUndefined();
72
- });
73
-
74
- test("should reverse the vector correctly", () => {
75
- const point = new XYZ(1, 2, 3);
76
- const reversed = point.reverse();
77
- expect(reversed).toEqual(new XYZ(-1, -2, -3));
78
-
79
- const zero = XYZ.zero.reverse();
80
- expect(zero).toEqual(new XYZ(0, 0, 0));
81
- });
82
- });
83
-
84
- describe("Mathematical operations", () => {
85
- test("should calculate cross product correctly", () => {
86
- const a = new XYZ(1, 0, 0);
87
- const b = new XYZ(0, 1, 0);
88
- const result = a.cross(b);
89
- expect(result).toEqual(new XYZ(0, 0, 1));
90
-
91
- const c = new XYZ(2, 3, 4);
92
- const d = new XYZ(5, 6, 7);
93
- const result2 = c.cross(d);
94
- expect(result2).toEqual(new XYZ(-3, 6, -3)); // (3*7-4*6, 4*5-2*7, 2*6-3*5)
95
- });
96
-
97
- test("should calculate dot product correctly", () => {
98
- const a = new XYZ(1, 2, 3);
99
- const b = new XYZ(4, 5, 6);
100
- expect(a.dot(b)).toBe(32); // 1*4 + 2*5 + 3*6 = 4 + 10 + 18 = 32
101
- });
102
-
103
- test("should calculate length and length squared correctly", () => {
104
- const point = new XYZ(3, 4, 5);
105
- expect(point.lengthSq()).toBe(50); // 9 + 16 + 25
106
- expect(point.length()).toBe(Math.sqrt(50));
107
- });
108
-
109
- test("should normalize vector correctly", () => {
110
- const point = new XYZ(3, 0, 0);
111
- const normalized = point.normalize();
112
- expect(normalized).toEqual(new XYZ(1, 0, 0));
113
-
114
- const unit = new XYZ(1, 1, 1);
115
- const normalized2 = unit.normalize();
116
- const length = Math.sqrt(3);
117
- expect(normalized2).toEqual(new XYZ(1 / length, 1 / length, 1 / length));
118
- });
119
-
120
- test("should return undefined for zero vector normalization", () => {
121
- const normalized = XYZ.zero.normalize();
122
- expect(normalized).toBeUndefined();
123
- });
124
- });
125
-
126
- describe("Distance and geometric operations", () => {
127
- test("should calculate distance correctly", () => {
128
- const a = new XYZ(0, 0, 0);
129
- const b = new XYZ(3, 4, 0);
130
- expect(a.distanceTo(b)).toBe(5); // 3-4-5 triangle
131
-
132
- const c = new XYZ(1, 1, 1);
133
- const d = new XYZ(4, 5, 1);
134
- expect(c.distanceTo(d)).toBe(5); // 3-4-5 triangle in xy plane
135
- });
136
-
137
- test("should calculate center correctly", () => {
138
- const p1 = new XYZ(0, 0, 0);
139
- const p2 = new XYZ(4, 6, 8);
140
- const center = XYZ.center(p1, p2);
141
- expect(center).toEqual(new XYZ(2, 3, 4));
142
- });
143
- });
144
-
145
- describe("Angle operations", () => {
146
- test("should calculate angle correctly", () => {
147
- const a = new XYZ(10, 0, 0);
148
- const b = new XYZ(0, 10, 0);
149
- expect(a.angleTo(b)).toBe(Math.PI / 2);
150
- expect(a.angleTo(new XYZ(10, 0, 0))).toBe(0);
151
- expect(a.angleTo(new XYZ(10, 10, 0))).toBe(Math.PI / 4);
152
- expect(a.angleTo(new XYZ(0, 10, 0))).toBe(Math.PI / 2);
153
- expect(a.angleTo(new XYZ(-10, 10, 0))).toBe((Math.PI * 3) / 4);
154
- expect(a.angleTo(new XYZ(-10, 0, 0))).toBe(Math.PI);
155
- expect(a.angleTo(new XYZ(-10, -10, 0))).toBe((Math.PI * 3) / 4);
156
- expect(a.angleTo(new XYZ(10, -10, 0))).toBe(Math.PI / 4);
157
- });
158
-
159
- test("should return undefined for zero vector angle", () => {
160
- expect(XYZ.zero.angleTo(new XYZ(0, 0, 0))).toBe(undefined);
161
- expect(XYZ.zero.angleTo(new XYZ(1, 0, 0))).toBeUndefined();
162
- expect(new XYZ(1, 0, 0).angleTo(XYZ.zero)).toBeUndefined();
163
- });
164
-
165
- test("should calculate angle on plane correctly", () => {
166
- const a = new XYZ(10, 0, 0);
167
- const b = new XYZ(0, 10, 0);
168
- expect(a.angleOnPlaneTo(b, XYZ.unitZ)).toBe(Math.PI / 2);
169
- expect(a.angleOnPlaneTo(new XYZ(10, 0, 0), XYZ.unitZ)).toBe(0);
170
- expect(a.angleOnPlaneTo(new XYZ(10, 10, 0), XYZ.unitZ)).toBe(Math.PI / 4);
171
- expect(a.angleOnPlaneTo(new XYZ(0, 10, 0), XYZ.unitZ)).toBe(Math.PI / 2);
172
- expect(a.angleOnPlaneTo(new XYZ(-10, 10, 0), XYZ.unitZ)).toBe((Math.PI * 3) / 4);
173
- expect(a.angleOnPlaneTo(new XYZ(-10, 0, 0), XYZ.unitZ)).toBe(Math.PI);
174
- expect(a.angleOnPlaneTo(new XYZ(-10, -10, 0), XYZ.unitZ)).toBe((Math.PI * 5) / 4);
175
- expect(a.angleOnPlaneTo(new XYZ(10, -10, 0), XYZ.unitZ)).toBe((Math.PI * 7) / 4);
176
-
177
- expect(new XYZ(10, 10, 0).angleOnPlaneTo(a, XYZ.unitZ)).toBe((Math.PI * 7) / 4);
178
- expect(a.angleOnPlaneTo(new XYZ(10, 10, 0), new XYZ(0, 0, -1))).toBe((Math.PI * 7) / 4);
179
- });
180
-
181
- test("should return undefined for zero normal in angleOnPlaneTo", () => {
182
- const a = new XYZ(1, 0, 0);
183
- const b = new XYZ(0, 1, 0);
184
- expect(a.angleOnPlaneTo(b, XYZ.zero)).toBeUndefined();
185
- expect(XYZ.zero.angleOnPlaneTo(XYZ.zero, XYZ.unitZ)).toBe(undefined);
186
- });
187
- });
188
-
189
- describe("Rotation operations", () => {
190
- test("should rotate vector correctly", () => {
191
- const v = XYZ.unitX.add(XYZ.unitZ);
192
- expect(v.rotate(v, 90)?.isEqualTo(v)).toBeTruthy();
193
- expect(
194
- XYZ.unitX.rotate(XYZ.unitZ, Math.PI / 4)?.isEqualTo(new XYZ(1, 1, 0).normalize()!),
195
- ).toBeTruthy();
196
- expect(XYZ.unitX.rotate(XYZ.unitZ, Math.PI / 2)?.isEqualTo(new XYZ(0, 1, 0))).toBeTruthy();
197
- expect(XYZ.unitX.rotate(XYZ.unitZ, Math.PI / 1)?.isEqualTo(new XYZ(-1, 0, 0))).toBeTruthy();
198
- expect(XYZ.unitX.rotate(XYZ.unitZ, Math.PI * 1.5)?.isEqualTo(new XYZ(0, -1, 0))).toBeTruthy();
199
-
200
- const result = XYZ.unitX.rotate(XYZ.unitZ, Math.PI / 2);
201
- expect(result?.isEqualTo(XYZ.unitY, 1e-10)).toBeTruthy();
202
-
203
- const result2 = XYZ.unitY.rotate(XYZ.unitZ, Math.PI / 2);
204
- expect(result2?.isEqualTo(XYZ.unitX.reverse(), 1e-10)).toBeTruthy();
205
- });
206
-
207
- test("should handle edge cases for rotation", () => {
208
- const result = XYZ.unitX.rotate(XYZ.zero, Math.PI / 2);
209
- expect(result).toBeUndefined();
210
- });
211
- });
212
-
213
- describe("Comparison methods", () => {
214
- test("isEqualTo should work correctly", () => {
215
- const a = new XYZ(1, 2, 3);
216
- const b = new XYZ(1, 2, 3);
217
- expect(a.isEqualTo(b)).toBeTruthy();
218
-
219
- const c = new XYZ(1.1, 2, 3);
220
- expect(a.isEqualTo(c, 0.2)).toBeTruthy(); // within tolerance
221
- expect(a.isEqualTo(c, 0.05)).toBeFalsy(); // outside tolerance
222
- });
223
-
224
- test("isPerpendicularTo should work correctly", () => {
225
- const a = new XYZ(1, 0, 0);
226
- const b = new XYZ(0, 1, 0);
227
- expect(a.isPerpendicularTo(b)).toBeTruthy();
228
- expect(a.isPerpendicularTo(b.reverse())).toBeTruthy();
229
-
230
- const c = new XYZ(1, 1, 0);
231
- expect(a.isPerpendicularTo(c, 0.1)).toBeFalsy();
232
- });
233
-
234
- test("isParallelTo should work correctly", () => {
235
- const a = new XYZ(1, 0, 0);
236
- const b = new XYZ(2, 0, 0);
237
- expect(a.isParallelTo(b)).toBeTruthy();
238
-
239
- const c = new XYZ(-1, 0, 0);
240
- expect(a.isParallelTo(c)).toBeTruthy(); // opposite direction is still parallel
241
- });
242
-
243
- test("isOppositeTo should work correctly", () => {
244
- const a = new XYZ(1, 0, 0);
245
- const b = new XYZ(-1, 0, 0);
246
- expect(a.isOppositeTo(b)).toBeTruthy();
247
-
248
- const c = new XYZ(0, 1, 0);
249
- expect(a.isOppositeTo(c)).toBeFalsy();
250
- });
251
- });
252
-
253
- describe("XY class tests", () => {
254
- test("should calculate angle for XY vectors", () => {
255
- const v1 = XY.unitX;
256
- const v2 = XY.unitY;
257
- expect(v1.angleTo(v2)).toBe(Math.PI / 2);
258
- });
259
- });
260
- });
@@ -1,10 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- export default class CameraControls {
5
- static install() {}
6
- static ACTION = {};
7
- mouseButtons = {};
8
- setPosition() {}
9
- setTarget() {}
10
- }
@@ -1,68 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import {
5
- type Act,
6
- History,
7
- type IApplication,
8
- type IDocument,
9
- type ISelection,
10
- type ISerialize,
11
- type IView,
12
- ModelManager,
13
- ObservableCollection,
14
- type PropertyChangedHandler,
15
- type Serialized,
16
- } from "chili-core";
17
- import { ThreeVisual } from "../src/threeVisual";
18
-
19
- export class TestDocument implements IDocument, ISerialize {
20
- application: IApplication;
21
- name: string;
22
- id: string;
23
- history: History;
24
- selection: ISelection;
25
- visual: ThreeVisual;
26
- activeView: IView | undefined;
27
- modelManager: ModelManager = new ModelManager(this);
28
- acts: ObservableCollection<Act> = new ObservableCollection<Act>();
29
- onPropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
30
- throw new Error("Method not implemented.");
31
- }
32
- removePropertyChanged<K extends keyof this>(handler: PropertyChangedHandler<this, K>): void {
33
- throw new Error("Method not implemented.");
34
- }
35
- dispose() {
36
- throw new Error("Method not implemented.");
37
- }
38
-
39
- importFiles(files: File[] | FileList): Promise<void> {
40
- return Promise.resolve();
41
- }
42
-
43
- close(): Promise<void> {
44
- return Promise.resolve();
45
- }
46
-
47
- serialize(): Serialized {
48
- return {
49
- classKey: "TestDocument",
50
- properties: {},
51
- };
52
- }
53
-
54
- constructor() {
55
- this.name = "test";
56
- this.id = "test";
57
- this.visual = new ThreeVisual(this);
58
- this.history = new History();
59
- this.selection = {} as any;
60
- this.application = { views: [] } as any;
61
- }
62
- clearPropertyChanged(): void {
63
- throw new Error("Method not implemented.");
64
- }
65
- save(): Promise<void> {
66
- return Promise.resolve();
67
- }
68
- }
@@ -1,171 +0,0 @@
1
- // Part of the Chili3d Project, under the AGPL-3.0 License.
2
- // See LICENSE file in the project root for full license information.
3
-
4
- import {
5
- type EdgeMeshData,
6
- type I18nKeys,
7
- type ICurve,
8
- type IDocument,
9
- type IEdge,
10
- type IEqualityComparer,
11
- type IShape,
12
- type IShapeMeshData,
13
- type ITrimmedCurve,
14
- type IWire,
15
- type Line,
16
- LineType,
17
- Matrix4,
18
- Orientation,
19
- ParameterShapeNode,
20
- type Plane,
21
- Result,
22
- type Serialized,
23
- ShapeType,
24
- type XYZ,
25
- type XYZLike,
26
- } from "chili-core";
27
-
28
- export class TestEdge implements IEdge {
29
- constructor(
30
- readonly start: XYZ,
31
- readonly end: XYZ,
32
- ) {}
33
- transformed(matrix: Matrix4): IShape {
34
- throw new Error("Method not implemented.");
35
- }
36
- transformedMul(matrix: Matrix4): IShape {
37
- throw new Error("Method not implemented.");
38
- }
39
- edgesMeshPosition(): EdgeMeshData {
40
- throw new Error("Method not implemented.");
41
- }
42
- clone(): IShape {
43
- throw new Error("Method not implemented.");
44
- }
45
-
46
- dispose(): void {
47
- throw new Error("Method not implemented.");
48
- }
49
- update(curve: ICurve): void {
50
- throw new Error("Method not implemented.");
51
- }
52
- trim(start: number, end: number): IEdge {
53
- throw new Error("Method not implemented.");
54
- }
55
- isClosed(): boolean {
56
- throw new Error("Method not implemented.");
57
- }
58
- isNull(): boolean {
59
- throw new Error("Method not implemented.");
60
- }
61
- reserve(): void {
62
- throw new Error("Method not implemented.");
63
- }
64
- section(shape: IShape | Plane): IShape {
65
- throw new Error("Method not implemented.");
66
- }
67
- splitByWire(edges: (IEdge | IWire)[]): IShape {
68
- throw new Error("Method not implemented.");
69
- }
70
- split(shapes: IShape[]): IShape {
71
- throw new Error("Method not implemented.");
72
- }
73
-
74
- findAncestor(ancestorType: ShapeType, fromShape: IShape): IShape[] {
75
- throw new Error("Method not implemented.");
76
- }
77
-
78
- findSubShapes(subshapeType: ShapeType): IShape[] {
79
- throw new Error("Method not implemented.");
80
- }
81
- iterShape(): IShape[] {
82
- throw new Error("Method not implemented.");
83
- }
84
- offset(distance: number, dir: XYZ): Result<IEdge> {
85
- throw new Error("Method not implemented.");
86
- }
87
- hlr(position: XYZLike, direction: XYZLike, xDir: XYZLike): IShape {
88
- throw new Error("Method not implemented.");
89
- }
90
-
91
- intersect(other: IEdge | Line) {
92
- return [];
93
- }
94
- length(): number {
95
- return this.start.distanceTo(this.end);
96
- }
97
- get curve(): ITrimmedCurve {
98
- throw new Error("Method not implemented.");
99
- }
100
- get id(): string {
101
- return "testEdge";
102
- }
103
- shapeType: ShapeType = ShapeType.Edge;
104
- matrix: Matrix4 = Matrix4.identity();
105
- get mesh(): IShapeMeshData {
106
- return {
107
- edges: {
108
- position: new Float32Array([
109
- this.start.x,
110
- this.start.y,
111
- this.start.z,
112
- this.end.x,
113
- this.end.y,
114
- this.end.z,
115
- ]),
116
- color: 0xff0000,
117
- lineType: LineType.Solid,
118
- range: [],
119
- },
120
- faces: undefined,
121
- };
122
- }
123
- serialize(): Serialized {
124
- return {
125
- classKey: "Shape",
126
- properties: {},
127
- };
128
- }
129
- orientation(): Orientation {
130
- return Orientation.FORWARD;
131
- }
132
- isPartner(other: IShape): boolean {
133
- return true;
134
- }
135
- isSame(other: IShape): boolean {
136
- return true;
137
- }
138
- isEqual(other: IShape): boolean {
139
- if (other instanceof TestEdge) {
140
- return this.start.isEqualTo(other.start) && this.end.isEqualTo(other.end);
141
- }
142
- return false;
143
- }
144
- }
145
-
146
- export class TestNode extends ParameterShapeNode {
147
- override display(): I18nKeys {
148
- return "body.line";
149
- }
150
- constructor(
151
- document: IDocument,
152
- readonly start: XYZ,
153
- readonly end: XYZ,
154
- ) {
155
- super(document);
156
- }
157
-
158
- protected override setProperty<K extends keyof this>(
159
- property: K,
160
- newValue: this[K],
161
- onPropertyChanged?: ((property: K, oldValue: this[K]) => void) | undefined,
162
- equals?: IEqualityComparer<this[K]> | undefined,
163
- ): boolean {
164
- this.setPrivateValue(property, newValue);
165
- return true;
166
- }
167
-
168
- generateShape(): Result<IShape> {
169
- return Result.ok(new TestEdge(this.start, this.end));
170
- }
171
- }