react-cheminfo 0.135.0 → 0.137.0

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 (311) hide show
  1. package/README.md +1 -1
  2. package/lib/crystal/core/cellAtoms.d.ts +43 -0
  3. package/lib/crystal/core/cellAtoms.d.ts.map +1 -0
  4. package/lib/crystal/core/cellAtoms.js +70 -0
  5. package/lib/crystal/core/cellAtoms.js.map +1 -0
  6. package/lib/crystal/core/index.d.ts +2 -0
  7. package/lib/crystal/core/index.d.ts.map +1 -1
  8. package/lib/crystal/core/index.js +1 -0
  9. package/lib/crystal/core/index.js.map +1 -1
  10. package/lib/crystal/core/molecules.d.ts.map +1 -1
  11. package/lib/crystal/core/molecules.js +6 -40
  12. package/lib/crystal/core/molecules.js.map +1 -1
  13. package/lib/crystal3d/core/cellClip.d.ts +46 -0
  14. package/lib/crystal3d/core/cellClip.d.ts.map +1 -0
  15. package/lib/crystal3d/core/cellClip.js +198 -0
  16. package/lib/crystal3d/core/cellClip.js.map +1 -0
  17. package/lib/crystal3d/core/cellGeometry.d.ts +63 -0
  18. package/lib/crystal3d/core/cellGeometry.d.ts.map +1 -0
  19. package/lib/crystal3d/core/cellGeometry.js +153 -0
  20. package/lib/crystal3d/core/cellGeometry.js.map +1 -0
  21. package/lib/crystal3d/core/cellStack.d.ts +51 -0
  22. package/lib/crystal3d/core/cellStack.d.ts.map +1 -0
  23. package/lib/crystal3d/core/cellStack.js +79 -0
  24. package/lib/crystal3d/core/cellStack.js.map +1 -0
  25. package/lib/crystal3d/core/crystalView.d.ts +81 -0
  26. package/lib/crystal3d/core/crystalView.d.ts.map +1 -0
  27. package/lib/crystal3d/core/crystalView.js +55 -0
  28. package/lib/crystal3d/core/crystalView.js.map +1 -0
  29. package/lib/crystal3d/core/drawingSet.d.ts +31 -0
  30. package/lib/crystal3d/core/drawingSet.d.ts.map +1 -0
  31. package/lib/crystal3d/core/drawingSet.js +63 -0
  32. package/lib/crystal3d/core/drawingSet.js.map +1 -0
  33. package/lib/crystal3d/core/elementDrawing.d.ts +50 -0
  34. package/lib/crystal3d/core/elementDrawing.d.ts.map +1 -0
  35. package/lib/crystal3d/core/elementDrawing.js +100 -0
  36. package/lib/crystal3d/core/elementDrawing.js.map +1 -0
  37. package/lib/crystal3d/core/elementExtent.d.ts +42 -0
  38. package/lib/crystal3d/core/elementExtent.d.ts.map +1 -0
  39. package/lib/crystal3d/core/elementExtent.js +56 -0
  40. package/lib/crystal3d/core/elementExtent.js.map +1 -0
  41. package/lib/crystal3d/core/elementLabels.d.ts +31 -0
  42. package/lib/crystal3d/core/elementLabels.d.ts.map +1 -0
  43. package/lib/crystal3d/core/elementLabels.js +99 -0
  44. package/lib/crystal3d/core/elementLabels.js.map +1 -0
  45. package/lib/crystal3d/core/elementShapes.d.ts +43 -0
  46. package/lib/crystal3d/core/elementShapes.d.ts.map +1 -0
  47. package/lib/crystal3d/core/elementShapes.js +115 -0
  48. package/lib/crystal3d/core/elementShapes.js.map +1 -0
  49. package/lib/crystal3d/core/frame.d.ts +36 -0
  50. package/lib/crystal3d/core/frame.d.ts.map +1 -0
  51. package/lib/crystal3d/core/frame.js +35 -0
  52. package/lib/crystal3d/core/frame.js.map +1 -0
  53. package/lib/crystal3d/core/framing.d.ts +41 -0
  54. package/lib/crystal3d/core/framing.d.ts.map +1 -0
  55. package/lib/crystal3d/core/framing.js +79 -0
  56. package/lib/crystal3d/core/framing.js.map +1 -0
  57. package/lib/crystal3d/core/index.d.ts +42 -0
  58. package/lib/crystal3d/core/index.d.ts.map +1 -0
  59. package/lib/crystal3d/core/index.js +29 -0
  60. package/lib/crystal3d/core/index.js.map +1 -0
  61. package/lib/crystal3d/core/labelText.d.ts +19 -0
  62. package/lib/crystal3d/core/labelText.d.ts.map +1 -0
  63. package/lib/crystal3d/core/labelText.js +42 -0
  64. package/lib/crystal3d/core/labelText.js.map +1 -0
  65. package/lib/crystal3d/core/latticeBasis.d.ts +49 -0
  66. package/lib/crystal3d/core/latticeBasis.d.ts.map +1 -0
  67. package/lib/crystal3d/core/latticeBasis.js +89 -0
  68. package/lib/crystal3d/core/latticeBasis.js.map +1 -0
  69. package/lib/crystal3d/core/mat3.d.ts +68 -0
  70. package/lib/crystal3d/core/mat3.d.ts.map +1 -0
  71. package/lib/crystal3d/core/mat3.js +146 -0
  72. package/lib/crystal3d/core/mat3.js.map +1 -0
  73. package/lib/crystal3d/core/operationMatrix.d.ts +44 -0
  74. package/lib/crystal3d/core/operationMatrix.d.ts.map +1 -0
  75. package/lib/crystal3d/core/operationMatrix.js +172 -0
  76. package/lib/crystal3d/core/operationMatrix.js.map +1 -0
  77. package/lib/crystal3d/core/orientation.d.ts +62 -0
  78. package/lib/crystal3d/core/orientation.d.ts.map +1 -0
  79. package/lib/crystal3d/core/orientation.js +166 -0
  80. package/lib/crystal3d/core/orientation.js.map +1 -0
  81. package/lib/crystal3d/core/palette.d.ts +24 -0
  82. package/lib/crystal3d/core/palette.d.ts.map +1 -0
  83. package/lib/crystal3d/core/palette.js +34 -0
  84. package/lib/crystal3d/core/palette.js.map +1 -0
  85. package/lib/crystal3d/core/primitives.d.ts +133 -0
  86. package/lib/crystal3d/core/primitives.d.ts.map +1 -0
  87. package/lib/crystal3d/core/primitives.js +80 -0
  88. package/lib/crystal3d/core/primitives.js.map +1 -0
  89. package/lib/crystal3d/core/structureText.d.ts +20 -0
  90. package/lib/crystal3d/core/structureText.d.ts.map +1 -0
  91. package/lib/crystal3d/core/structureText.js +37 -0
  92. package/lib/crystal3d/core/structureText.js.map +1 -0
  93. package/lib/crystal3d/core/supercell.d.ts +20 -0
  94. package/lib/crystal3d/core/supercell.d.ts.map +1 -0
  95. package/lib/crystal3d/core/supercell.js +35 -0
  96. package/lib/crystal3d/core/supercell.js.map +1 -0
  97. package/lib/crystal3d/core/types.d.ts +166 -0
  98. package/lib/crystal3d/core/types.d.ts.map +1 -0
  99. package/lib/crystal3d/core/types.js +10 -0
  100. package/lib/crystal3d/core/types.js.map +1 -0
  101. package/lib/crystal3d/core/vec3.d.ts +75 -0
  102. package/lib/crystal3d/core/vec3.d.ts.map +1 -0
  103. package/lib/crystal3d/core/vec3.js +119 -0
  104. package/lib/crystal3d/core/vec3.js.map +1 -0
  105. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +52 -0
  106. package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -0
  107. package/lib/crystal3d/ui/CrystalCanvas3D.js +250 -0
  108. package/lib/crystal3d/ui/CrystalCanvas3D.js.map +1 -0
  109. package/lib/crystal3d/ui/CrystalStructureView.d.ts +17 -0
  110. package/lib/crystal3d/ui/CrystalStructureView.d.ts.map +1 -0
  111. package/lib/crystal3d/ui/CrystalStructureView.js +79 -0
  112. package/lib/crystal3d/ui/CrystalStructureView.js.map +1 -0
  113. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts +22 -0
  114. package/lib/crystal3d/ui/CrystalStructureViewer.d.ts.map +1 -0
  115. package/lib/crystal3d/ui/CrystalStructureViewer.js +29 -0
  116. package/lib/crystal3d/ui/CrystalStructureViewer.js.map +1 -0
  117. package/lib/crystal3d/ui/CrystalViewControls.d.ts +29 -0
  118. package/lib/crystal3d/ui/CrystalViewControls.d.ts.map +1 -0
  119. package/lib/crystal3d/ui/CrystalViewControls.js +24 -0
  120. package/lib/crystal3d/ui/CrystalViewControls.js.map +1 -0
  121. package/lib/crystal3d/ui/CrystalViewer3D.d.ts +72 -0
  122. package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -0
  123. package/lib/crystal3d/ui/CrystalViewer3D.js +70 -0
  124. package/lib/crystal3d/ui/CrystalViewer3D.js.map +1 -0
  125. package/lib/crystal3d/ui/crystalScene.d.ts +97 -0
  126. package/lib/crystal3d/ui/crystalScene.d.ts.map +1 -0
  127. package/lib/crystal3d/ui/crystalScene.js +10 -0
  128. package/lib/crystal3d/ui/crystalScene.js.map +1 -0
  129. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +52 -0
  130. package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -0
  131. package/lib/crystal3d/ui/crystalStructureViewerProps.js +2 -0
  132. package/lib/crystal3d/ui/crystalStructureViewerProps.js.map +1 -0
  133. package/lib/crystal3d/ui/index.d.ts +16 -0
  134. package/lib/crystal3d/ui/index.d.ts.map +1 -0
  135. package/lib/crystal3d/ui/index.js +12 -0
  136. package/lib/crystal3d/ui/index.js.map +1 -0
  137. package/lib/crystal3d/ui/useCrystalCaption.d.ts +14 -0
  138. package/lib/crystal3d/ui/useCrystalCaption.d.ts.map +1 -0
  139. package/lib/crystal3d/ui/useCrystalCaption.js +32 -0
  140. package/lib/crystal3d/ui/useCrystalCaption.js.map +1 -0
  141. package/lib/crystal3d/viewer/animate.d.ts +49 -0
  142. package/lib/crystal3d/viewer/animate.d.ts.map +1 -0
  143. package/lib/crystal3d/viewer/animate.js +83 -0
  144. package/lib/crystal3d/viewer/animate.js.map +1 -0
  145. package/lib/crystal3d/viewer/camera.d.ts +44 -0
  146. package/lib/crystal3d/viewer/camera.d.ts.map +1 -0
  147. package/lib/crystal3d/viewer/camera.js +103 -0
  148. package/lib/crystal3d/viewer/camera.js.map +1 -0
  149. package/lib/crystal3d/viewer/index.d.ts +13 -0
  150. package/lib/crystal3d/viewer/index.d.ts.map +1 -0
  151. package/lib/crystal3d/viewer/index.js +8 -0
  152. package/lib/crystal3d/viewer/index.js.map +1 -0
  153. package/lib/crystal3d/viewer/layerRegistry.d.ts +24 -0
  154. package/lib/crystal3d/viewer/layerRegistry.d.ts.map +1 -0
  155. package/lib/crystal3d/viewer/layerRegistry.js +39 -0
  156. package/lib/crystal3d/viewer/layerRegistry.js.map +1 -0
  157. package/lib/crystal3d/viewer/meshPrimitives.d.ts +13 -0
  158. package/lib/crystal3d/viewer/meshPrimitives.d.ts.map +1 -0
  159. package/lib/crystal3d/viewer/meshPrimitives.js +76 -0
  160. package/lib/crystal3d/viewer/meshPrimitives.js.map +1 -0
  161. package/lib/crystal3d/viewer/plugin.d.ts +133 -0
  162. package/lib/crystal3d/viewer/plugin.d.ts.map +1 -0
  163. package/lib/crystal3d/viewer/plugin.js +181 -0
  164. package/lib/crystal3d/viewer/plugin.js.map +1 -0
  165. package/lib/crystal3d/viewer/renderCell.d.ts +43 -0
  166. package/lib/crystal3d/viewer/renderCell.d.ts.map +1 -0
  167. package/lib/crystal3d/viewer/renderCell.js +53 -0
  168. package/lib/crystal3d/viewer/renderCell.js.map +1 -0
  169. package/lib/crystal3d/viewer/renderElements.d.ts +54 -0
  170. package/lib/crystal3d/viewer/renderElements.d.ts.map +1 -0
  171. package/lib/crystal3d/viewer/renderElements.js +77 -0
  172. package/lib/crystal3d/viewer/renderElements.js.map +1 -0
  173. package/lib/crystal3d/viewer/renderStructure.d.ts +80 -0
  174. package/lib/crystal3d/viewer/renderStructure.d.ts.map +1 -0
  175. package/lib/crystal3d/viewer/renderStructure.js +143 -0
  176. package/lib/crystal3d/viewer/renderStructure.js.map +1 -0
  177. package/lib/crystal3d/viewer/sceneParts.d.ts +32 -0
  178. package/lib/crystal3d/viewer/sceneParts.d.ts.map +1 -0
  179. package/lib/crystal3d/viewer/sceneParts.js +77 -0
  180. package/lib/crystal3d/viewer/sceneParts.js.map +1 -0
  181. package/lib/crystal3d/viewer/shapeLayer.d.ts +41 -0
  182. package/lib/crystal3d/viewer/shapeLayer.d.ts.map +1 -0
  183. package/lib/crystal3d/viewer/shapeLayer.js +57 -0
  184. package/lib/crystal3d/viewer/shapeLayer.js.map +1 -0
  185. package/lib/crystal3d/viewer/textLayer.d.ts +21 -0
  186. package/lib/crystal3d/viewer/textLayer.d.ts.map +1 -0
  187. package/lib/crystal3d/viewer/textLayer.js +59 -0
  188. package/lib/crystal3d/viewer/textLayer.js.map +1 -0
  189. package/lib/crystal3d/viewer/viewer.d.ts +119 -0
  190. package/lib/crystal3d/viewer/viewer.d.ts.map +1 -0
  191. package/lib/crystal3d/viewer/viewer.js +172 -0
  192. package/lib/crystal3d/viewer/viewer.js.map +1 -0
  193. package/lib/crystal3d.d.ts +12 -0
  194. package/lib/crystal3d.d.ts.map +1 -0
  195. package/lib/crystal3d.js +12 -0
  196. package/lib/crystal3d.js.map +1 -0
  197. package/lib/download/core/croppedMarkup.d.ts.map +1 -1
  198. package/lib/download/core/croppedMarkup.js +16 -40
  199. package/lib/download/core/croppedMarkup.js.map +1 -1
  200. package/lib/download/core/dataUrl.d.ts +27 -0
  201. package/lib/download/core/dataUrl.d.ts.map +1 -0
  202. package/lib/download/core/dataUrl.js +54 -0
  203. package/lib/download/core/dataUrl.js.map +1 -0
  204. package/lib/download/core/index.d.ts +3 -0
  205. package/lib/download/core/index.d.ts.map +1 -1
  206. package/lib/download/core/index.js +2 -0
  207. package/lib/download/core/index.js.map +1 -1
  208. package/lib/download/core/svgMarkup.d.ts +39 -0
  209. package/lib/download/core/svgMarkup.d.ts.map +1 -0
  210. package/lib/download/core/svgMarkup.js +100 -0
  211. package/lib/download/core/svgMarkup.js.map +1 -0
  212. package/lib/drawing/ui/movingFigure.d.ts.map +1 -1
  213. package/lib/drawing/ui/movingFigure.js +4 -30
  214. package/lib/drawing/ui/movingFigure.js.map +1 -1
  215. package/lib/i18n/core/chromeCatalog.d.ts +1 -1
  216. package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
  217. package/lib/locales/de.json +26 -1
  218. package/lib/locales/en.json +26 -1
  219. package/lib/locales/es.json +26 -1
  220. package/lib/locales/fr.json +26 -1
  221. package/lib/locales/it.json +26 -1
  222. package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
  223. package/lib/molecule3d/ui/MoleculeCanvas3D.js +16 -27
  224. package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
  225. package/lib/molstar/bonds/bondRule.d.ts +16 -0
  226. package/lib/molstar/bonds/bondRule.d.ts.map +1 -0
  227. package/lib/molstar/bonds/bondRule.js +23 -0
  228. package/lib/molstar/bonds/bondRule.js.map +1 -0
  229. package/lib/molstar/bonds/index.d.ts +9 -0
  230. package/lib/molstar/bonds/index.d.ts.map +1 -0
  231. package/lib/molstar/bonds/index.js +9 -0
  232. package/lib/molstar/bonds/index.js.map +1 -0
  233. package/lib/molstar/ui/MolstarToolbar.d.ts +47 -0
  234. package/lib/molstar/ui/MolstarToolbar.d.ts.map +1 -0
  235. package/lib/molstar/ui/MolstarToolbar.js +28 -0
  236. package/lib/molstar/ui/MolstarToolbar.js.map +1 -0
  237. package/lib/molstar/ui/index.d.ts +10 -0
  238. package/lib/molstar/ui/index.d.ts.map +1 -0
  239. package/lib/molstar/ui/index.js +8 -0
  240. package/lib/molstar/ui/index.js.map +1 -0
  241. package/lib/molstar/ui/useMolstarTools.d.ts +63 -0
  242. package/lib/molstar/ui/useMolstarTools.d.ts.map +1 -0
  243. package/lib/molstar/ui/useMolstarTools.js +36 -0
  244. package/lib/molstar/ui/useMolstarTools.js.map +1 -0
  245. package/package.json +2 -1
  246. package/src/crystal/core/cellAtoms.ts +106 -0
  247. package/src/crystal/core/index.ts +2 -0
  248. package/src/crystal/core/molecules.ts +7 -44
  249. package/src/crystal3d/core/cellClip.ts +229 -0
  250. package/src/crystal3d/core/cellGeometry.ts +193 -0
  251. package/src/crystal3d/core/cellStack.ts +87 -0
  252. package/src/crystal3d/core/crystalView.ts +131 -0
  253. package/src/crystal3d/core/drawingSet.ts +71 -0
  254. package/src/crystal3d/core/elementDrawing.ts +147 -0
  255. package/src/crystal3d/core/elementExtent.ts +81 -0
  256. package/src/crystal3d/core/elementLabels.ts +130 -0
  257. package/src/crystal3d/core/elementShapes.ts +141 -0
  258. package/src/crystal3d/core/frame.ts +56 -0
  259. package/src/crystal3d/core/framing.ts +101 -0
  260. package/src/crystal3d/core/index.ts +134 -0
  261. package/src/crystal3d/core/labelText.ts +44 -0
  262. package/src/crystal3d/core/latticeBasis.ts +110 -0
  263. package/src/crystal3d/core/mat3.ts +163 -0
  264. package/src/crystal3d/core/operationMatrix.ts +255 -0
  265. package/src/crystal3d/core/orientation.ts +229 -0
  266. package/src/crystal3d/core/palette.ts +43 -0
  267. package/src/crystal3d/core/primitives.ts +183 -0
  268. package/src/crystal3d/core/structureText.ts +43 -0
  269. package/src/crystal3d/core/supercell.ts +40 -0
  270. package/src/crystal3d/core/types.ts +186 -0
  271. package/src/crystal3d/core/vec3.ts +127 -0
  272. package/src/crystal3d/ui/CrystalCanvas3D.tsx +393 -0
  273. package/src/crystal3d/ui/CrystalStructureView.tsx +153 -0
  274. package/src/crystal3d/ui/CrystalStructureViewer.tsx +39 -0
  275. package/src/crystal3d/ui/CrystalViewControls.tsx +129 -0
  276. package/src/crystal3d/ui/CrystalViewer3D.tsx +183 -0
  277. package/src/crystal3d/ui/crystalScene.ts +106 -0
  278. package/src/crystal3d/ui/crystalStructureViewerProps.ts +54 -0
  279. package/src/crystal3d/ui/index.ts +20 -0
  280. package/src/crystal3d/ui/useCrystalCaption.ts +38 -0
  281. package/src/crystal3d/viewer/animate.ts +113 -0
  282. package/src/crystal3d/viewer/camera.ts +139 -0
  283. package/src/crystal3d/viewer/index.ts +13 -0
  284. package/src/crystal3d/viewer/layerRegistry.ts +47 -0
  285. package/src/crystal3d/viewer/meshPrimitives.ts +102 -0
  286. package/src/crystal3d/viewer/plugin.ts +258 -0
  287. package/src/crystal3d/viewer/renderCell.ts +98 -0
  288. package/src/crystal3d/viewer/renderElements.ts +121 -0
  289. package/src/crystal3d/viewer/renderStructure.ts +209 -0
  290. package/src/crystal3d/viewer/sceneParts.ts +119 -0
  291. package/src/crystal3d/viewer/shapeLayer.ts +108 -0
  292. package/src/crystal3d/viewer/textLayer.ts +85 -0
  293. package/src/crystal3d/viewer/viewer.ts +223 -0
  294. package/src/crystal3d.ts +12 -0
  295. package/src/download/core/croppedMarkup.ts +16 -42
  296. package/src/download/core/dataUrl.ts +59 -0
  297. package/src/download/core/index.ts +3 -0
  298. package/src/download/core/svgMarkup.ts +113 -0
  299. package/src/drawing/ui/movingFigure.ts +4 -28
  300. package/src/locales/de.json +26 -1
  301. package/src/locales/en.json +26 -1
  302. package/src/locales/es.json +26 -1
  303. package/src/locales/fr.json +26 -1
  304. package/src/locales/it.json +26 -1
  305. package/src/molecule3d/ui/MoleculeCanvas3D.tsx +45 -71
  306. package/src/molstar/bonds/bondRule.ts +34 -0
  307. package/src/molstar/bonds/index.ts +9 -0
  308. package/src/molstar/ui/MolstarToolbar.tsx +103 -0
  309. package/src/molstar/ui/index.ts +14 -0
  310. package/src/molstar/ui/useMolstarTools.ts +98 -0
  311. package/styles/chrome.css +90 -0
@@ -0,0 +1,153 @@
1
+ /**
2
+ * The unit cell as lines in space: its three edge vectors, the twelve edges of
3
+ * one box, and the boxes of a supercell.
4
+ *
5
+ * The cell is drawn here rather than by molstar's own unit-cell shape, because
6
+ * the site hands molstar no space group at all — it has already applied its own
7
+ * operations — and because an n×n×n stack of boxes is not something that shape
8
+ * can draw.
9
+ */
10
+ import { cartesianMatrix } from "../../crystal/core/symmetry/lattice.js";
11
+ import { addVectors, scaleVector } from "./vec3.js";
12
+ /**
13
+ * The Cartesian components of a, b and c.
14
+ *
15
+ * The convention is the PDB one — a along x, b in the xy plane — which is the
16
+ * one `src/symmetry/core` uses and the one every CIF consumer assumes.
17
+ * @param cell - The six cell parameters.
18
+ * @returns The three edge vectors, in ångström.
19
+ * @throws {RangeError} When the three angles describe no cell.
20
+ */
21
+ export function cellAxes(cell) {
22
+ const matrix = cartesianMatrix(cell);
23
+ return [columnOf(matrix, 0), columnOf(matrix, 1), columnOf(matrix, 2)];
24
+ }
25
+ /**
26
+ * Where one fractional point of one cell of the stack sits.
27
+ * @param axes - The cell's edge vectors.
28
+ * @param fractional - The point, in cell fractions.
29
+ * @returns Its Cartesian position, ångström.
30
+ */
31
+ export function cellPoint(axes, fractional) {
32
+ return addVectors(addVectors(scaleVector(axes[0], fractional[0]), scaleVector(axes[1], fractional[1])), scaleVector(axes[2], fractional[2]));
33
+ }
34
+ /**
35
+ * The lattice translations of an n×n×n stack, one per cell, in reading order.
36
+ * @param axes - The cell's edge vectors.
37
+ * @param repeat - Cells along a, b and c; anything below 1 counts as 1.
38
+ * @returns One translation per cell, the first of them zero.
39
+ */
40
+ export function latticeShifts(axes, repeat) {
41
+ const counts = clampRepeat(repeat);
42
+ const shifts = [];
43
+ for (let i = 0; i < counts[0]; i++) {
44
+ for (let j = 0; j < counts[1]; j++) {
45
+ for (let k = 0; k < counts[2]; k++) {
46
+ shifts.push(cellPoint(axes, [i, j, k]));
47
+ }
48
+ }
49
+ }
50
+ return shifts;
51
+ }
52
+ /**
53
+ * Every edge of every cell of the stack.
54
+ * @param cell - The six cell parameters.
55
+ * @param repeat - Cells along a, b and c.
56
+ * @returns Twelve edges per cell.
57
+ * @throws {RangeError} When the three angles describe no cell.
58
+ */
59
+ export function cellEdges(cell, repeat = [1, 1, 1]) {
60
+ const axes = cellAxes(cell);
61
+ const edges = [];
62
+ for (const shift of latticeShifts(axes, repeat)) {
63
+ for (const [from, to] of BOX_EDGES) {
64
+ edges.push({
65
+ start: addVectors(shift, cellPoint(axes, from)),
66
+ end: addVectors(shift, cellPoint(axes, to)),
67
+ });
68
+ }
69
+ }
70
+ return edges;
71
+ }
72
+ /**
73
+ * Where the a, b and c letters sit on the box at the origin.
74
+ * @param cell - The six cell parameters.
75
+ * @param reach - How far along each edge, as a fraction of it.
76
+ * @returns Three points, for a, b and c in that order.
77
+ * @throws {RangeError} When the three angles describe no cell.
78
+ */
79
+ export function cellAxisLabelPoints(cell, reach = 0.55) {
80
+ const [a, b, c] = cellAxes(cell);
81
+ return [scaleVector(a, reach), scaleVector(b, reach), scaleVector(c, reach)];
82
+ }
83
+ /**
84
+ * Each count, rounded down and never below one.
85
+ * @param repeat - Cells along a, b and c.
86
+ * @returns The counts, whole and at least one.
87
+ */
88
+ export function clampRepeat(repeat) {
89
+ return [
90
+ Math.max(1, Math.floor(repeat[0])),
91
+ Math.max(1, Math.floor(repeat[1])),
92
+ Math.max(1, Math.floor(repeat[2])),
93
+ ];
94
+ }
95
+ function columnOf(matrix, column) {
96
+ return [
97
+ matrix[0]?.[column] ?? 0,
98
+ matrix[1]?.[column] ?? 0,
99
+ matrix[2]?.[column] ?? 0,
100
+ ];
101
+ }
102
+ /** The twelve edges of a box, as pairs of its eight fractional corners. */
103
+ const BOX_EDGES = [
104
+ [
105
+ [0, 0, 0],
106
+ [1, 0, 0],
107
+ ],
108
+ [
109
+ [0, 1, 0],
110
+ [1, 1, 0],
111
+ ],
112
+ [
113
+ [0, 0, 1],
114
+ [1, 0, 1],
115
+ ],
116
+ [
117
+ [0, 1, 1],
118
+ [1, 1, 1],
119
+ ],
120
+ [
121
+ [0, 0, 0],
122
+ [0, 1, 0],
123
+ ],
124
+ [
125
+ [1, 0, 0],
126
+ [1, 1, 0],
127
+ ],
128
+ [
129
+ [0, 0, 1],
130
+ [0, 1, 1],
131
+ ],
132
+ [
133
+ [1, 0, 1],
134
+ [1, 1, 1],
135
+ ],
136
+ [
137
+ [0, 0, 0],
138
+ [0, 0, 1],
139
+ ],
140
+ [
141
+ [1, 0, 0],
142
+ [1, 0, 1],
143
+ ],
144
+ [
145
+ [0, 1, 0],
146
+ [0, 1, 1],
147
+ ],
148
+ [
149
+ [1, 1, 0],
150
+ [1, 1, 1],
151
+ ],
152
+ ];
153
+ //# sourceMappingURL=cellGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cellGeometry.js","sourceRoot":"","sources":["../../../src/crystal3d/core/cellGeometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AAIzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAQpD;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAc;IACrC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,MA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E,CAAC,CAAC;KACV;IACD;QACE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACV;IACD;QACE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACV;IACD;QACE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;KACV;CACF,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * More than one cell of it.
3
+ *
4
+ * The stack is n×n×n and starts every axis at cell 0. The atoms themselves are
5
+ * repeated by `supercellAtoms`, which works in Cartesian ångström and is what
6
+ * the scene wants. What is here is what that does not say: the six parameters
7
+ * of the stack, how many atoms it holds, and how large a stack this machine
8
+ * should be asked to draw.
9
+ */
10
+ import type { UnitCell } from '../../crystal/core/symmetry/lattice.ts';
11
+ /**
12
+ * How many atoms a page draws before it stops growing the stack.
13
+ *
14
+ * The whole stack is rebuilt on every change — a cell edge, an atom, a group —
15
+ * so the ceiling is what keeps a 4×4×4 of a 192-operation group from freezing
16
+ * the page rather than drawing it.
17
+ */
18
+ export declare const SUPERCELL_ATOM_CAP = 20000;
19
+ /**
20
+ * The six parameters of the stack itself: the edges multiply, the angles do not.
21
+ *
22
+ * Its operations are **not** those of the cell it was built from — half of
23
+ * `P2₁/c`'s stop being symmetry operations the moment `a` is doubled — so
24
+ * nothing here claims a space group for it.
25
+ * @param cell - The cell being repeated.
26
+ * @param cells - Cells along each axis; anything below 1 counts as 1.
27
+ * @returns The stack's own cell.
28
+ */
29
+ export declare function repeatCell(cell: UnitCell, cells: number): UnitCell;
30
+ /**
31
+ * How many atoms the stack holds, without building it.
32
+ * @param atomsPerCell - Atoms in one cell, after the symmetry has filled it.
33
+ * @param cells - Cells along each axis.
34
+ * @returns Atoms in the whole stack.
35
+ */
36
+ export declare function repeatedAtomCount(atomsPerCell: number, cells: number): number;
37
+ /**
38
+ * The largest stack at or below the one asked for that stays under the ceiling.
39
+ *
40
+ * A cell of eight atoms reaches 4×4×4 and a cell of a thousand does not, so the
41
+ * answer depends on the structure rather than on a number in the interface. The
42
+ * page says which it drew when it is not the one asked for.
43
+ * @param atomsPerCell - Atoms in one cell.
44
+ * @param cells - Cells along each axis the reader asked for.
45
+ * @param cap - Atoms the page will draw.
46
+ * @default SUPERCELL_ATOM_CAP
47
+ * @returns Cells along each axis, never below 1 even when one cell is already
48
+ * over the ceiling: a structure is drawn whole or not at all.
49
+ */
50
+ export declare function largestRepeatThatFits(atomsPerCell: number, cells: number, cap?: number): number;
51
+ //# sourceMappingURL=cellStack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cellStack.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/cellStack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,QAAQ,CAUlE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,SAAqB,GACvB,MAAM,CAKR"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * More than one cell of it.
3
+ *
4
+ * The stack is n×n×n and starts every axis at cell 0. The atoms themselves are
5
+ * repeated by `supercellAtoms`, which works in Cartesian ångström and is what
6
+ * the scene wants. What is here is what that does not say: the six parameters
7
+ * of the stack, how many atoms it holds, and how large a stack this machine
8
+ * should be asked to draw.
9
+ */
10
+ /**
11
+ * How many atoms a page draws before it stops growing the stack.
12
+ *
13
+ * The whole stack is rebuilt on every change — a cell edge, an atom, a group —
14
+ * so the ceiling is what keeps a 4×4×4 of a 192-operation group from freezing
15
+ * the page rather than drawing it.
16
+ */
17
+ export const SUPERCELL_ATOM_CAP = 20000;
18
+ /**
19
+ * The six parameters of the stack itself: the edges multiply, the angles do not.
20
+ *
21
+ * Its operations are **not** those of the cell it was built from — half of
22
+ * `P2₁/c`'s stop being symmetry operations the moment `a` is doubled — so
23
+ * nothing here claims a space group for it.
24
+ * @param cell - The cell being repeated.
25
+ * @param cells - Cells along each axis; anything below 1 counts as 1.
26
+ * @returns The stack's own cell.
27
+ */
28
+ export function repeatCell(cell, cells) {
29
+ const count = wholeCells(cells);
30
+ return {
31
+ a: cell.a * count,
32
+ b: cell.b * count,
33
+ c: cell.c * count,
34
+ alpha: cell.alpha,
35
+ beta: cell.beta,
36
+ gamma: cell.gamma,
37
+ };
38
+ }
39
+ /**
40
+ * How many atoms the stack holds, without building it.
41
+ * @param atomsPerCell - Atoms in one cell, after the symmetry has filled it.
42
+ * @param cells - Cells along each axis.
43
+ * @returns Atoms in the whole stack.
44
+ */
45
+ export function repeatedAtomCount(atomsPerCell, cells) {
46
+ const count = wholeCells(cells);
47
+ return atomsPerCell * count * count * count;
48
+ }
49
+ /**
50
+ * The largest stack at or below the one asked for that stays under the ceiling.
51
+ *
52
+ * A cell of eight atoms reaches 4×4×4 and a cell of a thousand does not, so the
53
+ * answer depends on the structure rather than on a number in the interface. The
54
+ * page says which it drew when it is not the one asked for.
55
+ * @param atomsPerCell - Atoms in one cell.
56
+ * @param cells - Cells along each axis the reader asked for.
57
+ * @param cap - Atoms the page will draw.
58
+ * @default SUPERCELL_ATOM_CAP
59
+ * @returns Cells along each axis, never below 1 even when one cell is already
60
+ * over the ceiling: a structure is drawn whole or not at all.
61
+ */
62
+ export function largestRepeatThatFits(atomsPerCell, cells, cap = SUPERCELL_ATOM_CAP) {
63
+ for (let count = wholeCells(cells); count > 1; count--) {
64
+ if (repeatedAtomCount(atomsPerCell, count) <= cap)
65
+ return count;
66
+ }
67
+ return 1;
68
+ }
69
+ /**
70
+ * Whole cells, one at the least.
71
+ * @param cells - Cells along each axis, as asked for.
72
+ * @returns The count rounded to a whole number, 1 when it is not finite.
73
+ */
74
+ function wholeCells(cells) {
75
+ if (!Number.isFinite(cells))
76
+ return 1;
77
+ return Math.max(1, Math.round(cells));
78
+ }
79
+ //# sourceMappingURL=cellStack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cellStack.js","sourceRoot":"","sources":["../../../src/crystal3d/core/cellStack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC;;;;;;;;;GASG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc,EAAE,KAAa;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO;QACL,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,KAAK;QACjB,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,KAAK;QACjB,CAAC,EAAE,IAAI,CAAC,CAAC,GAAG,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAoB,EAAE,KAAa;IACnE,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAAoB,EACpB,KAAa,EACb,GAAG,GAAG,kBAAkB;IAExB,KAAK,IAAI,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACvD,IAAI,iBAAiB,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,GAAG;YAAE,OAAO,KAAK,CAAC;IAClE,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * What a crystal view draws, from the atoms of one cell: its molecules whole
3
+ * or the atoms the cell walls cut, repeated over as many cells as fit.
4
+ */
5
+ import type { BondLimit, PackedAtom } from '../../crystal/core/periodicBonds.ts';
6
+ import type { Lattice } from '../../crystal/core/symmetry/lattice.ts';
7
+ import type { ViewerAtom } from './types.ts';
8
+ /**
9
+ * How the cell is drawn: each molecule whole, in the cell its centre falls in,
10
+ * or every atom inside the cell, cut where its walls cut it.
11
+ */
12
+ export type CrystalPacking = 'molecules' | 'cell';
13
+ /** Every packing, in the order a control offers them. */
14
+ export declare const CRYSTAL_PACKINGS: readonly CrystalPacking[];
15
+ /**
16
+ * Which bonds are drawn: every one, all but those to a metal atom (molstar
17
+ * draws those dashed, and a coordination network of them hides the rest), or
18
+ * none.
19
+ */
20
+ export type CrystalBonds = 'all' | 'noMetal' | 'none';
21
+ /** Every choice of bonds, in the order a control offers them. */
22
+ export declare const CRYSTAL_BONDS: readonly CrystalBonds[];
23
+ /** The cells along each axis a control offers, and a link may ask for. */
24
+ export declare const CELL_COUNT_RANGE: {
25
+ readonly minimum: 1;
26
+ readonly maximum: 4;
27
+ };
28
+ /** Options of {@link crystalView}. */
29
+ export interface CrystalViewOptions {
30
+ /**
31
+ * How the cell is drawn.
32
+ * @default 'molecules'
33
+ */
34
+ packing?: CrystalPacking;
35
+ /**
36
+ * Cells along each axis asked for; fewer are drawn when they would hold too
37
+ * many atoms.
38
+ * @default 1
39
+ */
40
+ cells?: number;
41
+ /**
42
+ * When two atoms are bonded, which is what completes a molecule. Pass the
43
+ * rule the viewer draws bonds with, so what is completed is what is joined.
44
+ */
45
+ bondLimit: BondLimit;
46
+ }
47
+ /** What {@link crystalView} found. */
48
+ export interface CrystalView {
49
+ /** The atoms to draw, Cartesian ångström, repeated over the cells. */
50
+ readonly atoms: ViewerAtom[];
51
+ /** Cells drawn along each axis: what was asked, or fewer. */
52
+ readonly cells: number;
53
+ /** Atoms in one cell, as drawn. */
54
+ readonly atomsPerCell: number;
55
+ /** Molecules in one cell, 0 when the cell is drawn as it is cut. */
56
+ readonly molecules: number;
57
+ /** Whether some atoms belong to a network running through the crystal. */
58
+ readonly extended: boolean;
59
+ }
60
+ /**
61
+ * The atoms a crystal view draws.
62
+ * @param cellAtoms - Every atom of one cell, fractional, wrapped into [0, 1).
63
+ * @param lattice - The cell they sit in.
64
+ * @param options - See {@link CrystalViewOptions}.
65
+ * @returns The atoms and what they hold.
66
+ */
67
+ export declare function crystalView(cellAtoms: readonly PackedAtom[], lattice: Lattice, options: CrystalViewOptions): CrystalView;
68
+ /** How a crystal view is set: what a control changes and a link may carry. */
69
+ export interface CrystalViewSettings {
70
+ /** How the cell is drawn. */
71
+ readonly packing: CrystalPacking;
72
+ /** Cells along each axis. */
73
+ readonly cells: number;
74
+ /** Whether the box of the unit cell is drawn. */
75
+ readonly unitCell: boolean;
76
+ /** Which bonds are drawn. */
77
+ readonly bonds: CrystalBonds;
78
+ }
79
+ /** One cell, its molecules whole, inside its box. */
80
+ export declare const DEFAULT_CRYSTAL_VIEW_SETTINGS: CrystalViewSettings;
81
+ //# sourceMappingURL=crystalView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version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C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,kBAAkB,GAC1B,WAAW,CAmBb;AAED,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAED,qDAAqD;AACrD,eAAO,MAAM,6BAA6B,EAAE,mBAK3C,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * What a crystal view draws, from the atoms of one cell: its molecules whole
3
+ * or the atoms the cell walls cut, repeated over as many cells as fit.
4
+ */
5
+ import { packMolecules } from "../../crystal/core/packing.js";
6
+ import { fractionalToCartesian } from "../../crystal/core/symmetry/lattice.js";
7
+ import { largestRepeatThatFits } from "./cellStack.js";
8
+ import { supercellAtoms } from "./supercell.js";
9
+ /** Every packing, in the order a control offers them. */
10
+ export const CRYSTAL_PACKINGS = [
11
+ 'molecules',
12
+ 'cell',
13
+ ];
14
+ /** Every choice of bonds, in the order a control offers them. */
15
+ export const CRYSTAL_BONDS = [
16
+ 'all',
17
+ 'noMetal',
18
+ 'none',
19
+ ];
20
+ /** The cells along each axis a control offers, and a link may ask for. */
21
+ export const CELL_COUNT_RANGE = { minimum: 1, maximum: 4 };
22
+ /**
23
+ * The atoms a crystal view draws.
24
+ * @param cellAtoms - Every atom of one cell, fractional, wrapped into [0, 1).
25
+ * @param lattice - The cell they sit in.
26
+ * @param options - See {@link CrystalViewOptions}.
27
+ * @returns The atoms and what they hold.
28
+ */
29
+ export function crystalView(cellAtoms, lattice, options) {
30
+ const { packing = 'molecules', cells: asked = 1, bondLimit } = options;
31
+ const packed = packing === 'molecules'
32
+ ? packMolecules(cellAtoms, lattice, bondLimit)
33
+ : { atoms: cellAtoms, molecules: 0, extended: false };
34
+ const cells = largestRepeatThatFits(packed.atoms.length, asked);
35
+ const oneCell = [];
36
+ for (const atom of packed.atoms) {
37
+ const [x = 0, y = 0, z = 0] = fractionalToCartesian(lattice, atom.position);
38
+ oneCell.push({ element: atom.element, position: [x, y, z] });
39
+ }
40
+ return {
41
+ atoms: supercellAtoms(oneCell, lattice.cell, [cells, cells, cells]),
42
+ cells,
43
+ atomsPerCell: packed.atoms.length,
44
+ molecules: packed.molecules,
45
+ extended: packed.extended,
46
+ };
47
+ }
48
+ /** One cell, its molecules whole, inside its box. */
49
+ export const DEFAULT_CRYSTAL_VIEW_SETTINGS = {
50
+ packing: 'molecules',
51
+ cells: 1,
52
+ unitCell: true,
53
+ bonds: 'all',
54
+ };
55
+ //# sourceMappingURL=crystalView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crystalView.js","sourceRoot":"","sources":["../../../src/crystal3d/core/crystalView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAM9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAShD,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAA8B;IACzD,WAAW;IACX,MAAM;CACP,CAAC;AASF,iEAAiE;AACjE,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,KAAK;IACL,SAAS;IACT,MAAM;CACP,CAAC;AAEF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAW,CAAC;AAoCpE;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CACzB,SAAgC,EAChC,OAAgB,EAChB,OAA2B;IAE3B,MAAM,EAAE,O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,KAAK;CACb,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The set of symmetry elements currently drawn, kept as a list so a page can
3
+ * add and remove one at a time without rebuilding its own bookkeeping.
4
+ *
5
+ * The mesh behind them is rebuilt whole on every change — a handful of rods and
6
+ * squares costs nothing — but the *set* is edited, which is what lets a chip bar
7
+ * turn the mirrors off and leave the axes alone.
8
+ */
9
+ import type { SymmetryDrawing } from './types.ts';
10
+ /**
11
+ * Add the drawings, replacing any that carry an id already present.
12
+ * @param current - What is drawn now.
13
+ * @param incoming - What to add or replace.
14
+ * @returns The new set: the current order kept, anything genuinely new appended.
15
+ */
16
+ export declare function mergeDrawings(current: readonly SymmetryDrawing[], incoming: readonly SymmetryDrawing[]): SymmetryDrawing[];
17
+ /**
18
+ * Drop the drawings with these ids.
19
+ * @param current - What is drawn now.
20
+ * @param ids - Which to remove; an id that is not drawn is ignored.
21
+ * @returns The rest, in the order they were in.
22
+ */
23
+ export declare function withoutDrawings(current: readonly SymmetryDrawing[], ids: readonly string[]): SymmetryDrawing[];
24
+ /**
25
+ * Whether two sets would draw the same thing, so an unchanged render is skipped.
26
+ * @param a - One set.
27
+ * @param b - The other.
28
+ * @returns Whether they hold the same drawings, in the same order.
29
+ */
30
+ export declare function sameDrawings(a: readonly SymmetryDrawing[], b: readonly SymmetryDrawing[]): boolean;
31
+ //# sourceMappingURL=drawingSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawingSet.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/drawingSet.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,QAAQ,EAAE,SAAS,eAAe,EAAE,GACnC,eAAe,EAAE,CAenB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,GAAG,EAAE,SAAS,MAAM,EAAE,GACrB,eAAe,EAAE,CAOnB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,CAAC,EAAE,SAAS,eAAe,EAAE,EAC7B,CAAC,EAAE,SAAS,eAAe,EAAE,GAC5B,OAAO,CAMT"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The set of symmetry elements currently drawn, kept as a list so a page can
3
+ * add and remove one at a time without rebuilding its own bookkeeping.
4
+ *
5
+ * The mesh behind them is rebuilt whole on every change — a handful of rods and
6
+ * squares costs nothing — but the *set* is edited, which is what lets a chip bar
7
+ * turn the mirrors off and leave the axes alone.
8
+ */
9
+ /**
10
+ * Add the drawings, replacing any that carry an id already present.
11
+ * @param current - What is drawn now.
12
+ * @param incoming - What to add or replace.
13
+ * @returns The new set: the current order kept, anything genuinely new appended.
14
+ */
15
+ export function mergeDrawings(current, incoming) {
16
+ const replacements = new Map();
17
+ for (const drawing of incoming)
18
+ replacements.set(drawing.id, drawing);
19
+ const merged = [];
20
+ for (const drawing of current) {
21
+ merged.push(replacements.get(drawing.id) ?? drawing);
22
+ replacements.delete(drawing.id);
23
+ }
24
+ for (const drawing of incoming) {
25
+ const pending = replacements.get(drawing.id);
26
+ if (pending === undefined)
27
+ continue;
28
+ merged.push(pending);
29
+ replacements.delete(drawing.id);
30
+ }
31
+ return merged;
32
+ }
33
+ /**
34
+ * Drop the drawings with these ids.
35
+ * @param current - What is drawn now.
36
+ * @param ids - Which to remove; an id that is not drawn is ignored.
37
+ * @returns The rest, in the order they were in.
38
+ */
39
+ export function withoutDrawings(current, ids) {
40
+ const dropped = new Set(ids);
41
+ const kept = [];
42
+ for (const drawing of current) {
43
+ if (!dropped.has(drawing.id))
44
+ kept.push(drawing);
45
+ }
46
+ return kept;
47
+ }
48
+ /**
49
+ * Whether two sets would draw the same thing, so an unchanged render is skipped.
50
+ * @param a - One set.
51
+ * @param b - The other.
52
+ * @returns Whether they hold the same drawings, in the same order.
53
+ */
54
+ export function sameDrawings(a, b) {
55
+ if (a.length !== b.length)
56
+ return false;
57
+ for (let index = 0; index < a.length; index++) {
58
+ if (a[index] !== b[index])
59
+ return false;
60
+ }
61
+ return true;
62
+ }
63
+ //# sourceMappingURL=drawingSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawingSet.js","sourceRoot":"","sources":["../../../src/crystal3d/core/drawingSet.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAmC,EACnC,QAAoC;IAEpC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA2B,CAAC;IACxD,KAAK,MAAM,OAAO,IAAI,QAAQ;QAAE,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACtE,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC;QACrD,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7C,IAAI,OAAO,KAAK,SAAS;YAAE,SAAS;QACpC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAmC,EACnC,GAAsB;IAEtB,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,IAAI,GAAsB,EAAE,CAAC;IACnC,KAAK,MAAM,OAAO,IAAI,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,CAA6B,EAC7B,CAA6B;IAE7B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACxC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAC9C,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * A symmetry element as shapes: the whole of what the 3D view draws over a
3
+ * structure, worked out without a canvas anywhere in sight.
4
+ *
5
+ * The rules are the ones a crystallographic diagram uses. A proper axis is a
6
+ * solid rod; a screw carries an arrow as long as its pitch, beside the rod so
7
+ * neither hides the other; a rotoinversion is broken, with a ball at the point
8
+ * it inverts through; a plane is a translucent face with its rim drawn, and a
9
+ * glide plane wears its glide vector as an arrow lying in it.
10
+ *
11
+ * A plane drawn over a cell is handed the polygon it cuts out of that cell, so
12
+ * what is on screen is the slice itself rather than a square hanging in the
13
+ * middle of the box. Without one — a molecule has no cell to cut — it falls
14
+ * back to a square of `size`.
15
+ */
16
+ import type { ElementStyle, MeshPrimitive, TextItem } from './primitives.ts';
17
+ import type { SymmetryDrawing } from './types.ts';
18
+ /** One element, ready to become one pickable, labelled group of a mesh. */
19
+ export interface ElementGroup {
20
+ /** The drawing's own id, unchanged. */
21
+ readonly id: string;
22
+ /** What the pointer reads. */
23
+ readonly label: string;
24
+ /** `#rrggbb`. */
25
+ readonly colour: string;
26
+ /** Its shapes. */
27
+ readonly primitives: readonly MeshPrimitive[];
28
+ /** Its floating text, empty when labels are off. */
29
+ readonly labels: readonly TextItem[];
30
+ }
31
+ /**
32
+ * Turn the drawings into groups, in the order they were given.
33
+ * @param drawings - The elements to draw.
34
+ * @param options - Sizes, and whether the labels are drawn.
35
+ * @param options.style - Sizes of the shapes, over the defaults.
36
+ * @param options.labels - Whether the labels are drawn; true by default.
37
+ * @returns One group per drawing.
38
+ */
39
+ export declare function elementGroups(drawings: readonly SymmetryDrawing[], options?: {
40
+ style?: ElementStyle;
41
+ labels?: boolean;
42
+ }): ElementGroup[];
43
+ /**
44
+ * The shapes one element is drawn as.
45
+ * @param drawing - The element.
46
+ * @param style - Sizes; the defaults are used for anything left out.
47
+ * @returns Its shapes, in drawing order.
48
+ */
49
+ export declare function drawingPrimitives(drawing: SymmetryDrawing, style?: ElementStyle): MeshPrimitive[];
50
+ //# sourceMappingURL=elementDrawing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elementDrawing.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/elementDrawing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,YAAY,CAAC;AAQ1D,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iBAAiB;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kBAAkB;IAClB,QAAQ,CAAC,UAAU,EAAE,SAAS,aAAa,EAAE,CAAC;IAC9C,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACvD,YAAY,EAAE,CAehB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,eAAe,EACxB,KAAK,GAAE,YAAiB,GACvB,aAAa,EAAE,CAgEjB"}