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.
- package/README.md +1 -1
- package/lib/crystal/core/cellAtoms.d.ts +43 -0
- package/lib/crystal/core/cellAtoms.d.ts.map +1 -0
- package/lib/crystal/core/cellAtoms.js +70 -0
- package/lib/crystal/core/cellAtoms.js.map +1 -0
- package/lib/crystal/core/index.d.ts +2 -0
- package/lib/crystal/core/index.d.ts.map +1 -1
- package/lib/crystal/core/index.js +1 -0
- package/lib/crystal/core/index.js.map +1 -1
- package/lib/crystal/core/molecules.d.ts.map +1 -1
- package/lib/crystal/core/molecules.js +6 -40
- package/lib/crystal/core/molecules.js.map +1 -1
- package/lib/crystal3d/core/cellClip.d.ts +46 -0
- package/lib/crystal3d/core/cellClip.d.ts.map +1 -0
- package/lib/crystal3d/core/cellClip.js +198 -0
- package/lib/crystal3d/core/cellClip.js.map +1 -0
- package/lib/crystal3d/core/cellGeometry.d.ts +63 -0
- package/lib/crystal3d/core/cellGeometry.d.ts.map +1 -0
- package/lib/crystal3d/core/cellGeometry.js +153 -0
- package/lib/crystal3d/core/cellGeometry.js.map +1 -0
- package/lib/crystal3d/core/cellStack.d.ts +51 -0
- package/lib/crystal3d/core/cellStack.d.ts.map +1 -0
- package/lib/crystal3d/core/cellStack.js +79 -0
- package/lib/crystal3d/core/cellStack.js.map +1 -0
- package/lib/crystal3d/core/crystalView.d.ts +81 -0
- package/lib/crystal3d/core/crystalView.d.ts.map +1 -0
- package/lib/crystal3d/core/crystalView.js +55 -0
- package/lib/crystal3d/core/crystalView.js.map +1 -0
- package/lib/crystal3d/core/drawingSet.d.ts +31 -0
- package/lib/crystal3d/core/drawingSet.d.ts.map +1 -0
- package/lib/crystal3d/core/drawingSet.js +63 -0
- package/lib/crystal3d/core/drawingSet.js.map +1 -0
- package/lib/crystal3d/core/elementDrawing.d.ts +50 -0
- package/lib/crystal3d/core/elementDrawing.d.ts.map +1 -0
- package/lib/crystal3d/core/elementDrawing.js +100 -0
- package/lib/crystal3d/core/elementDrawing.js.map +1 -0
- package/lib/crystal3d/core/elementExtent.d.ts +42 -0
- package/lib/crystal3d/core/elementExtent.d.ts.map +1 -0
- package/lib/crystal3d/core/elementExtent.js +56 -0
- package/lib/crystal3d/core/elementExtent.js.map +1 -0
- package/lib/crystal3d/core/elementLabels.d.ts +31 -0
- package/lib/crystal3d/core/elementLabels.d.ts.map +1 -0
- package/lib/crystal3d/core/elementLabels.js +99 -0
- package/lib/crystal3d/core/elementLabels.js.map +1 -0
- package/lib/crystal3d/core/elementShapes.d.ts +43 -0
- package/lib/crystal3d/core/elementShapes.d.ts.map +1 -0
- package/lib/crystal3d/core/elementShapes.js +115 -0
- package/lib/crystal3d/core/elementShapes.js.map +1 -0
- package/lib/crystal3d/core/frame.d.ts +36 -0
- package/lib/crystal3d/core/frame.d.ts.map +1 -0
- package/lib/crystal3d/core/frame.js +35 -0
- package/lib/crystal3d/core/frame.js.map +1 -0
- package/lib/crystal3d/core/framing.d.ts +41 -0
- package/lib/crystal3d/core/framing.d.ts.map +1 -0
- package/lib/crystal3d/core/framing.js +79 -0
- package/lib/crystal3d/core/framing.js.map +1 -0
- package/lib/crystal3d/core/index.d.ts +42 -0
- package/lib/crystal3d/core/index.d.ts.map +1 -0
- package/lib/crystal3d/core/index.js +29 -0
- package/lib/crystal3d/core/index.js.map +1 -0
- package/lib/crystal3d/core/labelText.d.ts +19 -0
- package/lib/crystal3d/core/labelText.d.ts.map +1 -0
- package/lib/crystal3d/core/labelText.js +42 -0
- package/lib/crystal3d/core/labelText.js.map +1 -0
- package/lib/crystal3d/core/latticeBasis.d.ts +49 -0
- package/lib/crystal3d/core/latticeBasis.d.ts.map +1 -0
- package/lib/crystal3d/core/latticeBasis.js +89 -0
- package/lib/crystal3d/core/latticeBasis.js.map +1 -0
- package/lib/crystal3d/core/mat3.d.ts +68 -0
- package/lib/crystal3d/core/mat3.d.ts.map +1 -0
- package/lib/crystal3d/core/mat3.js +146 -0
- package/lib/crystal3d/core/mat3.js.map +1 -0
- package/lib/crystal3d/core/operationMatrix.d.ts +44 -0
- package/lib/crystal3d/core/operationMatrix.d.ts.map +1 -0
- package/lib/crystal3d/core/operationMatrix.js +172 -0
- package/lib/crystal3d/core/operationMatrix.js.map +1 -0
- package/lib/crystal3d/core/orientation.d.ts +62 -0
- package/lib/crystal3d/core/orientation.d.ts.map +1 -0
- package/lib/crystal3d/core/orientation.js +166 -0
- package/lib/crystal3d/core/orientation.js.map +1 -0
- package/lib/crystal3d/core/palette.d.ts +24 -0
- package/lib/crystal3d/core/palette.d.ts.map +1 -0
- package/lib/crystal3d/core/palette.js +34 -0
- package/lib/crystal3d/core/palette.js.map +1 -0
- package/lib/crystal3d/core/primitives.d.ts +133 -0
- package/lib/crystal3d/core/primitives.d.ts.map +1 -0
- package/lib/crystal3d/core/primitives.js +80 -0
- package/lib/crystal3d/core/primitives.js.map +1 -0
- package/lib/crystal3d/core/structureText.d.ts +20 -0
- package/lib/crystal3d/core/structureText.d.ts.map +1 -0
- package/lib/crystal3d/core/structureText.js +37 -0
- package/lib/crystal3d/core/structureText.js.map +1 -0
- package/lib/crystal3d/core/supercell.d.ts +20 -0
- package/lib/crystal3d/core/supercell.d.ts.map +1 -0
- package/lib/crystal3d/core/supercell.js +35 -0
- package/lib/crystal3d/core/supercell.js.map +1 -0
- package/lib/crystal3d/core/types.d.ts +166 -0
- package/lib/crystal3d/core/types.d.ts.map +1 -0
- package/lib/crystal3d/core/types.js +10 -0
- package/lib/crystal3d/core/types.js.map +1 -0
- package/lib/crystal3d/core/vec3.d.ts +75 -0
- package/lib/crystal3d/core/vec3.d.ts.map +1 -0
- package/lib/crystal3d/core/vec3.js +119 -0
- package/lib/crystal3d/core/vec3.js.map +1 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts +52 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.js +250 -0
- package/lib/crystal3d/ui/CrystalCanvas3D.js.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureView.d.ts +17 -0
- package/lib/crystal3d/ui/CrystalStructureView.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureView.js +79 -0
- package/lib/crystal3d/ui/CrystalStructureView.js.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.d.ts +22 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.js +29 -0
- package/lib/crystal3d/ui/CrystalStructureViewer.js.map +1 -0
- package/lib/crystal3d/ui/CrystalViewControls.d.ts +29 -0
- package/lib/crystal3d/ui/CrystalViewControls.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalViewControls.js +24 -0
- package/lib/crystal3d/ui/CrystalViewControls.js.map +1 -0
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts +72 -0
- package/lib/crystal3d/ui/CrystalViewer3D.d.ts.map +1 -0
- package/lib/crystal3d/ui/CrystalViewer3D.js +70 -0
- package/lib/crystal3d/ui/CrystalViewer3D.js.map +1 -0
- package/lib/crystal3d/ui/crystalScene.d.ts +97 -0
- package/lib/crystal3d/ui/crystalScene.d.ts.map +1 -0
- package/lib/crystal3d/ui/crystalScene.js +10 -0
- package/lib/crystal3d/ui/crystalScene.js.map +1 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts +52 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.d.ts.map +1 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.js +2 -0
- package/lib/crystal3d/ui/crystalStructureViewerProps.js.map +1 -0
- package/lib/crystal3d/ui/index.d.ts +16 -0
- package/lib/crystal3d/ui/index.d.ts.map +1 -0
- package/lib/crystal3d/ui/index.js +12 -0
- package/lib/crystal3d/ui/index.js.map +1 -0
- package/lib/crystal3d/ui/useCrystalCaption.d.ts +14 -0
- package/lib/crystal3d/ui/useCrystalCaption.d.ts.map +1 -0
- package/lib/crystal3d/ui/useCrystalCaption.js +32 -0
- package/lib/crystal3d/ui/useCrystalCaption.js.map +1 -0
- package/lib/crystal3d/viewer/animate.d.ts +49 -0
- package/lib/crystal3d/viewer/animate.d.ts.map +1 -0
- package/lib/crystal3d/viewer/animate.js +83 -0
- package/lib/crystal3d/viewer/animate.js.map +1 -0
- package/lib/crystal3d/viewer/camera.d.ts +44 -0
- package/lib/crystal3d/viewer/camera.d.ts.map +1 -0
- package/lib/crystal3d/viewer/camera.js +103 -0
- package/lib/crystal3d/viewer/camera.js.map +1 -0
- package/lib/crystal3d/viewer/index.d.ts +13 -0
- package/lib/crystal3d/viewer/index.d.ts.map +1 -0
- package/lib/crystal3d/viewer/index.js +8 -0
- package/lib/crystal3d/viewer/index.js.map +1 -0
- package/lib/crystal3d/viewer/layerRegistry.d.ts +24 -0
- package/lib/crystal3d/viewer/layerRegistry.d.ts.map +1 -0
- package/lib/crystal3d/viewer/layerRegistry.js +39 -0
- package/lib/crystal3d/viewer/layerRegistry.js.map +1 -0
- package/lib/crystal3d/viewer/meshPrimitives.d.ts +13 -0
- package/lib/crystal3d/viewer/meshPrimitives.d.ts.map +1 -0
- package/lib/crystal3d/viewer/meshPrimitives.js +76 -0
- package/lib/crystal3d/viewer/meshPrimitives.js.map +1 -0
- package/lib/crystal3d/viewer/plugin.d.ts +133 -0
- package/lib/crystal3d/viewer/plugin.d.ts.map +1 -0
- package/lib/crystal3d/viewer/plugin.js +181 -0
- package/lib/crystal3d/viewer/plugin.js.map +1 -0
- package/lib/crystal3d/viewer/renderCell.d.ts +43 -0
- package/lib/crystal3d/viewer/renderCell.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderCell.js +53 -0
- package/lib/crystal3d/viewer/renderCell.js.map +1 -0
- package/lib/crystal3d/viewer/renderElements.d.ts +54 -0
- package/lib/crystal3d/viewer/renderElements.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderElements.js +77 -0
- package/lib/crystal3d/viewer/renderElements.js.map +1 -0
- package/lib/crystal3d/viewer/renderStructure.d.ts +80 -0
- package/lib/crystal3d/viewer/renderStructure.d.ts.map +1 -0
- package/lib/crystal3d/viewer/renderStructure.js +143 -0
- package/lib/crystal3d/viewer/renderStructure.js.map +1 -0
- package/lib/crystal3d/viewer/sceneParts.d.ts +32 -0
- package/lib/crystal3d/viewer/sceneParts.d.ts.map +1 -0
- package/lib/crystal3d/viewer/sceneParts.js +77 -0
- package/lib/crystal3d/viewer/sceneParts.js.map +1 -0
- package/lib/crystal3d/viewer/shapeLayer.d.ts +41 -0
- package/lib/crystal3d/viewer/shapeLayer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/shapeLayer.js +57 -0
- package/lib/crystal3d/viewer/shapeLayer.js.map +1 -0
- package/lib/crystal3d/viewer/textLayer.d.ts +21 -0
- package/lib/crystal3d/viewer/textLayer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/textLayer.js +59 -0
- package/lib/crystal3d/viewer/textLayer.js.map +1 -0
- package/lib/crystal3d/viewer/viewer.d.ts +119 -0
- package/lib/crystal3d/viewer/viewer.d.ts.map +1 -0
- package/lib/crystal3d/viewer/viewer.js +172 -0
- package/lib/crystal3d/viewer/viewer.js.map +1 -0
- package/lib/crystal3d.d.ts +12 -0
- package/lib/crystal3d.d.ts.map +1 -0
- package/lib/crystal3d.js +12 -0
- package/lib/crystal3d.js.map +1 -0
- package/lib/download/core/croppedMarkup.d.ts.map +1 -1
- package/lib/download/core/croppedMarkup.js +16 -40
- package/lib/download/core/croppedMarkup.js.map +1 -1
- package/lib/download/core/dataUrl.d.ts +27 -0
- package/lib/download/core/dataUrl.d.ts.map +1 -0
- package/lib/download/core/dataUrl.js +54 -0
- package/lib/download/core/dataUrl.js.map +1 -0
- package/lib/download/core/index.d.ts +3 -0
- package/lib/download/core/index.d.ts.map +1 -1
- package/lib/download/core/index.js +2 -0
- package/lib/download/core/index.js.map +1 -1
- package/lib/download/core/svgMarkup.d.ts +39 -0
- package/lib/download/core/svgMarkup.d.ts.map +1 -0
- package/lib/download/core/svgMarkup.js +100 -0
- package/lib/download/core/svgMarkup.js.map +1 -0
- package/lib/drawing/ui/movingFigure.d.ts.map +1 -1
- package/lib/drawing/ui/movingFigure.js +4 -30
- package/lib/drawing/ui/movingFigure.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +26 -1
- package/lib/locales/en.json +26 -1
- package/lib/locales/es.json +26 -1
- package/lib/locales/fr.json +26 -1
- package/lib/locales/it.json +26 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.d.ts.map +1 -1
- package/lib/molecule3d/ui/MoleculeCanvas3D.js +16 -27
- package/lib/molecule3d/ui/MoleculeCanvas3D.js.map +1 -1
- package/lib/molstar/bonds/bondRule.d.ts +16 -0
- package/lib/molstar/bonds/bondRule.d.ts.map +1 -0
- package/lib/molstar/bonds/bondRule.js +23 -0
- package/lib/molstar/bonds/bondRule.js.map +1 -0
- package/lib/molstar/bonds/index.d.ts +9 -0
- package/lib/molstar/bonds/index.d.ts.map +1 -0
- package/lib/molstar/bonds/index.js +9 -0
- package/lib/molstar/bonds/index.js.map +1 -0
- package/lib/molstar/ui/MolstarToolbar.d.ts +47 -0
- package/lib/molstar/ui/MolstarToolbar.d.ts.map +1 -0
- package/lib/molstar/ui/MolstarToolbar.js +28 -0
- package/lib/molstar/ui/MolstarToolbar.js.map +1 -0
- package/lib/molstar/ui/index.d.ts +10 -0
- package/lib/molstar/ui/index.d.ts.map +1 -0
- package/lib/molstar/ui/index.js +8 -0
- package/lib/molstar/ui/index.js.map +1 -0
- package/lib/molstar/ui/useMolstarTools.d.ts +63 -0
- package/lib/molstar/ui/useMolstarTools.d.ts.map +1 -0
- package/lib/molstar/ui/useMolstarTools.js +36 -0
- package/lib/molstar/ui/useMolstarTools.js.map +1 -0
- package/package.json +2 -1
- package/src/crystal/core/cellAtoms.ts +106 -0
- package/src/crystal/core/index.ts +2 -0
- package/src/crystal/core/molecules.ts +7 -44
- package/src/crystal3d/core/cellClip.ts +229 -0
- package/src/crystal3d/core/cellGeometry.ts +193 -0
- package/src/crystal3d/core/cellStack.ts +87 -0
- package/src/crystal3d/core/crystalView.ts +131 -0
- package/src/crystal3d/core/drawingSet.ts +71 -0
- package/src/crystal3d/core/elementDrawing.ts +147 -0
- package/src/crystal3d/core/elementExtent.ts +81 -0
- package/src/crystal3d/core/elementLabels.ts +130 -0
- package/src/crystal3d/core/elementShapes.ts +141 -0
- package/src/crystal3d/core/frame.ts +56 -0
- package/src/crystal3d/core/framing.ts +101 -0
- package/src/crystal3d/core/index.ts +134 -0
- package/src/crystal3d/core/labelText.ts +44 -0
- package/src/crystal3d/core/latticeBasis.ts +110 -0
- package/src/crystal3d/core/mat3.ts +163 -0
- package/src/crystal3d/core/operationMatrix.ts +255 -0
- package/src/crystal3d/core/orientation.ts +229 -0
- package/src/crystal3d/core/palette.ts +43 -0
- package/src/crystal3d/core/primitives.ts +183 -0
- package/src/crystal3d/core/structureText.ts +43 -0
- package/src/crystal3d/core/supercell.ts +40 -0
- package/src/crystal3d/core/types.ts +186 -0
- package/src/crystal3d/core/vec3.ts +127 -0
- package/src/crystal3d/ui/CrystalCanvas3D.tsx +393 -0
- package/src/crystal3d/ui/CrystalStructureView.tsx +153 -0
- package/src/crystal3d/ui/CrystalStructureViewer.tsx +39 -0
- package/src/crystal3d/ui/CrystalViewControls.tsx +129 -0
- package/src/crystal3d/ui/CrystalViewer3D.tsx +183 -0
- package/src/crystal3d/ui/crystalScene.ts +106 -0
- package/src/crystal3d/ui/crystalStructureViewerProps.ts +54 -0
- package/src/crystal3d/ui/index.ts +20 -0
- package/src/crystal3d/ui/useCrystalCaption.ts +38 -0
- package/src/crystal3d/viewer/animate.ts +113 -0
- package/src/crystal3d/viewer/camera.ts +139 -0
- package/src/crystal3d/viewer/index.ts +13 -0
- package/src/crystal3d/viewer/layerRegistry.ts +47 -0
- package/src/crystal3d/viewer/meshPrimitives.ts +102 -0
- package/src/crystal3d/viewer/plugin.ts +258 -0
- package/src/crystal3d/viewer/renderCell.ts +98 -0
- package/src/crystal3d/viewer/renderElements.ts +121 -0
- package/src/crystal3d/viewer/renderStructure.ts +209 -0
- package/src/crystal3d/viewer/sceneParts.ts +119 -0
- package/src/crystal3d/viewer/shapeLayer.ts +108 -0
- package/src/crystal3d/viewer/textLayer.ts +85 -0
- package/src/crystal3d/viewer/viewer.ts +223 -0
- package/src/crystal3d.ts +12 -0
- package/src/download/core/croppedMarkup.ts +16 -42
- package/src/download/core/dataUrl.ts +59 -0
- package/src/download/core/index.ts +3 -0
- package/src/download/core/svgMarkup.ts +113 -0
- package/src/drawing/ui/movingFigure.ts +4 -28
- package/src/locales/de.json +26 -1
- package/src/locales/en.json +26 -1
- package/src/locales/es.json +26 -1
- package/src/locales/fr.json +26 -1
- package/src/locales/it.json +26 -1
- package/src/molecule3d/ui/MoleculeCanvas3D.tsx +45 -71
- package/src/molstar/bonds/bondRule.ts +34 -0
- package/src/molstar/bonds/index.ts +9 -0
- package/src/molstar/ui/MolstarToolbar.tsx +103 -0
- package/src/molstar/ui/index.ts +14 -0
- package/src/molstar/ui/useMolstarTools.ts +98 -0
- package/styles/chrome.css +90 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framing.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,OAAO,SAAI,GACV,WAAW,CAyBb;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,GAAG,WAAW,CAkBzE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,SAAS,aAAa,EAAE,EACpC,OAAO,SAAI,GACV,WAAW,CAMb"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How much room the scene takes, so the camera can frame it.
|
|
3
|
+
*
|
|
4
|
+
* molstar measures a representation's bounding sphere with the largest ball it
|
|
5
|
+
* could ever draw added on, which on a molecule of a dozen atoms is about two
|
|
6
|
+
* ångström of empty frame — the difference between a model that fills the view
|
|
7
|
+
* and one that fills a quarter of it. The atoms are here, so they are measured
|
|
8
|
+
* here.
|
|
9
|
+
*/
|
|
10
|
+
import { primitivePoints } from "./primitives.js";
|
|
11
|
+
/**
|
|
12
|
+
* The smallest ball about the centroid that holds every point.
|
|
13
|
+
* @param points - What has to fit; an empty list gives a point at the origin.
|
|
14
|
+
* @param padding - Extra radius, ångström, for whatever is drawn around them.
|
|
15
|
+
* @returns The ball.
|
|
16
|
+
*/
|
|
17
|
+
export function boundingSphereOf(points, padding = 0) {
|
|
18
|
+
if (points.length === 0)
|
|
19
|
+
return { centre: [0, 0, 0], radius: padding };
|
|
20
|
+
let sumX = 0;
|
|
21
|
+
let sumY = 0;
|
|
22
|
+
let sumZ = 0;
|
|
23
|
+
for (const point of points) {
|
|
24
|
+
sumX += point[0];
|
|
25
|
+
sumY += point[1];
|
|
26
|
+
sumZ += point[2];
|
|
27
|
+
}
|
|
28
|
+
const centre = [
|
|
29
|
+
sumX / points.length,
|
|
30
|
+
sumY / points.length,
|
|
31
|
+
sumZ / points.length,
|
|
32
|
+
];
|
|
33
|
+
let radius = 0;
|
|
34
|
+
for (const point of points) {
|
|
35
|
+
const distance = Math.hypot(point[0] - centre[0], point[1] - centre[1], point[2] - centre[2]);
|
|
36
|
+
if (distance > radius)
|
|
37
|
+
radius = distance;
|
|
38
|
+
}
|
|
39
|
+
return { centre, radius: radius + padding };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* One ball holding several — the atoms, the cell and the drawn elements at once.
|
|
43
|
+
* @param spheres - What has to fit; an empty list gives a point at the origin.
|
|
44
|
+
* @returns A ball containing every one of them. It is not the smallest such
|
|
45
|
+
* ball, which is a harder problem than framing a scene deserves, but it never
|
|
46
|
+
* leaves anything outside.
|
|
47
|
+
*/
|
|
48
|
+
export function unionSpheres(spheres) {
|
|
49
|
+
if (spheres.length === 0)
|
|
50
|
+
return { centre: [0, 0, 0], radius: 0 };
|
|
51
|
+
const first = spheres[0];
|
|
52
|
+
if (spheres.length === 1 && first !== undefined)
|
|
53
|
+
return first;
|
|
54
|
+
const centres = [];
|
|
55
|
+
for (const sphere of spheres)
|
|
56
|
+
centres.push(sphere.centre);
|
|
57
|
+
const { centre } = boundingSphereOf(centres);
|
|
58
|
+
let radius = 0;
|
|
59
|
+
for (const sphere of spheres) {
|
|
60
|
+
const reach = Math.hypot(sphere.centre[0] - centre[0], sphere.centre[1] - centre[1], sphere.centre[2] - centre[2]) + sphere.radius;
|
|
61
|
+
if (reach > radius)
|
|
62
|
+
radius = reach;
|
|
63
|
+
}
|
|
64
|
+
return { centre, radius };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* How far a set of drawn shapes reaches.
|
|
68
|
+
* @param primitives - The shapes.
|
|
69
|
+
* @param padding - Extra radius, ångström.
|
|
70
|
+
* @returns A ball holding them all.
|
|
71
|
+
*/
|
|
72
|
+
export function primitivesExtent(primitives, padding = 0) {
|
|
73
|
+
const points = [];
|
|
74
|
+
for (const primitive of primitives) {
|
|
75
|
+
points.push(...primitivePoints(primitive));
|
|
76
|
+
}
|
|
77
|
+
return boundingSphereOf(points, padding);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=framing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framing.js","sourceRoot":"","sources":["../../../src/crystal3d/core/framing.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAWlD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAyB,EACzB,OAAO,GAAG,CAAC;IAEX,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IACvE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAW;QACrB,IAAI,GAAG,MAAM,CAAC,MAAM;QACpB,IAAI,GAAG,MAAM,CAAC,MAAM;QACpB,IAAI,GAAG,MAAM,CAAC,MAAM;KACrB,CAAC;IACF,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CACzB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CACrB,CAAC;QACF,IAAI,QAAQ,GAAG,M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,gBAAgB,CAC9B,UAAoC,EACpC,OAAO,GAAG,CAAC;IAEX,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The half of the crystal viewer that has never heard of molstar.
|
|
3
|
+
*
|
|
4
|
+
* A page that only *builds* a scene — repeats a cell, works out which symmetry
|
|
5
|
+
* elements to draw, frames what it has — imports this and pays nothing: the
|
|
6
|
+
* molstar chunk hangs off `viewer/`, which is reached through the lazy canvas
|
|
7
|
+
* and nowhere else.
|
|
8
|
+
*/
|
|
9
|
+
export type { CellSegment } from './cellClip.ts';
|
|
10
|
+
export { cellSection, clipLineToCell } from './cellClip.ts';
|
|
11
|
+
export type { CellEdge } from './cellGeometry.ts';
|
|
12
|
+
export { cellAxes, cellAxisLabelPoints, cellEdges, cellPoint, clampRepeat, latticeShifts, } from './cellGeometry.ts';
|
|
13
|
+
export { mergeDrawings, sameDrawings, withoutDrawings } from './drawingSet.ts';
|
|
14
|
+
export type { ElementGroup } from './elementDrawing.ts';
|
|
15
|
+
export { drawingPrimitives, elementGroups } from './elementDrawing.ts';
|
|
16
|
+
export { drawingLabels } from './elementLabels.ts';
|
|
17
|
+
export { plainName } from './labelText.ts';
|
|
18
|
+
export type { PlaneFrame } from './frame.ts';
|
|
19
|
+
export { perpendicularTo, planeFrame } from './frame.ts';
|
|
20
|
+
export type { SceneSphere } from './framing.ts';
|
|
21
|
+
export { boundingSphereOf, primitivesExtent, unionSpheres } from './framing.ts';
|
|
22
|
+
export type { OrientedScene, ViewOrientation } from './orientation.ts';
|
|
23
|
+
export { principalAxisOf, sceneOrientation, threeQuarterView, } from './orientation.ts';
|
|
24
|
+
export type { Matrix4 } from './operationMatrix.ts';
|
|
25
|
+
export { IDENTITY_MATRIX4, ROTATION_PHASE, operationAt, operationIsRigid, operationMatrix, } from './operationMatrix.ts';
|
|
26
|
+
export { CELL_COLOUR, ELEMENT_COLOURS, LABEL_COLOUR, drawingColour, } from './palette.ts';
|
|
27
|
+
export type { ElementStyle, MeshPrimitive, ResolvedElementStyle, TextItem, } from './primitives.ts';
|
|
28
|
+
export { DEFAULT_ELEMENT_STYLE, primitivePoints, resolveElementStyle, } from './primitives.ts';
|
|
29
|
+
export { toXyzText } from './structureText.ts';
|
|
30
|
+
export { supercellAtoms } from './supercell.ts';
|
|
31
|
+
export type { CellRepeat, DrawingBase, GlideDrawing, InversionDrawing, MirrorDrawing, Point3, RotationDrawing, RotoinversionDrawing, ScrewDrawing, SymmetryDrawing, SymmetryDrawingKind, UnitCell, ViewerAtom, ViewerOperation, } from './types.ts';
|
|
32
|
+
export type { Mat3 } from './mat3.ts';
|
|
33
|
+
export { IDENTITY_MATRIX, INVERSION_MATRIX, applyMatrix, matrixDeterminant, matrixDistance, matrixTrace, multiplyMatrices, reflectionMatrix, rotationMatrix, scaleMatrix, transposeMatrix, } from './mat3.ts';
|
|
34
|
+
export type { Vec3 } from './vec3.ts';
|
|
35
|
+
export { addVectors, collinear, crossProduct, dotProduct, normalizeVector, sameAxis, scaleVector, subtractVectors, vectorDistance, vectorNorm, } from './vec3.ts';
|
|
36
|
+
export { normalToCartesian, normalToFractional, toCartesian, toFractional, } from './latticeBasis.ts';
|
|
37
|
+
export { axisRod, faceOf } from './elementExtent.ts';
|
|
38
|
+
export type { AxisRod } from './elementExtent.ts';
|
|
39
|
+
export { SUPERCELL_ATOM_CAP, largestRepeatThatFits, repeatCell, repeatedAtomCount, } from './cellStack.ts';
|
|
40
|
+
export type { CrystalBonds, CrystalPacking, CrystalView, CrystalViewOptions, CrystalViewSettings, } from './crystalView.ts';
|
|
41
|
+
export { CELL_COUNT_RANGE, CRYSTAL_BONDS, CRYSTAL_PACKINGS, DEFAULT_CRYSTAL_VIEW_SETTINGS, crystalView, } from './crystalView.ts';
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC/E,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,OAAO,EAAE,MAAM,sBAA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Y,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,UAAU,EACV,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,6BAA6B,EAC7B,WAAW,GACZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The half of the crystal viewer that has never heard of molstar.
|
|
3
|
+
*
|
|
4
|
+
* A page that only *builds* a scene — repeats a cell, works out which symmetry
|
|
5
|
+
* elements to draw, frames what it has — imports this and pays nothing: the
|
|
6
|
+
* molstar chunk hangs off `viewer/`, which is reached through the lazy canvas
|
|
7
|
+
* and nowhere else.
|
|
8
|
+
*/
|
|
9
|
+
export { cellSection, clipLineToCell } from "./cellClip.js";
|
|
10
|
+
export { cellAxes, cellAxisLabelPoints, cellEdges, cellPoint, clampRepeat, latticeShifts, } from "./cellGeometry.js";
|
|
11
|
+
export { mergeDrawings, sameDrawings, withoutDrawings } from "./drawingSet.js";
|
|
12
|
+
export { drawingPrimitives, elementGroups } from "./elementDrawing.js";
|
|
13
|
+
export { drawingLabels } from "./elementLabels.js";
|
|
14
|
+
export { plainName } from "./labelText.js";
|
|
15
|
+
export { perpendicularTo, planeFrame } from "./frame.js";
|
|
16
|
+
export { boundingSphereOf, primitivesExtent, unionSpheres } from "./framing.js";
|
|
17
|
+
export { principalAxisOf, sceneOrientation, threeQuarterView, } from "./orientation.js";
|
|
18
|
+
export { IDENTITY_MATRIX4, ROTATION_PHASE, operationAt, operationIsRigid, operationMatrix, } from "./operationMatrix.js";
|
|
19
|
+
export { CELL_COLOUR, ELEMENT_COLOURS, LABEL_COLOUR, drawingColour, } from "./palette.js";
|
|
20
|
+
export { DEFAULT_ELEMENT_STYLE, primitivePoints, resolveElementStyle, } from "./primitives.js";
|
|
21
|
+
export { toXyzText } from "./structureText.js";
|
|
22
|
+
export { supercellAtoms } from "./supercell.js";
|
|
23
|
+
export { IDENTITY_MATRIX, INVERSION_MATRIX, applyMatrix, matrixDeterminant, matrixDistance, matrixTrace, multiplyMatrices, reflectionMatrix, rotationMatrix, scaleMatrix, transposeMatrix, } from "./mat3.js";
|
|
24
|
+
export { addVectors, collinear, crossProduct, dotProduct, normalizeVector, sameAxis, scaleVector, subtractVectors, vectorDistance, vectorNorm, } from "./vec3.js";
|
|
25
|
+
export { normalToCartesian, normalToFractional, toCartesian, toFractional, } from "./latticeBasis.js";
|
|
26
|
+
export { axisRod, faceOf } from "./elementExtent.js";
|
|
27
|
+
export { SUPERCELL_ATOM_CAP, largestRepeatThatFits, repeatCell, repeatedAtomCount, } from "./cellStack.js";
|
|
28
|
+
export { CELL_COUNT_RANGE, CRYSTAL_BONDS, CRYSTAL_PACKINGS, DEFAULT_CRYSTAL_VIEW_SETTINGS, crystalView, } from "./crystalView.js";
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/crystal3d/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,WAAW,EACX,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAA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WAAW,GACZ,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An operation's name as a canvas can draw it.
|
|
3
|
+
*
|
|
4
|
+
* The site holds a raised part behind a caret — `C3^2`, `σv^′`, `C2^″(1)` —
|
|
5
|
+
* because the panels beside the view typeset what follows it above the line.
|
|
6
|
+
* A molstar label is plain text and typesets nothing, so the caret is drawn as
|
|
7
|
+
* itself: benzene's two-folds read `C2^′(1)` on the canvas while the list next
|
|
8
|
+
* to them reads C₂′(1). Raising the characters here is what makes the two
|
|
9
|
+
* agree, and it is the last step before the name leaves for the scene — the
|
|
10
|
+
* names the rest of the site matches on are untouched.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Raise what a caret marks, and drop the caret.
|
|
14
|
+
* @param label - The name as the site holds it.
|
|
15
|
+
* @returns The same name with each raised run set above the line: `C3²`,
|
|
16
|
+
* `σv′`, `C2″(1)`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function plainName(label: string): string;
|
|
19
|
+
//# sourceMappingURL=labelText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelText.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/labelText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An operation's name as a canvas can draw it.
|
|
3
|
+
*
|
|
4
|
+
* The site holds a raised part behind a caret — `C3^2`, `σv^′`, `C2^″(1)` —
|
|
5
|
+
* because the panels beside the view typeset what follows it above the line.
|
|
6
|
+
* A molstar label is plain text and typesets nothing, so the caret is drawn as
|
|
7
|
+
* itself: benzene's two-folds read `C2^′(1)` on the canvas while the list next
|
|
8
|
+
* to them reads C₂′(1). Raising the characters here is what makes the two
|
|
9
|
+
* agree, and it is the last step before the name leaves for the scene — the
|
|
10
|
+
* names the rest of the site matches on are untouched.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Raise what a caret marks, and drop the caret.
|
|
14
|
+
* @param label - The name as the site holds it.
|
|
15
|
+
* @returns The same name with each raised run set above the line: `C3²`,
|
|
16
|
+
* `σv′`, `C2″(1)`.
|
|
17
|
+
*/
|
|
18
|
+
export function plainName(label) {
|
|
19
|
+
return label.replaceAll(RAISED, (_match, raised) => raise(raised));
|
|
20
|
+
}
|
|
21
|
+
/** A caret and the run it raises: digits, and the primes already drawn high. */
|
|
22
|
+
const RAISED = /\^(?<raised>[\d′″]+)/gu;
|
|
23
|
+
/** The digits, above the line. A prime is already a raised glyph. */
|
|
24
|
+
const ABOVE = {
|
|
25
|
+
0: '⁰',
|
|
26
|
+
1: '¹',
|
|
27
|
+
2: '²',
|
|
28
|
+
3: '³',
|
|
29
|
+
4: '⁴',
|
|
30
|
+
5: '⁵',
|
|
31
|
+
6: '⁶',
|
|
32
|
+
7: '⁷',
|
|
33
|
+
8: '⁸',
|
|
34
|
+
9: '⁹',
|
|
35
|
+
};
|
|
36
|
+
function raise(run) {
|
|
37
|
+
let raised = '';
|
|
38
|
+
for (const character of run)
|
|
39
|
+
raised += ABOVE[character] ?? character;
|
|
40
|
+
return raised;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=labelText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelText.js","sourceRoot":"","sources":["../../../src/crystal3d/core/labelText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAc,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,gFAAgF;AAChF,MAAM,MAAM,GAAG,wBAAwB,CAAC;AAExC,qEAAqE;AACrE,MAAM,KAAK,GAA2B;IACpC,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;IACN,CAAC,EAAE,GAAG;CACP,CAAC;AAEF,SAAS,KAAK,CAAC,GAAW;IACxB,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,SAAS,IAAI,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC;IACrE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a vector crosses between the crystal basis and Cartesian ångström.
|
|
3
|
+
*
|
|
4
|
+
* There are four ways across and they are not interchangeable. A direction
|
|
5
|
+
* `[uvw]` is a direct-space vector and goes through `M`; a normal `(hkl)` is a
|
|
6
|
+
* reciprocal-space one and goes through `(M⁻¹)ᵀ`. The two agree in an
|
|
7
|
+
* orthogonal cell, so swapping them is only ever caught on a monoclinic or
|
|
8
|
+
* triclinic structure, with the mirror drawn at the wrong tilt.
|
|
9
|
+
*
|
|
10
|
+
* Naming them all together, once, is what stops the third caller writing a
|
|
11
|
+
* fifth matrix loop and picking the wrong transpose in it.
|
|
12
|
+
*/
|
|
13
|
+
import type { Lattice } from '../../crystal/core/symmetry/lattice.ts';
|
|
14
|
+
import type { Vec3 } from './vec3.ts';
|
|
15
|
+
/**
|
|
16
|
+
* A fractional point or direction, in Cartesian ångström — `M v`.
|
|
17
|
+
* @param lattice - The cell it is read in.
|
|
18
|
+
* @param point - Its fractional coordinates.
|
|
19
|
+
* @returns The same point, Cartesian ångström.
|
|
20
|
+
*/
|
|
21
|
+
export declare function toCartesian(lattice: Lattice, point: readonly number[]): Vec3;
|
|
22
|
+
/**
|
|
23
|
+
* A Cartesian point or direction, in cell fractions — `M⁻¹ v`.
|
|
24
|
+
* @param lattice - The cell it is read in.
|
|
25
|
+
* @param point - Its Cartesian coordinates, ångström.
|
|
26
|
+
* @returns The same point, in fractions of the cell edges.
|
|
27
|
+
*/
|
|
28
|
+
export declare function toFractional(lattice: Lattice, point: readonly number[]): Vec3;
|
|
29
|
+
/**
|
|
30
|
+
* A normal `(hkl)` written in the crystal basis, as a Cartesian direction —
|
|
31
|
+
* `(M⁻¹)ᵀ v`.
|
|
32
|
+
* @param lattice - The cell it is read in.
|
|
33
|
+
* @param normal - The reciprocal-space normal `(hkl)`.
|
|
34
|
+
* @returns A Cartesian vector at right angles to the plane itself.
|
|
35
|
+
*/
|
|
36
|
+
export declare function normalToCartesian(lattice: Lattice, normal: readonly number[]): Vec3;
|
|
37
|
+
/**
|
|
38
|
+
* A Cartesian normal, as the covector that measures heights above the plane in
|
|
39
|
+
* cell fractions — `Mᵀ v`.
|
|
40
|
+
*
|
|
41
|
+
* `n · (x − p)` in ångström is that covector against `x − p` in fractions, so a
|
|
42
|
+
* height can be taken without leaving fractional coordinates. It is the inverse
|
|
43
|
+
* transpose of {@link normalToCartesian}, not its inverse.
|
|
44
|
+
* @param lattice - The cell it is read in.
|
|
45
|
+
* @param normal - A Cartesian plane normal.
|
|
46
|
+
* @returns The covector to dot fractional offsets against.
|
|
47
|
+
*/
|
|
48
|
+
export declare function normalToFractional(lattice: Lattice, normal: readonly number[]): Vec3;
|
|
49
|
+
//# sourceMappingURL=latticeBasis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latticeBasis.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/latticeBasis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,IAAI,CAEN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,IAAI,CAEN"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a vector crosses between the crystal basis and Cartesian ångström.
|
|
3
|
+
*
|
|
4
|
+
* There are four ways across and they are not interchangeable. A direction
|
|
5
|
+
* `[uvw]` is a direct-space vector and goes through `M`; a normal `(hkl)` is a
|
|
6
|
+
* reciprocal-space one and goes through `(M⁻¹)ᵀ`. The two agree in an
|
|
7
|
+
* orthogonal cell, so swapping them is only ever caught on a monoclinic or
|
|
8
|
+
* triclinic structure, with the mirror drawn at the wrong tilt.
|
|
9
|
+
*
|
|
10
|
+
* Naming them all together, once, is what stops the third caller writing a
|
|
11
|
+
* fifth matrix loop and picking the wrong transpose in it.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* A fractional point or direction, in Cartesian ångström — `M v`.
|
|
15
|
+
* @param lattice - The cell it is read in.
|
|
16
|
+
* @param point - Its fractional coordinates.
|
|
17
|
+
* @returns The same point, Cartesian ångström.
|
|
18
|
+
*/
|
|
19
|
+
export function toCartesian(lattice, point) {
|
|
20
|
+
return applyMatrix(lattice.cartesian, point);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A Cartesian point or direction, in cell fractions — `M⁻¹ v`.
|
|
24
|
+
* @param lattice - The cell it is read in.
|
|
25
|
+
* @param point - Its Cartesian coordinates, ångström.
|
|
26
|
+
* @returns The same point, in fractions of the cell edges.
|
|
27
|
+
*/
|
|
28
|
+
export function toFractional(lattice, point) {
|
|
29
|
+
return applyMatrix(lattice.fractional, point);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A normal `(hkl)` written in the crystal basis, as a Cartesian direction —
|
|
33
|
+
* `(M⁻¹)ᵀ v`.
|
|
34
|
+
* @param lattice - The cell it is read in.
|
|
35
|
+
* @param normal - The reciprocal-space normal `(hkl)`.
|
|
36
|
+
* @returns A Cartesian vector at right angles to the plane itself.
|
|
37
|
+
*/
|
|
38
|
+
export function normalToCartesian(lattice, normal) {
|
|
39
|
+
return applyTransposed(lattice.fractional, normal);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A Cartesian normal, as the covector that measures heights above the plane in
|
|
43
|
+
* cell fractions — `Mᵀ v`.
|
|
44
|
+
*
|
|
45
|
+
* `n · (x − p)` in ångström is that covector against `x − p` in fractions, so a
|
|
46
|
+
* height can be taken without leaving fractional coordinates. It is the inverse
|
|
47
|
+
* transpose of {@link normalToCartesian}, not its inverse.
|
|
48
|
+
* @param lattice - The cell it is read in.
|
|
49
|
+
* @param normal - A Cartesian plane normal.
|
|
50
|
+
* @returns The covector to dot fractional offsets against.
|
|
51
|
+
*/
|
|
52
|
+
export function normalToFractional(lattice, normal) {
|
|
53
|
+
return applyTransposed(lattice.cartesian, normal);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `A v`.
|
|
57
|
+
* @param matrix - The 3×3 matrix, as its rows.
|
|
58
|
+
* @param point - The vector it is applied to.
|
|
59
|
+
* @returns The image.
|
|
60
|
+
*/
|
|
61
|
+
function applyMatrix(matrix, point) {
|
|
62
|
+
const image = [0, 0, 0];
|
|
63
|
+
for (let i = 0; i < 3; i++) {
|
|
64
|
+
let sum = 0;
|
|
65
|
+
for (let j = 0; j < 3; j++) {
|
|
66
|
+
sum += (matrix[i]?.[j] ?? 0) * (point[j] ?? 0);
|
|
67
|
+
}
|
|
68
|
+
image[i] = sum;
|
|
69
|
+
}
|
|
70
|
+
return [image[0] ?? 0, image[1] ?? 0, image[2] ?? 0];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `Aᵀ v`, which is `A v` with the two indices swapped.
|
|
74
|
+
* @param matrix - The 3×3 matrix, as its rows.
|
|
75
|
+
* @param point - The vector its transpose is applied to.
|
|
76
|
+
* @returns The image.
|
|
77
|
+
*/
|
|
78
|
+
function applyTransposed(matrix, point) {
|
|
79
|
+
const image = [0, 0, 0];
|
|
80
|
+
for (let i = 0; i < 3; i++) {
|
|
81
|
+
let sum = 0;
|
|
82
|
+
for (let j = 0; j < 3; j++) {
|
|
83
|
+
sum += (matrix[j]?.[i] ?? 0) * (point[j] ?? 0);
|
|
84
|
+
}
|
|
85
|
+
image[i] = sum;
|
|
86
|
+
}
|
|
87
|
+
return [image[0] ?? 0, image[1] ?? 0, image[2] ?? 0];
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=latticeBasis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latticeBasis.js","sourceRoot":"","sources":["../../../src/crystal3d/core/latticeBasis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,KAAwB;IACpE,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,KAAwB;IACrE,OAAO,WAAW,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B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,CAAC,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3B,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Vec3 } from './vec3.ts';
|
|
2
|
+
/** A 3×3 Cartesian matrix, as its three rows. */
|
|
3
|
+
export type Mat3 = readonly [Vec3, Vec3, Vec3];
|
|
4
|
+
/** The identity. */
|
|
5
|
+
export declare const IDENTITY_MATRIX: Mat3;
|
|
6
|
+
/** The inversion, −I. */
|
|
7
|
+
export declare const INVERSION_MATRIX: Mat3;
|
|
8
|
+
/**
|
|
9
|
+
* a · b, so that `applyMatrix(multiplyMatrices(a, b), v)` is a applied after b.
|
|
10
|
+
* @param a - The matrix applied last.
|
|
11
|
+
* @param b - The matrix applied first.
|
|
12
|
+
* @returns The product.
|
|
13
|
+
*/
|
|
14
|
+
export declare function multiplyMatrices(a: Mat3, b: Mat3): Mat3;
|
|
15
|
+
/**
|
|
16
|
+
* M · v.
|
|
17
|
+
* @param matrix - The matrix.
|
|
18
|
+
* @param vector - The vector it is applied to.
|
|
19
|
+
* @returns The transformed vector.
|
|
20
|
+
*/
|
|
21
|
+
export declare function applyMatrix(matrix: Mat3, vector: Vec3): Vec3;
|
|
22
|
+
/**
|
|
23
|
+
* Mᵀ, which is M⁻¹ for the orthogonal matrix of any symmetry operation.
|
|
24
|
+
* @param matrix - The matrix.
|
|
25
|
+
* @returns Its transpose.
|
|
26
|
+
*/
|
|
27
|
+
export declare function transposeMatrix(matrix: Mat3): Mat3;
|
|
28
|
+
/**
|
|
29
|
+
* det M: +1 for a proper operation, −1 for an improper one.
|
|
30
|
+
* @param matrix - The matrix.
|
|
31
|
+
* @returns Its determinant.
|
|
32
|
+
*/
|
|
33
|
+
export declare function matrixDeterminant(matrix: Mat3): number;
|
|
34
|
+
/**
|
|
35
|
+
* tr M, which is `±1 + 2cos θ` for a symmetry operation.
|
|
36
|
+
* @param matrix - The matrix.
|
|
37
|
+
* @returns Its trace.
|
|
38
|
+
*/
|
|
39
|
+
export declare function matrixTrace(matrix: Mat3): number;
|
|
40
|
+
/**
|
|
41
|
+
* M · factor.
|
|
42
|
+
* @param matrix - The matrix.
|
|
43
|
+
* @param factor - The scalar every entry is multiplied by.
|
|
44
|
+
* @returns The scaled matrix.
|
|
45
|
+
*/
|
|
46
|
+
export declare function scaleMatrix(matrix: Mat3, factor: number): Mat3;
|
|
47
|
+
/**
|
|
48
|
+
* ‖a − b‖_F, the distance two operation matrices are compared with.
|
|
49
|
+
* @param a - The first matrix.
|
|
50
|
+
* @param b - The second matrix.
|
|
51
|
+
* @returns The Frobenius norm of their difference.
|
|
52
|
+
*/
|
|
53
|
+
export declare function matrixDistance(a: Mat3, b: Mat3): number;
|
|
54
|
+
/**
|
|
55
|
+
* The rotation by `angle` radians about the unit vector `axis`, right-handed,
|
|
56
|
+
* from Rodrigues' formula `R = cos θ I + sin θ [n̂]ₓ + (1 − cos θ) n̂ n̂ᵀ`.
|
|
57
|
+
* @param axis - The unit vector rotated about.
|
|
58
|
+
* @param angle - The angle, in radians.
|
|
59
|
+
* @returns The rotation matrix.
|
|
60
|
+
*/
|
|
61
|
+
export declare function rotationMatrix(axis: Vec3, angle: number): Mat3;
|
|
62
|
+
/**
|
|
63
|
+
* The reflection `I − 2 n̂ n̂ᵀ` in the plane through the origin with unit normal `normal`.
|
|
64
|
+
* @param normal - The unit normal of the mirror plane.
|
|
65
|
+
* @returns The reflection matrix.
|
|
66
|
+
*/
|
|
67
|
+
export declare function reflectionMatrix(normal: Vec3): Mat3;
|
|
68
|
+
//# sourceMappingURL=mat3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mat3.d.ts","sourceRoot":"","sources":["../../../src/crystal3d/core/mat3.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,iDAAiD;AACjD,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE/C,oBAAoB;AACpB,eAAO,MAAM,eAAe,EAAE,IAI7B,CAAC;AAEF,yBAAyB;AACzB,eAAO,MAAM,gBAAgB,EAAE,IAI9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAEvD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,CAY5D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAMlD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAMtD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAEhD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAM9D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAWvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAU9D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAOnD"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/** The identity. */
|
|
2
|
+
export const IDENTITY_MATRIX = [
|
|
3
|
+
[1, 0, 0],
|
|
4
|
+
[0, 1, 0],
|
|
5
|
+
[0, 0, 1],
|
|
6
|
+
];
|
|
7
|
+
/** The inversion, −I. */
|
|
8
|
+
export const INVERSION_MATRIX = [
|
|
9
|
+
[-1, 0, 0],
|
|
10
|
+
[0, -1, 0],
|
|
11
|
+
[0, 0, -1],
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* a · b, so that `applyMatrix(multiplyMatrices(a, b), v)` is a applied after b.
|
|
15
|
+
* @param a - The matrix applied last.
|
|
16
|
+
* @param b - The matrix applied first.
|
|
17
|
+
* @returns The product.
|
|
18
|
+
*/
|
|
19
|
+
export function multiplyMatrices(a, b) {
|
|
20
|
+
return [multiplyRow(a[0], b), multiplyRow(a[1], b), multiplyRow(a[2], b)];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* M · v.
|
|
24
|
+
* @param matrix - The matrix.
|
|
25
|
+
* @param vector - The vector it is applied to.
|
|
26
|
+
* @returns The transformed vector.
|
|
27
|
+
*/
|
|
28
|
+
export function applyMatrix(matrix, vector) {
|
|
29
|
+
return [
|
|
30
|
+
matrix[0][0] * vector[0] +
|
|
31
|
+
matrix[0][1] * vector[1] +
|
|
32
|
+
matrix[0][2] * vector[2],
|
|
33
|
+
matrix[1][0] * vector[0] +
|
|
34
|
+
matrix[1][1] * vector[1] +
|
|
35
|
+
matrix[1][2] * vector[2],
|
|
36
|
+
matrix[2][0] * vector[0] +
|
|
37
|
+
matrix[2][1] * vector[1] +
|
|
38
|
+
matrix[2][2] * vector[2],
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Mᵀ, which is M⁻¹ for the orthogonal matrix of any symmetry operation.
|
|
43
|
+
* @param matrix - The matrix.
|
|
44
|
+
* @returns Its transpose.
|
|
45
|
+
*/
|
|
46
|
+
export function transposeMatrix(matrix) {
|
|
47
|
+
return [
|
|
48
|
+
[matrix[0][0], matrix[1][0], matrix[2][0]],
|
|
49
|
+
[matrix[0][1], matrix[1][1], matrix[2][1]],
|
|
50
|
+
[matrix[0][2], matrix[1][2], matrix[2][2]],
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* det M: +1 for a proper operation, −1 for an improper one.
|
|
55
|
+
* @param matrix - The matrix.
|
|
56
|
+
* @returns Its determinant.
|
|
57
|
+
*/
|
|
58
|
+
export function matrixDeterminant(matrix) {
|
|
59
|
+
return (matrix[0][0] * (matrix[1][1] * matrix[2][2] - matrix[1][2] * matrix[2][1]) -
|
|
60
|
+
matrix[0][1] * (matrix[1][0] * matrix[2][2] - matrix[1][2] * matrix[2][0]) +
|
|
61
|
+
matrix[0][2] * (matrix[1][0] * matrix[2][1] - matrix[1][1] * matrix[2][0]));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* tr M, which is `±1 + 2cos θ` for a symmetry operation.
|
|
65
|
+
* @param matrix - The matrix.
|
|
66
|
+
* @returns Its trace.
|
|
67
|
+
*/
|
|
68
|
+
export function matrixTrace(matrix) {
|
|
69
|
+
return matrix[0][0] + matrix[1][1] + matrix[2][2];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* M · factor.
|
|
73
|
+
* @param matrix - The matrix.
|
|
74
|
+
* @param factor - The scalar every entry is multiplied by.
|
|
75
|
+
* @returns The scaled matrix.
|
|
76
|
+
*/
|
|
77
|
+
export function scaleMatrix(matrix, factor) {
|
|
78
|
+
return [
|
|
79
|
+
[matrix[0][0] * factor, matrix[0][1] * factor, matrix[0][2] * factor],
|
|
80
|
+
[matrix[1][0] * factor, matrix[1][1] * factor, matrix[1][2] * factor],
|
|
81
|
+
[matrix[2][0] * factor, matrix[2][1] * factor, matrix[2][2] * factor],
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* ‖a − b‖_F, the distance two operation matrices are compared with.
|
|
86
|
+
* @param a - The first matrix.
|
|
87
|
+
* @param b - The second matrix.
|
|
88
|
+
* @returns The Frobenius norm of their difference.
|
|
89
|
+
*/
|
|
90
|
+
export function matrixDistance(a, b) {
|
|
91
|
+
let sum = 0;
|
|
92
|
+
for (let i = 0; i < 3; i++) {
|
|
93
|
+
const rowA = a[i];
|
|
94
|
+
const rowB = b[i];
|
|
95
|
+
for (let j = 0; j < 3; j++) {
|
|
96
|
+
const difference = rowA[j] - rowB[j];
|
|
97
|
+
sum += difference * difference;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return Math.sqrt(sum);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The rotation by `angle` radians about the unit vector `axis`, right-handed,
|
|
104
|
+
* from Rodrigues' formula `R = cos θ I + sin θ [n̂]ₓ + (1 − cos θ) n̂ n̂ᵀ`.
|
|
105
|
+
* @param axis - The unit vector rotated about.
|
|
106
|
+
* @param angle - The angle, in radians.
|
|
107
|
+
* @returns The rotation matrix.
|
|
108
|
+
*/
|
|
109
|
+
export function rotationMatrix(axis, angle) {
|
|
110
|
+
const [x, y, z] = axis;
|
|
111
|
+
const c = Math.cos(angle);
|
|
112
|
+
const s = Math.sin(angle);
|
|
113
|
+
const t = 1 - c;
|
|
114
|
+
return [
|
|
115
|
+
[t * x * x + c, t * x * y - s * z, t * x * z + s * y],
|
|
116
|
+
[t * x * y + s * z, t * y * y + c, t * y * z - s * x],
|
|
117
|
+
[t * x * z - s * y, t * y * z + s * x, t * z * z + c],
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The reflection `I − 2 n̂ n̂ᵀ` in the plane through the origin with unit normal `normal`.
|
|
122
|
+
* @param normal - The unit normal of the mirror plane.
|
|
123
|
+
* @returns The reflection matrix.
|
|
124
|
+
*/
|
|
125
|
+
export function reflectionMatrix(normal) {
|
|
126
|
+
const [x, y, z] = normal;
|
|
127
|
+
return [
|
|
128
|
+
[1 - 2 * x * x, -2 * x * y, -2 * x * z],
|
|
129
|
+
[-2 * x * y, 1 - 2 * y * y, -2 * y * z],
|
|
130
|
+
[-2 * x * z, -2 * y * z, 1 - 2 * z * z],
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* One row of a · b.
|
|
135
|
+
* @param row - The row of a.
|
|
136
|
+
* @param b - The right-hand matrix.
|
|
137
|
+
* @returns That row of the product.
|
|
138
|
+
*/
|
|
139
|
+
function multiplyRow(row, b) {
|
|
140
|
+
return [
|
|
141
|
+
row[0] * b[0][0] + row[1] * b[1][0] + row[2] * b[2][0],
|
|
142
|
+
row[0] * b[0][1] + row[1] * b[1][1] + row[2] * b[2][1],
|
|
143
|
+
row[0] * b[0][2] + row[1] * b[1][2] + row[2] * b[2][2],
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=mat3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mat3.js","sourceRoot":"","sources":["../../../src/crystal3d/core/mat3.ts"],"names":[],"mappings":"AAKA,oBAAoB;AACpB,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACT,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,gBAAgB,GAAS;IACpC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACV,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACV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