diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md index b107c31..8bca9da 100644 --- a/ATTRIBUTION.md +++ b/ATTRIBUTION.md @@ -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 | diff --git a/crates/ui-egui/src/samples.rs b/crates/ui-egui/src/samples.rs index 4d86e1b..8bc1f8c 100644 --- a/crates/ui-egui/src/samples.rs +++ b/crates/ui-egui/src/samples.rs @@ -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}"); diff --git a/crates/ui-egui/thumbnails/cantilever.png b/crates/ui-egui/thumbnails/cantilever.png new file mode 100644 index 0000000..7f2918b Binary files /dev/null and b/crates/ui-egui/thumbnails/cantilever.png differ diff --git a/crates/ui-egui/thumbnails/flow-past.png b/crates/ui-egui/thumbnails/flow-past.png new file mode 100644 index 0000000..b4778f0 Binary files /dev/null and b/crates/ui-egui/thumbnails/flow-past.png differ diff --git a/crates/ui-egui/thumbnails/impact.png b/crates/ui-egui/thumbnails/impact.png new file mode 100644 index 0000000..ff327ea Binary files /dev/null and b/crates/ui-egui/thumbnails/impact.png differ diff --git a/crates/ui-egui/thumbnails/parts.png b/crates/ui-egui/thumbnails/parts.png new file mode 100644 index 0000000..0856973 Binary files /dev/null and b/crates/ui-egui/thumbnails/parts.png differ diff --git a/docs/examples.md b/docs/examples.md index fe66083..99897a1 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -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 L-bracket the air flows past, as the sample opens](media/examples/flow-past.png) + +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`) + +![Von Mises stress on the clamped steel beam under its end load, highest at the clamped root](media/examples/cantilever.png) + +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`) + +![Von Mises stress in the steel beam at the end of its impact on the rigid wall](media/examples/impact.png) + +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](media/examples/parts.png) + +A hex8 block beside a tet4 cube: meshes to look at (element types, nodes, picking), nothing to +solve. diff --git a/docs/media/examples/cantilever.png b/docs/media/examples/cantilever.png new file mode 100644 index 0000000..caf7e04 Binary files /dev/null and b/docs/media/examples/cantilever.png differ diff --git a/docs/media/examples/flow-past.png b/docs/media/examples/flow-past.png new file mode 100644 index 0000000..2e165b4 Binary files /dev/null and b/docs/media/examples/flow-past.png differ diff --git a/docs/media/examples/impact.png b/docs/media/examples/impact.png new file mode 100644 index 0000000..73afa8c Binary files /dev/null and b/docs/media/examples/impact.png differ diff --git a/docs/media/examples/parts.png b/docs/media/examples/parts.png new file mode 100644 index 0000000..b498860 Binary files /dev/null and b/docs/media/examples/parts.png differ