Interactive 2D wave optics simulator. Turn any image into a refractive scene, add sources, watch waves refract, diffract and interfere. Probes, intensity maps, video export.
C#
The Add part menu keeps the lens-and-mirror pair; the row profiles redrawn around the pointed lens
Alexander Graefe6ad20ceb86d
diff --git a/CLAUDE.md b/CLAUDE.mdindex 91ea100..7bb3892 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -229,7 +229,8 @@ FrameStore: native memory up to the budget, the rest in a temp file (%LOCALAPPDAcolour, so a disabled row's icon greys with its name through one trigger on the row. A lens row's icon is its ownprofile (2026-10-29, the user's design): nine `IconLens<Left><Right>` drawings, each surface convex, flat or concave byits radius's sign, chosen by `LensIconConverter` from R1 and R2 in a template scoped to the row's icon, so it follows an- edit; the Part menu's `IconLens` is the biconvex one. The Mirror box renames the part, Lens to Mirror and back+ edit; the Part menu's `IconLens` is the lens-and-mirror pair the user drew, a biconvex lens beside a concave mirror with a+ flat back, which no row shows. The Mirror box renames the part, Lens to Mirror and back(`LensPart.MirrorName`, run by the box's command and never by the setter, so a loaded or undone name stays). Drawings are 16 px, 1 px strokeson half pixels, ink in rows and columns 0 to 14 (odd, so it centres like text); every tree row, toolbar button andmenu entry is 23 px, the menu bar's headers through their padding. The pictures' handle glyphs stay indiff --git a/WaveDudeNext.WPF/Converters/LensIconConverter.cs b/WaveDudeNext.WPF/Converters/LensIconConverter.csindex 37650d3..d5f8e8f 100644--- a/WaveDudeNext.WPF/Converters/LensIconConverter.cs+++ b/WaveDudeNext.WPF/Converters/LensIconConverter.cs@@ -25,13 +25,14 @@ namespace WaveDudeNext.WPF.Converters;/// The icon drawing of a lens or mirror by its radii (2026-10-29, the user's design): <c>Lens</c> followed by the shape of each/// surface, <c>Convex</c>, <c>Flat</c> or <c>Concave</c>, the name of the theme's <c>IconLens{left}{right}</c> geometry. The/// inputs are <see cref="LensPart.R1"/> and <see cref="LensPart.R2"/>, signed as the model signs them: R1 above 0 and R2 below-/// 0 bulge outward, 0 is flat; the fit never changes a sign. The kind's own symbol, <c>Lens</c>, stands in until both arrive.+/// 0 bulge outward, 0 is flat; the fit never changes a sign. The biconvex profile stands in until both arrive (the kind's own+/// symbol, <c>Lens</c>, is the Add part menu's lens-and-mirror pair, which a row never shows)./// </summary>public sealed class LensIconConverter : IMultiValueConverter{/// <inheritdoc/>public object Convert(object[] values, Type targetType, object? parameter, CultureInfo culture) =>- values is [double r1, double r2] ? "Lens" + Shape(r1) + Shape(-r2) : "Lens";+ values is [double r1, double r2] ? "Lens" + Shape(r1) + Shape(-r2) : "LensConvexConvex";/// <summary>The surface's shape for a radius signed so that positive bulges outward.</summary>private static string Shape(double outward) => outward > 0.0 ? "Convex" : outward < 0.0 ? "Concave" : "Flat";diff --git a/WaveDudeNext.WPF/Themes/Controls.xaml b/WaveDudeNext.WPF/Themes/Controls.xamlindex d107c04..c2d3bed 100644--- a/WaveDudeNext.WPF/Themes/Controls.xaml+++ b/WaveDudeNext.WPF/Themes/Controls.xaml@@ -261,20 +261,23 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or<!-- the app's own menu icons (controls:MenuIcon.Drawing, 2026-10-23) for entries the icon font has no glyph for: 16 pxline drawings, stroked at 1 px on half pixels so the lines are crisp at 100 %, a Fill geometry for the solid parts -->- <!-- a lens or mirror: the kind's symbol is biconvex; a part's row shows its own profile, each surface convex, flat or concave by- its radius (2026-10-29, the user's design): a convex surface bows out from a rim 1.5 px off the centre, a flat one is a- line 2.5 px off, a concave one bows in from a rim 4.5 px off, so a biconcave lens is thick at the rim and thin in the- middle; the rims are joined along the top and the bottom -->- <StreamGeometry x:Key="IconLens">M6.5,1.5 C2,4.5 2,11.5 6.5,14.5 L9.5,14.5 C14,11.5 14,4.5 9.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConvexConvex">M6.5,1.5 C2,4.5 2,11.5 6.5,14.5 L9.5,14.5 C14,11.5 14,4.5 9.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConvexFlat">M6.5,1.5 C2,4.5 2,11.5 6.5,14.5 L10.5,14.5 L10.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConvexConcave">M6.5,1.5 C2,4.5 2,11.5 6.5,14.5 L12.5,14.5 C10.5,11.5 10.5,4.5 12.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensFlatConvex">M5.5,1.5 L5.5,14.5 L9.5,14.5 C14,11.5 14,4.5 9.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensFlatFlat">M5.5,1.5 L5.5,14.5 L10.5,14.5 L10.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensFlatConcave">M5.5,1.5 L5.5,14.5 L12.5,14.5 C10.5,11.5 10.5,4.5 12.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConcaveConvex">M3.5,1.5 C5.5,4.5 5.5,11.5 3.5,14.5 L9.5,14.5 C14,11.5 14,4.5 9.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConcaveFlat">M3.5,1.5 C5.5,4.5 5.5,11.5 3.5,14.5 L10.5,14.5 L10.5,1.5 Z</StreamGeometry>- <StreamGeometry x:Key="IconLensConcaveConcave">M3.5,1.5 C5.5,4.5 5.5,11.5 3.5,14.5 L12.5,14.5 C10.5,11.5 10.5,4.5 12.5,1.5 Z</StreamGeometry>+ <!-- the kind's symbol in the Add part menu (2026-10-29, the user's design): a biconvex lens and, to its right, a concave+ mirror, a flat back and a hollow front, thick at the ends -->+ <StreamGeometry x:Key="IconLens">M4,1.5 C7.5,4.5 7.5,11.5 4,14.5 C0.5,11.5 0.5,4.5 4,1.5 Z M13.5,1.5 V14.5 H10.5 C12.5,11.5 12.5,4.5 10.5,1.5 Z</StreamGeometry>+ <!-- a part's row shows its own profile, each surface convex, flat or concave by its radius (2026-10-29, the user's design),+ the shapes about 5 to 7 px wide around x = 8: the biconvex lens is the pointed one of old, its arcs meeting at the ends;+ a flat surface against a convex one makes a D; the meniscus is a crescent of even thickness; a concave surface bows in+ from a rim set out, so a biconcave lens is thick at the rim and thin in the middle; the rims are joined along the top+ and the bottom -->+ <StreamGeometry x:Key="IconLensConvexConvex">M8,1.5 C4.5,4.5 4.5,11.5 8,14.5 C11.5,11.5 11.5,4.5 8,1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensConvexFlat">M10.5,1.5 C3.5,4.5 3.5,11.5 10.5,14.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensConvexConcave">M8,1.5 C3.5,4.5 3.5,11.5 8,14.5 L11,14.5 C7.5,11.5 7.5,4.5 11,1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensFlatConvex">M5.5,1.5 V14.5 C12.5,11.5 12.5,4.5 5.5,1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensFlatFlat">M5.5,1.5 V14.5 H10.5 V1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensFlatConcave">M5.5,1.5 V14.5 H11.5 C9,11.5 9,4.5 11.5,1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensConcaveConvex">M5,1.5 C8.5,4.5 8.5,11.5 5,14.5 L8,14.5 C12.5,11.5 12.5,4.5 8,1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensConcaveFlat">M4.5,1.5 C7,4.5 7,11.5 4.5,14.5 H10.5 V1.5 Z</StreamGeometry>+ <StreamGeometry x:Key="IconLensConcaveConcave">M4.5,1.5 C6.5,4.5 6.5,11.5 4.5,14.5 L11.5,14.5 C9.5,11.5 9.5,4.5 11.5,1.5 Z</StreamGeometry><!-- an S-bent fibre --><StreamGeometry x:Key="IconFiber">M1,13.5 C7,13.5 9,5.5 15,5.5 M1,10.5 C7,10.5 9,2.5 15,2.5</StreamGeometry><!-- alternating layers -->