-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replace iconify with HTML entities * extract Lattice.svelte from StructureScene * add 2 MP P1 structures * sort JSON structures by MP ID number * /structure demo make grid wider * fix tests + update deps * install-cmd: npm install --force * revert accidental line stage * only render Lattice if available
- Loading branch information
Showing
13 changed files
with
170 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<script lang="ts"> | ||
import { add, type Vector } from '$lib' | ||
import { T } from '@threlte/core' | ||
import { BufferGeometry, Vector3 } from 'three' | ||
export let matrix: [Vector, Vector, Vector] | ||
export let show_cell: 'surface' | 'wireframe' | null = `wireframe` | ||
// thickness of the wireframe lines that indicate the lattice's unit cell | ||
// due to limitations of OpenGL with WebGL renderer, on most platforms linewidth will be 1 regardless of set value | ||
// see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.wireframe | ||
export let cell_color: string = `white` | ||
export let cell_line_width: number = 1 | ||
// cell opacity | ||
export let cell_opacity: number | undefined = undefined | ||
// whether to show the lattice vectors | ||
export let show_vectors: boolean = true | ||
// lattice vector colors | ||
export let vector_colors: [string, string, string] = [`red`, `green`, `blue`] | ||
// lattice vector origin (all arrows start from this point) | ||
export let vector_origin: Vector = [-1, -1, -1] | ||
$: [vec_a, vec_b, vec_c] = matrix | ||
const origin = [0, 0, 0] | ||
$: points = [ | ||
origin, | ||
add(origin, vec_a), | ||
origin, | ||
add(origin, vec_b), | ||
origin, | ||
add(origin, vec_c), | ||
add(origin, vec_a), | ||
add(origin, vec_a, vec_b), | ||
add(origin, vec_a), | ||
add(origin, vec_a, vec_c), | ||
add(origin, vec_b), | ||
add(origin, vec_b, vec_a), | ||
add(origin, vec_b), | ||
add(origin, vec_b, vec_c), | ||
add(origin, vec_c), | ||
add(origin, vec_c, vec_a), | ||
add(origin, vec_c), | ||
add(origin, vec_c, vec_b), | ||
add(origin, vec_a, vec_b), | ||
add(origin, vec_a, vec_b, vec_c), | ||
add(origin, vec_a, vec_c), | ||
add(origin, vec_a, vec_b, vec_c), | ||
add(origin, vec_b, vec_c), | ||
add(origin, vec_a, vec_b, vec_c), | ||
] | ||
</script> | ||
|
||
{#if show_cell} | ||
<T.LineSegments | ||
geometry={new BufferGeometry().setFromPoints(points.map((p) => new Vector3(...p)))} | ||
> | ||
<T.LineBasicMaterial | ||
color={cell_color} | ||
opacity={cell_opacity} | ||
linewidth={cell_line_width} | ||
/> | ||
</T.LineSegments> | ||
{/if} | ||
|
||
{#if show_vectors} | ||
{#each matrix as vec, idx} | ||
{@const [x, y, z] = vec ?? []} | ||
<T.Group position={vector_origin}> | ||
<T.ArrowHelper | ||
args={[{ x, y, z }, { x: 0, y: 0, z: 0 }, 6, vector_colors[idx], 1, 1, 1]} | ||
/> | ||
</T.Group> | ||
{/each} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"@module": "pymatgen.core.structure", "@class": "Structure", "charge": 0, "lattice": {"matrix": [[4.538843, 0.0, 0.0], [0.013561999999999736, 6.980989, 0.0], [0.011766000000000597, 0.062471999999996426, 13.284895000000004]], "pbc": [true, true, true], "a": 4.538843, "b": 6.981002173468005, "c": 13.285047096287055, "alpha": 89.73047155796912, "beta": 89.94925556341678, "gamma": 89.88869136103648, "volume": 420.9400424559625}, "sites": [{"species": [{"element": "Ag", "oxidation_state": 1, "occu": 1}], "abc": [0.012024000000000035, 0.7900990000000001, 0.457361], "xyz": [0.07067168039600022, 5.544244684303, 6.075992862095002], "label": "Ag+", "properties": {}}, {"species": [{"element": "Ag", "oxidation_state": 1, "occu": 1}], "abc": [0.011587999999999932, 0.21110200000000012, 0.544301], "xyz": [0.06186332357399996, 1.5077043119499989, 7.230981633395003], "label": "Ag+", "properties": {}}, {"species": [{"element": "Ag", "oxidation_state": 1, "occu": 1}], "abc": [0.987252, 0.29174500000000003, 0.043733], "xyz": [4.485453037604, 2.039400723781, 0.5809883130350002], "label": "Ag+", "properties": {}}, {"species": [{"element": "Ag", "oxidation_state": 1, "occu": 1}], "abc": [0.987558, 0.7051530000000001, 0.949779], "xyz": [4.503109100094001, 4.9819999300049975, 12.617714288205004], "label": "Ag+", "properties": {}}, {"species": [{"element": "Hg", "oxidation_state": 2, "occu": 1}], "abc": [0.501077, 0.6275310000000001, 0.244061], "xyz": [2.285692031059, 4.396033986950999, 3.242324758595001], "label": "Hg2+", "properties": {}}, {"species": [{"element": "Hg", "oxidation_state": 2, "occu": 1}], "abc": [0.504748, 0.3705710000000001, 0.757356], "xyz": [2.3049086611620004, 2.634265618750998, 10.061394937620003], "label": "Hg2+", "properties": {}}, {"species": [{"element": "Hg", "oxidation_state": 2, "occu": 1}], "abc": [0.495424, 0.12873400000000002, 0.262097], "xyz": [2.2534814782419996, 0.9150643617099992, 3.4819311248150013], "label": "Hg2+", "properties": {}}, {"species": [{"element": "Hg", "oxidation_state": 2, "occu": 1}], "abc": [0.49655800000000005, 0.871745, 0.739496], "xyz": [2.2743223180200007, 6.131840049916998, 9.824126712920004], "label": "Hg2+", "properties": {}}, {"species": [{"element": "S", "oxidation_state": -2, "occu": 1}], "abc": [0.509305, 0.861151, 0.378621], "xyz": [2.327789218663, 6.035338869450999, 5.0299402297950015], "label": "S2-", "properties": {}}, {"species": [{"element": "S", "oxidation_state": -2, "occu": 1}], "abc": [0.509056, 0.13759900000000014, 0.623569], "xyz": [2.3197282927000002, 0.9995327079789987, 8.284048690255004], "label": "S2-", "properties": {}}, {"species": [{"element": "S", "oxidation_state": -2, "occu": 1}], "abc": [0.489144, 0.36278900000000003, 0.127331], "xyz": [2.2265661413560003, 2.540580640553, 1.6915789652450006], "label": "S2-", "properties": {}}, {"species": [{"element": "S", "oxidation_state": -2, "occu": 1}], "abc": [0.491765, 0.6355380000000002, 0.872781], "xyz": [2.2509324354970004, 4.491208161713998, 11.594803942995004], "label": "S2-", "properties": {}}, {"species": [{"element": "Br", "oxidation_state": -1, "occu": 1}], "abc": [0.0048160000000000425, 0.874179, 0.127765], "xyz": [0.03521796647600004, 6.110615718111, 1.6973446096750004], "label": "Br-", "properties": {}}, {"species": [{"element": "Cl", "oxidation_state": -1, "occu": 1}], "abc": [5.999999999994898e-05, 0.13324700000000012, 0.87003], "xyz": [0.012316199374000254, 0.9845483554429977, 11.558257196850002], "label": "Cl-", "properties": {}}, {"species": [{"element": "Cl", "oxidation_state": -1, "occu": 1}], "abc": [0.999898, 0.3710000000000001, 0.372063], "xyz": [4.547789233272, 2.6131904387359994, 4.942817888385001], "label": "Cl-", "properties": {}}, {"species": [{"element": "Cl", "oxidation_state": -1, "occu": 1}], "abc": [0.999726, 0.6278170000000001, 0.629655], "xyz": [4.553522331902, 4.422119378172998, 8.364900561225003], "label": "Cl-", "properties": {}}]} |
Oops, something went wrong.