ui: every sample has a thumbnail on the Start card and a gallery capture (#294)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
No files matched your search
@@ -24,6 +24,14 @@ is committed and listed here with its exports.
|
||||
| docs/media/examples/bracket-hex.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the solved bracket-hex sample (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/crank-arm.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the solved crank-arm sample (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/crank-mirror.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the solved crank-mirror sample (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/flow-past.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the flow-past sample (its bracket; the viewport does not draw flow results yet) (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/cantilever.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the solved cantilever sample (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/impact.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the solved impact sample (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| docs/media/examples/parts.png | FieldCraft contributors | Original: the FieldCraft window captured (`ui.capture`) with the parts sample (meshes only, nothing to solve) (docs/examples.md) | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/flow-past.png | FieldCraft contributors | Original: the flow-past sample as docs/media/examples/flow-past.png shows it, rendered by FieldCraft (`ui.render`, light theme), cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the flow-past sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/cantilever.png | FieldCraft contributors | Original: the cantilever sample as docs/media/examples/cantilever.png shows it, rendered by FieldCraft (`ui.render`, light theme), cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the cantilever sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/impact.png | FieldCraft contributors | Original: the impact sample as docs/media/examples/impact.png shows it, rendered by FieldCraft (`ui.render`, light theme), cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the impact sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/parts.png | FieldCraft contributors | Original: the parts sample as docs/media/examples/parts.png shows it, rendered by FieldCraft (`ui.render`, light theme), cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the parts sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/bracket-hex.png | FieldCraft contributors | Original: the viewport of docs/media/examples/bracket-hex.png cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the bracket-hex sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/crank-arm.png | FieldCraft contributors | Original: the viewport of docs/media/examples/crank-arm.png cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the crank-arm sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
| crates/ui-egui/thumbnails/crank-mirror.png | FieldCraft contributors | Original: the viewport of docs/media/examples/crank-mirror.png cropped to the model and scaled to 320 px wide (ImageMagick, 128-colour palette), the crank-mirror sample's thumbnail on the Start card | MIT OR Apache-2.0 |
|
||||
|
||||
@@ -19,6 +19,10 @@ const THUMBNAILS: &[(&str, &[u8])] = &[
|
||||
("rubber-seal", include_bytes!("../thumbnails/rubber-seal.png")),
|
||||
("heated-bracket", include_bytes!("../thumbnails/heated-bracket.png")),
|
||||
("bracket-hex", include_bytes!("../thumbnails/bracket-hex.png")),
|
||||
("flow-past", include_bytes!("../thumbnails/flow-past.png")),
|
||||
("cantilever", include_bytes!("../thumbnails/cantilever.png")),
|
||||
("impact", include_bytes!("../thumbnails/impact.png")),
|
||||
("parts", include_bytes!("../thumbnails/parts.png")),
|
||||
];
|
||||
|
||||
/// The thumbnails' aspect ratio (height over width).
|
||||
@@ -164,13 +168,16 @@ mod tests {
|
||||
assert_eq!(names.first(), Some(&"crank-arm"));
|
||||
}
|
||||
|
||||
/// Every flagship name and every thumbnail names a registered sample, and every thumbnail
|
||||
/// decodes at 320 px wide.
|
||||
/// Every flagship name and every thumbnail names a registered sample, every sample has a
|
||||
/// thumbnail (#294), and every thumbnail decodes at 320 px wide.
|
||||
#[test]
|
||||
fn thumbnails_and_flagship_names_are_registered_samples() {
|
||||
for name in FLAGSHIP.iter().chain(THUMBNAILS.iter().map(|(n, _)| n)) {
|
||||
assert!(fieldcraft_engine::sample::find(name).is_some(), "{name}");
|
||||
}
|
||||
for s in SAMPLES {
|
||||
assert!(THUMBNAILS.iter().any(|(n, _)| *n == s.name), "{} has no thumbnail", s.name);
|
||||
}
|
||||
for (name, bytes) in THUMBNAILS {
|
||||
let image = decode(bytes).unwrap_or_else(|| panic!("{name} does not decode"));
|
||||
assert_eq!(image.size[0], 320, "{name}");
|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 9.8 KiB |
|
After Width: | Height: | Size: 10 KiB |
@@ -65,8 +65,10 @@ history; `solve.probe` with `points` gives the velocity and pressure in any cell
|
||||
blocks by 17 %, held between 1 and 3.5 (a flat plate broadside to the flow is about 1.2 at high
|
||||
Reynolds number and rises as it falls); the lattice's mass changes by less than 1 %.
|
||||
|
||||
There is no picture yet: the viewport does not draw flow results (velocity slices and
|
||||
streamlines are planned in M12), so this example is numbers only for now.
|
||||

|
||||
|
||||
The picture shows the bracket only: the viewport does not draw flow results yet (velocity
|
||||
slices and streamlines are planned in M12), so the results are numbers for now.
|
||||
|
||||
## Heated bracket (`heated-bracket`)
|
||||
|
||||
@@ -163,3 +165,26 @@ M/Z = 1500 · 141 / (16 · 35.6² / 6) = 62.6 MPa (0.25 %); a 41 815-element tet
|
||||
full part gives 62.3 MPa. The pedal bore moves 0.75 mm down (tet10: 0.70–0.75 mm; Euler–Bernoulli
|
||||
with a rigid clamp: 0.58 mm, without shear or the boss's compliance), and the spindle carries the
|
||||
whole 1500 N and 255 N·m.
|
||||
|
||||
## Cantilever (`cantilever`)
|
||||
|
||||

|
||||
|
||||
A steel beam of 160 hex8 elements, clamped at one end with a load on the other: a static step
|
||||
and a frequency step. **Look at:** the bending stress, highest at the clamped root, and the
|
||||
Modes step's mode shapes.
|
||||
|
||||
## Bar impact (`impact`)
|
||||
|
||||

|
||||
|
||||
The same beam flying onto a rigid wall: an explicit dynamic step of ten frames. **Look at:** the
|
||||
stress wave running back along the bar (Results ▸ Frame) and the energy history in the Results
|
||||
panel.
|
||||
|
||||
## Hex and tet parts (`parts`)
|
||||
|
||||

|
||||
|
||||
A hex8 block beside a tet4 cube: meshes to look at (element types, nodes, picking), nothing to
|
||||
solve.
|
||||
|
After Width: | Height: | Size: 203 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 156 KiB |