@jjlmoya/utils-science 1.39.0 → 1.41.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/package.json +1 -1
- package/src/category/index.ts +2 -1
- package/src/entries.ts +3 -1
- package/src/index.ts +1 -0
- package/src/tests/locale_completeness.test.ts +2 -2
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/crystal-lattice-structure-finder/bibliography.astro +14 -0
- package/src/tool/crystal-lattice-structure-finder/bibliography.ts +20 -0
- package/src/tool/crystal-lattice-structure-finder/component.astro +366 -0
- package/src/tool/crystal-lattice-structure-finder/crystal-lattice-structure-finder.css +387 -0
- package/src/tool/crystal-lattice-structure-finder/data.ts +220 -0
- package/src/tool/crystal-lattice-structure-finder/entry.ts +26 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/de.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/en.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/es.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/fr.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/id.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/it.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/ja.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/ko.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/nl.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/pl.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/pt.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/ru.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/sv.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/tr.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/i18n/zh.ts +218 -0
- package/src/tool/crystal-lattice-structure-finder/index.ts +11 -0
- package/src/tool/crystal-lattice-structure-finder/logic.ts +39 -0
- package/src/tool/crystal-lattice-structure-finder/seo.astro +15 -0
- package/src/tools.ts +2 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
.lattice-lab {
|
|
2
|
+
--lattice-text: #13282c;
|
|
3
|
+
--lattice-muted: #4a6970;
|
|
4
|
+
--lattice-panel: rgba(255, 255, 255, 0.74);
|
|
5
|
+
--lattice-panel-strong: rgba(255, 255, 255, 0.88);
|
|
6
|
+
--lattice-border: rgba(19, 40, 44, 0.14);
|
|
7
|
+
--lattice-line: rgba(35, 93, 91, 0.5);
|
|
8
|
+
--lattice-stage:
|
|
9
|
+
linear-gradient(180deg, rgba(246, 252, 248, 0.82), rgba(229, 242, 238, 0.92)),
|
|
10
|
+
repeating-linear-gradient(90deg, rgba(35, 93, 91, 0.07) 0 1px, transparent 1px 42px),
|
|
11
|
+
repeating-linear-gradient(0deg, rgba(35, 93, 91, 0.06) 0 1px, transparent 1px 42px);
|
|
12
|
+
--lattice-bg:
|
|
13
|
+
linear-gradient(135deg, rgba(239, 249, 244, 0.96), rgba(222, 241, 235, 0.94) 48%, rgba(250, 237, 204, 0.9)),
|
|
14
|
+
radial-gradient(circle at 20% 20%, rgba(246, 180, 75, 0.22), transparent 32%);
|
|
15
|
+
--lattice-chip-bg: rgba(255, 255, 255, 0.62);
|
|
16
|
+
--lattice-button-bg: #187c78;
|
|
17
|
+
--lattice-button-text: #fff;
|
|
18
|
+
--lattice-structure-label: #187c78;
|
|
19
|
+
--lattice-main-value: #9f4f23;
|
|
20
|
+
--lattice-reset-bg: rgba(19, 40, 44, 0.04);
|
|
21
|
+
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
|
|
24
|
+
gap: 1rem;
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding: 1rem;
|
|
27
|
+
border: 1px solid var(--lattice-border);
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
background: var(--lattice-bg);
|
|
30
|
+
color: var(--lattice-text);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.theme-dark .lattice-lab,
|
|
34
|
+
body.theme-dark .lattice-lab,
|
|
35
|
+
html.theme-dark .lattice-lab {
|
|
36
|
+
--lattice-text: #f7fbf4;
|
|
37
|
+
--lattice-muted: #b8d8d1;
|
|
38
|
+
--lattice-panel: rgba(255, 255, 255, 0.08);
|
|
39
|
+
--lattice-panel-strong: rgba(6, 13, 17, 0.72);
|
|
40
|
+
--lattice-border: rgba(255, 255, 255, 0.14);
|
|
41
|
+
--lattice-line: rgba(214, 248, 233, 0.58);
|
|
42
|
+
--lattice-stage:
|
|
43
|
+
linear-gradient(180deg, rgba(7, 15, 19, 0.68), rgba(13, 30, 34, 0.82)),
|
|
44
|
+
repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 42px),
|
|
45
|
+
repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 42px);
|
|
46
|
+
--lattice-bg:
|
|
47
|
+
linear-gradient(135deg, rgba(13, 25, 31, 0.95), rgba(23, 45, 49, 0.92) 48%, rgba(58, 48, 36, 0.92)),
|
|
48
|
+
radial-gradient(circle at 20% 20%, rgba(246, 180, 75, 0.16), transparent 32%);
|
|
49
|
+
--lattice-chip-bg: rgba(255, 255, 255, 0.08);
|
|
50
|
+
--lattice-button-bg: #54d6b0;
|
|
51
|
+
--lattice-button-text: #071314;
|
|
52
|
+
--lattice-structure-label: #91d8c8;
|
|
53
|
+
--lattice-main-value: #f6d37a;
|
|
54
|
+
--lattice-reset-bg: rgba(255, 255, 255, 0.04);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.lattice-viewer {
|
|
58
|
+
display: grid;
|
|
59
|
+
gap: 0.8rem;
|
|
60
|
+
min-width: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.lattice-orbit {
|
|
64
|
+
position: relative;
|
|
65
|
+
min-height: 420px;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
border: 1px solid var(--lattice-border);
|
|
68
|
+
border-radius: 8px;
|
|
69
|
+
background: var(--lattice-stage);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.lattice-svg {
|
|
73
|
+
display: block;
|
|
74
|
+
width: 100%;
|
|
75
|
+
height: 100%;
|
|
76
|
+
min-height: 420px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.lattice-edge {
|
|
80
|
+
stroke: var(--lattice-line);
|
|
81
|
+
stroke-width: 3;
|
|
82
|
+
stroke-linecap: round;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.lattice-atom {
|
|
86
|
+
stroke: rgba(255, 255, 255, 0.54);
|
|
87
|
+
stroke-width: 1.5;
|
|
88
|
+
filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.32));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.lattice-atom-corner {
|
|
92
|
+
fill: url("#lattice-atom-corner");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.lattice-atom-face {
|
|
96
|
+
fill: url("#lattice-atom-face");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.lattice-atom-interior {
|
|
100
|
+
fill: url("#lattice-atom-interior");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.lattice-summary {
|
|
104
|
+
display: grid;
|
|
105
|
+
gap: 0.35rem;
|
|
106
|
+
padding-bottom: 0.55rem;
|
|
107
|
+
border-bottom: 1px solid var(--lattice-border);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.lattice-summary div {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: baseline;
|
|
113
|
+
justify-content: space-between;
|
|
114
|
+
gap: 0.75rem;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.lattice-summary span {
|
|
118
|
+
color: var(--lattice-structure-label);
|
|
119
|
+
font-size: 0.88rem;
|
|
120
|
+
font-weight: 800;
|
|
121
|
+
letter-spacing: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.lattice-summary strong {
|
|
125
|
+
color: var(--lattice-main-value);
|
|
126
|
+
font-size: clamp(1.35rem, 5vw, 2rem);
|
|
127
|
+
line-height: 1;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.lattice-summary p {
|
|
131
|
+
margin: 0;
|
|
132
|
+
color: var(--lattice-muted);
|
|
133
|
+
font-size: 0.82rem;
|
|
134
|
+
font-weight: 800;
|
|
135
|
+
letter-spacing: 0;
|
|
136
|
+
text-transform: uppercase;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.lattice-legend {
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-wrap: wrap;
|
|
142
|
+
gap: 0.55rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.lattice-legend span {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
gap: 0.45rem;
|
|
149
|
+
min-height: 2.25rem;
|
|
150
|
+
padding: 0.42rem 0.65rem;
|
|
151
|
+
border: 1px solid var(--lattice-border);
|
|
152
|
+
border-radius: 999px;
|
|
153
|
+
background: var(--lattice-chip-bg);
|
|
154
|
+
font-size: 0.88rem;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.lattice-swatch {
|
|
158
|
+
width: 0.75rem;
|
|
159
|
+
height: 0.75rem;
|
|
160
|
+
border-radius: 50%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.lattice-swatch-corner {
|
|
164
|
+
background: #f6b44b;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.lattice-swatch-face {
|
|
168
|
+
background: #54d6b0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.lattice-swatch-interior {
|
|
172
|
+
background: #8f82ff;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.lattice-console,
|
|
176
|
+
.lattice-results {
|
|
177
|
+
display: grid;
|
|
178
|
+
align-content: start;
|
|
179
|
+
gap: 0.8rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.lattice-console {
|
|
183
|
+
min-width: 0;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.lattice-field,
|
|
187
|
+
.lattice-number {
|
|
188
|
+
display: grid;
|
|
189
|
+
gap: 0.4rem;
|
|
190
|
+
min-width: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.lattice-number {
|
|
194
|
+
position: relative;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.lattice-number > span {
|
|
198
|
+
position: absolute;
|
|
199
|
+
top: 0.55rem;
|
|
200
|
+
left: 0.68rem;
|
|
201
|
+
z-index: 1;
|
|
202
|
+
font-size: 0.62rem;
|
|
203
|
+
pointer-events: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.lattice-field > span,
|
|
207
|
+
.lattice-number > span,
|
|
208
|
+
.lattice-metric-row span,
|
|
209
|
+
.lattice-result-group h2 {
|
|
210
|
+
color: var(--lattice-muted);
|
|
211
|
+
font-size: 0.78rem;
|
|
212
|
+
font-weight: 800;
|
|
213
|
+
letter-spacing: 0;
|
|
214
|
+
text-transform: uppercase;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.lattice-field select,
|
|
218
|
+
.lattice-number input {
|
|
219
|
+
width: 100%;
|
|
220
|
+
min-height: 2.65rem;
|
|
221
|
+
border: 1px solid var(--lattice-border);
|
|
222
|
+
border-radius: 8px;
|
|
223
|
+
background: var(--lattice-panel-strong);
|
|
224
|
+
color: var(--lattice-text);
|
|
225
|
+
font-size: inherit;
|
|
226
|
+
font-weight: inherit;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.lattice-field select {
|
|
230
|
+
appearance: none;
|
|
231
|
+
padding: 0 2.45rem 0 0.7rem;
|
|
232
|
+
background-image:
|
|
233
|
+
linear-gradient(45deg, transparent 50%, currentcolor 50%),
|
|
234
|
+
linear-gradient(135deg, currentcolor 50%, transparent 50%);
|
|
235
|
+
background-position:
|
|
236
|
+
calc(100% - 1.15rem) 50%,
|
|
237
|
+
calc(100% - 0.82rem) 50%;
|
|
238
|
+
background-repeat: no-repeat;
|
|
239
|
+
background-size:
|
|
240
|
+
0.38rem 0.38rem,
|
|
241
|
+
0.38rem 0.38rem;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.lattice-number input {
|
|
245
|
+
min-height: 4rem;
|
|
246
|
+
padding: 1.45rem 0.65rem 0.45rem;
|
|
247
|
+
font-size: 1.12rem;
|
|
248
|
+
font-variant-numeric: tabular-nums;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.lattice-field option {
|
|
252
|
+
color: #102025;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.lattice-note {
|
|
256
|
+
display: grid;
|
|
257
|
+
grid-template-columns: auto 1fr;
|
|
258
|
+
gap: 0.7rem;
|
|
259
|
+
align-items: center;
|
|
260
|
+
padding: 0.75rem;
|
|
261
|
+
border: 1px solid var(--lattice-border);
|
|
262
|
+
border-radius: 8px;
|
|
263
|
+
background: var(--lattice-panel);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.lattice-note span {
|
|
267
|
+
display: grid;
|
|
268
|
+
place-items: center;
|
|
269
|
+
min-width: 3.2rem;
|
|
270
|
+
min-height: 3.2rem;
|
|
271
|
+
border-radius: 50%;
|
|
272
|
+
background: #f6b44b;
|
|
273
|
+
color: #1b1408;
|
|
274
|
+
font-weight: 900;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.lattice-note p {
|
|
278
|
+
margin: 0;
|
|
279
|
+
color: var(--lattice-text);
|
|
280
|
+
font-size: 0.95rem;
|
|
281
|
+
line-height: 1.35;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.lattice-slider-grid,
|
|
285
|
+
.lattice-input-grid {
|
|
286
|
+
display: grid;
|
|
287
|
+
gap: 0.7rem;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.lattice-input-grid {
|
|
291
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.lattice-field output {
|
|
295
|
+
justify-self: end;
|
|
296
|
+
margin-top: -1.55rem;
|
|
297
|
+
color: var(--lattice-text);
|
|
298
|
+
font-weight: 800;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.lattice-field input[type="range"] {
|
|
302
|
+
width: 100%;
|
|
303
|
+
accent-color: #54d6b0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.lattice-reset {
|
|
307
|
+
min-height: 2.8rem;
|
|
308
|
+
border: 1px solid var(--lattice-border);
|
|
309
|
+
border-radius: 8px;
|
|
310
|
+
background: var(--lattice-reset-bg);
|
|
311
|
+
color: var(--lattice-muted);
|
|
312
|
+
font-size: inherit;
|
|
313
|
+
font-weight: inherit;
|
|
314
|
+
cursor: pointer;
|
|
315
|
+
transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.lattice-reset-active,
|
|
319
|
+
.lattice-reset:hover {
|
|
320
|
+
border-color: color-mix(in srgb, var(--lattice-button-bg) 45%, var(--lattice-border));
|
|
321
|
+
background: color-mix(in srgb, var(--lattice-button-bg) 12%, transparent);
|
|
322
|
+
color: var(--lattice-text);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.lattice-results {
|
|
326
|
+
grid-column: 1 / -1;
|
|
327
|
+
display: grid;
|
|
328
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
329
|
+
gap: clamp(1.5rem, 5vw, 4rem);
|
|
330
|
+
padding: 0.35rem 0.25rem 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.lattice-result-group {
|
|
334
|
+
display: grid;
|
|
335
|
+
gap: 0.7rem;
|
|
336
|
+
min-width: 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.lattice-result-group h2 {
|
|
340
|
+
margin: 0 0 0.25rem;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.lattice-metric-row {
|
|
344
|
+
display: grid;
|
|
345
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
346
|
+
gap: 1rem;
|
|
347
|
+
align-items: baseline;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.lattice-metric-row strong {
|
|
351
|
+
overflow-wrap: anywhere;
|
|
352
|
+
color: var(--lattice-text);
|
|
353
|
+
font-size: 1.05rem;
|
|
354
|
+
font-variant-numeric: tabular-nums;
|
|
355
|
+
line-height: 1.15;
|
|
356
|
+
text-align: right;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@media (max-width: 900px) {
|
|
360
|
+
.lattice-lab {
|
|
361
|
+
grid-template-columns: 1fr;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.lattice-results {
|
|
365
|
+
grid-template-columns: 1fr;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
@media (max-width: 560px) {
|
|
370
|
+
.lattice-lab {
|
|
371
|
+
padding: 0.75rem;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.lattice-orbit,
|
|
375
|
+
.lattice-svg {
|
|
376
|
+
min-height: 330px;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.lattice-input-grid,
|
|
380
|
+
.lattice-results {
|
|
381
|
+
grid-template-columns: 1fr;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.lattice-note {
|
|
385
|
+
grid-template-columns: 1fr;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
export type LatticeId = 'simple-cubic' | 'face-centered-cubic' | 'hexagonal-close-packed';
|
|
2
|
+
|
|
3
|
+
export interface AtomSite {
|
|
4
|
+
id: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
role: 'corner' | 'face' | 'interior';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface LatticeStructure {
|
|
12
|
+
id: LatticeId;
|
|
13
|
+
shortName: string;
|
|
14
|
+
coordinationNumber: number;
|
|
15
|
+
atomsPerCell: number;
|
|
16
|
+
packingFactor: number;
|
|
17
|
+
radiusToA: number;
|
|
18
|
+
cToA?: number;
|
|
19
|
+
sites: AtomSite[];
|
|
20
|
+
edges: [number, number][];
|
|
21
|
+
vertices: [number, number, number][];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface MaterialPreset {
|
|
25
|
+
id: string;
|
|
26
|
+
formula: string;
|
|
27
|
+
latticeId: LatticeId;
|
|
28
|
+
atomicMass: number;
|
|
29
|
+
latticeA: number;
|
|
30
|
+
cToA?: number;
|
|
31
|
+
atomsPerFormulaUnit?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface DensityResult {
|
|
35
|
+
density: number;
|
|
36
|
+
cellVolumeCm3: number;
|
|
37
|
+
cellMassG: number;
|
|
38
|
+
atomsPerCell: number;
|
|
39
|
+
packingFactor: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const cubeVertices: [number, number, number][] = [
|
|
43
|
+
[0, 0, 0],
|
|
44
|
+
[1, 0, 0],
|
|
45
|
+
[1, 1, 0],
|
|
46
|
+
[0, 1, 0],
|
|
47
|
+
[0, 0, 1],
|
|
48
|
+
[1, 0, 1],
|
|
49
|
+
[1, 1, 1],
|
|
50
|
+
[0, 1, 1],
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const cubeEdges: [number, number][] = [
|
|
54
|
+
[0, 1],
|
|
55
|
+
[1, 2],
|
|
56
|
+
[2, 3],
|
|
57
|
+
[3, 0],
|
|
58
|
+
[4, 5],
|
|
59
|
+
[5, 6],
|
|
60
|
+
[6, 7],
|
|
61
|
+
[7, 4],
|
|
62
|
+
[0, 4],
|
|
63
|
+
[1, 5],
|
|
64
|
+
[2, 6],
|
|
65
|
+
[3, 7],
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
const hexVertices: [number, number, number][] = [
|
|
69
|
+
[1, 0, 0],
|
|
70
|
+
[0.5, 0.866, 0],
|
|
71
|
+
[-0.5, 0.866, 0],
|
|
72
|
+
[-1, 0, 0],
|
|
73
|
+
[-0.5, -0.866, 0],
|
|
74
|
+
[0.5, -0.866, 0],
|
|
75
|
+
[1, 0, 1],
|
|
76
|
+
[0.5, 0.866, 1],
|
|
77
|
+
[-0.5, 0.866, 1],
|
|
78
|
+
[-1, 0, 1],
|
|
79
|
+
[-0.5, -0.866, 1],
|
|
80
|
+
[0.5, -0.866, 1],
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const hexEdges: [number, number][] = [
|
|
84
|
+
[0, 1],
|
|
85
|
+
[1, 2],
|
|
86
|
+
[2, 3],
|
|
87
|
+
[3, 4],
|
|
88
|
+
[4, 5],
|
|
89
|
+
[5, 0],
|
|
90
|
+
[6, 7],
|
|
91
|
+
[7, 8],
|
|
92
|
+
[8, 9],
|
|
93
|
+
[9, 10],
|
|
94
|
+
[10, 11],
|
|
95
|
+
[11, 6],
|
|
96
|
+
[0, 6],
|
|
97
|
+
[1, 7],
|
|
98
|
+
[2, 8],
|
|
99
|
+
[3, 9],
|
|
100
|
+
[4, 10],
|
|
101
|
+
[5, 11],
|
|
102
|
+
];
|
|
103
|
+
|
|
104
|
+
export const LATTICE_STRUCTURES: LatticeStructure[] = [
|
|
105
|
+
{
|
|
106
|
+
id: 'simple-cubic',
|
|
107
|
+
shortName: 'SC',
|
|
108
|
+
coordinationNumber: 6,
|
|
109
|
+
atomsPerCell: 1,
|
|
110
|
+
packingFactor: Math.PI / 6,
|
|
111
|
+
radiusToA: 0.5,
|
|
112
|
+
vertices: cubeVertices,
|
|
113
|
+
edges: cubeEdges,
|
|
114
|
+
sites: cubeVertices.map(([x, y, z], index) => ({
|
|
115
|
+
id: `sc-corner-${index}`,
|
|
116
|
+
x,
|
|
117
|
+
y,
|
|
118
|
+
z,
|
|
119
|
+
role: 'corner' as const,
|
|
120
|
+
})),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'face-centered-cubic',
|
|
124
|
+
shortName: 'FCC',
|
|
125
|
+
coordinationNumber: 12,
|
|
126
|
+
atomsPerCell: 4,
|
|
127
|
+
packingFactor: Math.PI / (3 * Math.sqrt(2)),
|
|
128
|
+
radiusToA: Math.sqrt(2) / 4,
|
|
129
|
+
vertices: cubeVertices,
|
|
130
|
+
edges: cubeEdges,
|
|
131
|
+
sites: [
|
|
132
|
+
...cubeVertices.map(([x, y, z], index) => ({
|
|
133
|
+
id: `fcc-corner-${index}`,
|
|
134
|
+
x,
|
|
135
|
+
y,
|
|
136
|
+
z,
|
|
137
|
+
role: 'corner' as const,
|
|
138
|
+
})),
|
|
139
|
+
{ id: 'fcc-face-bottom', x: 0.5, y: 0.5, z: 0, role: 'face' as const },
|
|
140
|
+
{ id: 'fcc-face-top', x: 0.5, y: 0.5, z: 1, role: 'face' as const },
|
|
141
|
+
{ id: 'fcc-face-front', x: 0.5, y: 0, z: 0.5, role: 'face' as const },
|
|
142
|
+
{ id: 'fcc-face-back', x: 0.5, y: 1, z: 0.5, role: 'face' as const },
|
|
143
|
+
{ id: 'fcc-face-left', x: 0, y: 0.5, z: 0.5, role: 'face' as const },
|
|
144
|
+
{ id: 'fcc-face-right', x: 1, y: 0.5, z: 0.5, role: 'face' as const },
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 'hexagonal-close-packed',
|
|
149
|
+
shortName: 'HCP',
|
|
150
|
+
coordinationNumber: 12,
|
|
151
|
+
atomsPerCell: 6,
|
|
152
|
+
packingFactor: 0.74048,
|
|
153
|
+
radiusToA: 0.5,
|
|
154
|
+
cToA: 1.633,
|
|
155
|
+
vertices: hexVertices,
|
|
156
|
+
edges: hexEdges,
|
|
157
|
+
sites: [
|
|
158
|
+
...hexVertices.map(([x, y, z], index) => ({
|
|
159
|
+
id: `hcp-boundary-${index}`,
|
|
160
|
+
x: (x + 1) / 2,
|
|
161
|
+
y: (y + 0.866) / 1.732,
|
|
162
|
+
z,
|
|
163
|
+
role: 'corner' as const,
|
|
164
|
+
})),
|
|
165
|
+
{ id: 'hcp-center-bottom', x: 0.5, y: 0.5, z: 0, role: 'face' as const },
|
|
166
|
+
{ id: 'hcp-center-top', x: 0.5, y: 0.5, z: 1, role: 'face' as const },
|
|
167
|
+
{ id: 'hcp-interior-a', x: 0.33, y: 0.42, z: 0.5, role: 'interior' as const },
|
|
168
|
+
{ id: 'hcp-interior-b', x: 0.67, y: 0.58, z: 0.5, role: 'interior' as const },
|
|
169
|
+
{ id: 'hcp-interior-c', x: 0.5, y: 0.28, z: 0.5, role: 'interior' as const },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
export const MATERIAL_PRESETS: MaterialPreset[] = [
|
|
175
|
+
{
|
|
176
|
+
id: 'copper',
|
|
177
|
+
formula: 'Cu',
|
|
178
|
+
latticeId: 'face-centered-cubic',
|
|
179
|
+
atomicMass: 63.546,
|
|
180
|
+
latticeA: 3.615,
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: 'aluminum',
|
|
184
|
+
formula: 'Al',
|
|
185
|
+
latticeId: 'face-centered-cubic',
|
|
186
|
+
atomicMass: 26.9815,
|
|
187
|
+
latticeA: 4.0495,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: 'polonium',
|
|
191
|
+
formula: 'Po',
|
|
192
|
+
latticeId: 'simple-cubic',
|
|
193
|
+
atomicMass: 208.9824,
|
|
194
|
+
latticeA: 3.359,
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
id: 'magnesium',
|
|
198
|
+
formula: 'Mg',
|
|
199
|
+
latticeId: 'hexagonal-close-packed',
|
|
200
|
+
atomicMass: 24.305,
|
|
201
|
+
latticeA: 3.209,
|
|
202
|
+
cToA: 1.624,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
id: 'titanium',
|
|
206
|
+
formula: 'Ti',
|
|
207
|
+
latticeId: 'hexagonal-close-packed',
|
|
208
|
+
atomicMass: 47.867,
|
|
209
|
+
latticeA: 2.951,
|
|
210
|
+
cToA: 1.587,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: 'halite',
|
|
214
|
+
formula: 'NaCl',
|
|
215
|
+
latticeId: 'face-centered-cubic',
|
|
216
|
+
atomicMass: 58.4428,
|
|
217
|
+
latticeA: 5.640,
|
|
218
|
+
atomsPerFormulaUnit: 4,
|
|
219
|
+
},
|
|
220
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ScienceToolEntry } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const crystalLatticeStructureFinder: ScienceToolEntry = {
|
|
4
|
+
id: 'crystal-lattice-structure-finder',
|
|
5
|
+
icons: {
|
|
6
|
+
bg: 'mdi:cube-outline',
|
|
7
|
+
fg: 'mdi:molecule',
|
|
8
|
+
},
|
|
9
|
+
i18n: {
|
|
10
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
11
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
12
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
13
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
14
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
15
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
16
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
17
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
18
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
19
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
20
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
21
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
22
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
23
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
24
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
25
|
+
},
|
|
26
|
+
};
|