Skip to content

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#

Each part kind has a description: the Add part entry's tooltip and a collapsible text at the top of its form

Alexander Graef27718daac17e
diff --git a/CLAUDE.md b/CLAUDE.md
index bcc0101..f3c5f2a 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -304,7 +304,10 @@ FrameStore: native memory up to the budget, the rest in a temp file (%LOCALAPPDA
triangle, outline), a fibre on a Bézier path, a Bragg reflector, a GRIN lens, the XOR, AND and OR gates under
`LogicGatePart` and a zone plate (both Jeroen's, 2026-10-21/22). Painted into the scene pixels, red the index (red 0 a
mirror), blue for absorbers, green never; a part edit is a simulation edit. The menus of kinds share `PartMenuEntries`
- (`ProjectTree.xaml`), added by `ProjectTree.MenuEntries`, not as an `ItemsSource`. **Coatings** (2026-10-29, the user's
+ (`ProjectTree.xaml`), added by `ProjectTree.MenuEntries`, not as an `ItemsSource`. **Each kind has a description**
+ (2026-10-29, the user's choice): the `Kind.<Type>` string in the four tables, the entry's tooltip in the menus and the
+ text at the top of the part's form (`PartCommonView`, through `KindDescriptionConverter` with the language as an input),
+ under a header whose chevron turns while it is open; open or closed is one user setting, `PartDescriptionExpanded`. **Coatings** (2026-10-29, the user's
request, so Jeroen's drawn scenes become parts): a lens, a shape, the GRIN lens and the fibre are `CoatedPart`s, the AR
band a `Layer` at √n or `Graded`, a raised cosine from the pixel's index to the body (measured against linear, smooth-step
and quintic in `OpticalParts.md`), on the faces `FrontCoated`, `BackCoated`, `SidesCoated` choose, classed by the outward
diff --git a/OpticalParts.md b/OpticalParts.md
index feae9f3..de9e2ed 100644
--- a/OpticalParts.md
+++ b/OpticalParts.md
@@ -211,7 +211,9 @@ the check's small canvas, +6 % in a wide one).
- **Tree**: a "Parts" folder between Sources and Probes; rows like a source's (enabled box, name, move, remove).
- **Menus**: the "+ Part" button and the Parts folder's plus open the menu of kinds (Space opens it on the menu itself,
- the arrows walk it, Enter picks); a tree row's context menu has the same entries under "Add part". The entries are
+ the arrows walk it, Enter picks); a tree row's context menu has the same entries under "Add part". Each entry's tooltip is the kind's description
+ (the `Kind.<Type>` string, 2026-10-29, the user's choice), shown again at the top of the part's form under a header
+ whose chevron turns while it is open; open or closed is a user setting. The entries are
written once (`PartMenuEntries`, an unshared `x:Array`) and added to each menu's items by `ProjectTree.MenuEntries`,
as real children: as an `ItemsSource` they made a submenu opened by keyboard start on its last entry the first time
(2026-10-22). Each entry passes its class to `ProjectCommands.AddPart`; `Project.AddPart(Type)` adds it centred on
diff --git a/WaveDudeNext.WPF/Converters/KindDescriptionConverter.cs b/WaveDudeNext.WPF/Converters/KindDescriptionConverter.cs
new file mode 100644
index 0000000..a415e59
--- /dev/null
+++ b/WaveDudeNext.WPF/Converters/KindDescriptionConverter.cs
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+// Copyright (C) 2026 Alexander Graef <[email protected]>
+//
+// This file is part of WaveDude Next, a 2D wave simulator.
+//
+// Based on the work of
+// Jeroen Vleggaar (Huygens Optics), author of Wave Dude 2D, Copyright (C) 2026
+// <https://www.youtube.com/@HuygensOptics>, <https://www.huygensoptics.com>
+// 0x23 (Diffraction Limited), author of WaveSimulator2D
+// <https://www.youtube.com/@DiffractionLimited>, <https://github.com/0x23/WaveSimulator2D>
+//
+// WaveDude Next is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free Software
+// Foundation, either version 3 of the License, or (at your option) any later
+// version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
+// <https://www.gnu.org/licenses/>.
+
+using System.Globalization;
+using System.Windows;
+using System.Windows.Data;
+using WaveDudeNext.Model;
+
+namespace WaveDudeNext.WPF.Converters;
+
+/// <summary>
+/// The description of a part's kind for the top of its form (2026-10-29, the user's choice): the string table's
+/// <c>Kind.{type}</c> entry, the one the Add part menu shows as the entry's tooltip; "" for a kind without one. The
+/// second input is the language, so the text is re-read on a switch.
+/// </summary>
+public sealed class KindDescriptionConverter : IMultiValueConverter
+{
+ /// <inheritdoc/>
+ public object Convert(object[] values, Type targetType, object? parameter, CultureInfo culture) =>
+ values is [OpticalPart part, ..] && Application.Current.TryFindResource("Kind." + part.GetType().Name) is string text ? text : "";
+
+ /// <inheritdoc/>
+ public object[] ConvertBack(object? value, Type[] targetTypes, object? parameter, CultureInfo culture) =>
+ throw new NotSupportedException();
+}
diff --git a/WaveDudeNext.WPF/Panes/ProjectTree.xaml b/WaveDudeNext.WPF/Panes/ProjectTree.xaml
index 7aa5d0d..f365e3e 100644
--- a/WaveDudeNext.WPF/Panes/ProjectTree.xaml
+++ b/WaveDudeNext.WPF/Panes/ProjectTree.xaml
@@ -111,23 +111,24 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
them (the menu of kinds and the tree rows' Add part): each entry adds its kind, the class as the parameter. Not
shared, so every menu that lists them gets its own entries (added to its items by ProjectTree.MenuEntries) -->
<x:Array x:Key="PartMenuEntries" x:Shared="False" Type="{x:Type FrameworkElement}">
- <MenuItem Header="{DynamicResource MenuAddLens}" controls:MenuIcon.Drawing="Lens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:LensPart}" AutomationProperties.AutomationId="AddPart:Lens" />
- <MenuItem Header="{DynamicResource MenuAddFiber}" controls:MenuIcon.Drawing="Fiber" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:FiberPart}" AutomationProperties.AutomationId="AddPart:Fiber" />
- <MenuItem Header="{DynamicResource MenuAddBraggReflector}" controls:MenuIcon.Drawing="BraggReflector" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:BraggReflectorPart}" AutomationProperties.AutomationId="AddPart:BraggReflector" />
- <MenuItem Header="{DynamicResource MenuAddGrinLens}" controls:MenuIcon.Drawing="GrinLens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:GrinLensPart}" AutomationProperties.AutomationId="AddPart:GrinLens" />
- <MenuItem Header="{DynamicResource MenuAddZonePlate}" controls:MenuIcon.Drawing="ZonePlate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:ZonePlatePart}" AutomationProperties.AutomationId="AddPart:ZonePlate" />
+ <!-- each entry's tooltip is the kind's description (2026-10-29, the user's choice), the Kind.<Type> string a part's form shows too -->
+ <MenuItem Header="{DynamicResource MenuAddLens}" ToolTip="{DynamicResource Kind.LensPart}" controls:MenuIcon.Drawing="Lens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:LensPart}" AutomationProperties.AutomationId="AddPart:Lens" />
+ <MenuItem Header="{DynamicResource MenuAddFiber}" ToolTip="{DynamicResource Kind.FiberPart}" controls:MenuIcon.Drawing="Fiber" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:FiberPart}" AutomationProperties.AutomationId="AddPart:Fiber" />
+ <MenuItem Header="{DynamicResource MenuAddBraggReflector}" ToolTip="{DynamicResource Kind.BraggReflectorPart}" controls:MenuIcon.Drawing="BraggReflector" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:BraggReflectorPart}" AutomationProperties.AutomationId="AddPart:BraggReflector" />
+ <MenuItem Header="{DynamicResource MenuAddGrinLens}" ToolTip="{DynamicResource Kind.GrinLensPart}" controls:MenuIcon.Drawing="GrinLens" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:GrinLensPart}" AutomationProperties.AutomationId="AddPart:GrinLens" />
+ <MenuItem Header="{DynamicResource MenuAddZonePlate}" ToolTip="{DynamicResource Kind.ZonePlatePart}" controls:MenuIcon.Drawing="ZonePlate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:ZonePlatePart}" AutomationProperties.AutomationId="AddPart:ZonePlate" />
<Separator />
- <MenuItem Header="{DynamicResource MenuAddPolygon}" controls:MenuIcon.Drawing="Polygon" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:PolygonPart}" AutomationProperties.AutomationId="AddPart:Polygon" />
- <MenuItem Header="{DynamicResource MenuAddRectangle}" controls:MenuIcon.Drawing="Rectangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:RectanglePart}" AutomationProperties.AutomationId="AddPart:Rectangle" />
- <MenuItem Header="{DynamicResource MenuAddEllipse}" controls:MenuIcon.Drawing="Ellipse" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:EllipsePart}" AutomationProperties.AutomationId="AddPart:Ellipse" />
- <MenuItem Header="{DynamicResource MenuAddTriangle}" controls:MenuIcon.Drawing="Triangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:TrianglePart}" AutomationProperties.AutomationId="AddPart:Triangle" />
- <MenuItem Header="{DynamicResource MenuAddOutline}" controls:MenuIcon.Drawing="Outline" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OutlinePart}" AutomationProperties.AutomationId="AddPart:Outline" />
+ <MenuItem Header="{DynamicResource MenuAddPolygon}" ToolTip="{DynamicResource Kind.PolygonPart}" controls:MenuIcon.Drawing="Polygon" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:PolygonPart}" AutomationProperties.AutomationId="AddPart:Polygon" />
+ <MenuItem Header="{DynamicResource MenuAddRectangle}" ToolTip="{DynamicResource Kind.RectanglePart}" controls:MenuIcon.Drawing="Rectangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:RectanglePart}" AutomationProperties.AutomationId="AddPart:Rectangle" />
+ <MenuItem Header="{DynamicResource MenuAddEllipse}" ToolTip="{DynamicResource Kind.EllipsePart}" controls:MenuIcon.Drawing="Ellipse" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:EllipsePart}" AutomationProperties.AutomationId="AddPart:Ellipse" />
+ <MenuItem Header="{DynamicResource MenuAddTriangle}" ToolTip="{DynamicResource Kind.TrianglePart}" controls:MenuIcon.Drawing="Triangle" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:TrianglePart}" AutomationProperties.AutomationId="AddPart:Triangle" />
+ <MenuItem Header="{DynamicResource MenuAddOutline}" ToolTip="{DynamicResource Kind.OutlinePart}" controls:MenuIcon.Drawing="Outline" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OutlinePart}" AutomationProperties.AutomationId="AddPart:Outline" />
<Separator />
<!-- optical logic: one entry per gate (2026-10-21 and 22, the user's requests: XOR, then AND and OR) -->
<MenuItem Header="{DynamicResource MenuAddOpticalLogic}" controls:MenuIcon.Drawing="OpticalLogic" AutomationProperties.AutomationId="AddPart:OpticalLogic">
- <MenuItem Header="{DynamicResource MenuAddXorGate}" controls:MenuIcon.Drawing="XorGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:XorGatePart}" AutomationProperties.AutomationId="AddPart:XorGate" />
- <MenuItem Header="{DynamicResource MenuAddAndGate}" controls:MenuIcon.Drawing="AndGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:AndGatePart}" AutomationProperties.AutomationId="AddPart:AndGate" />
- <MenuItem Header="{DynamicResource MenuAddOrGate}" controls:MenuIcon.Drawing="OrGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OrGatePart}" AutomationProperties.AutomationId="AddPart:OrGate" />
+ <MenuItem Header="{DynamicResource MenuAddXorGate}" ToolTip="{DynamicResource Kind.XorGatePart}" controls:MenuIcon.Drawing="XorGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:XorGatePart}" AutomationProperties.AutomationId="AddPart:XorGate" />
+ <MenuItem Header="{DynamicResource MenuAddAndGate}" ToolTip="{DynamicResource Kind.AndGatePart}" controls:MenuIcon.Drawing="AndGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:AndGatePart}" AutomationProperties.AutomationId="AddPart:AndGate" />
+ <MenuItem Header="{DynamicResource MenuAddOrGate}" ToolTip="{DynamicResource Kind.OrGatePart}" controls:MenuIcon.Drawing="OrGate" Command="{x:Static commands:ProjectCommands.AddPart}" CommandParameter="{x:Type model:OrGatePart}" AutomationProperties.AutomationId="AddPart:OrGate" />
</MenuItem>
</x:Array>
<!-- the menu of part kinds: the "+ Part" button and the Parts folder's plus open it (AddPart without a parameter opens
diff --git a/WaveDudeNext.WPF/Settings.cs b/WaveDudeNext.WPF/Settings.cs
index 918413e..cbec018 100644
--- a/WaveDudeNext.WPF/Settings.cs
+++ b/WaveDudeNext.WPF/Settings.cs
@@ -242,6 +242,16 @@ public sealed class Settings : INotifyPropertyChanged
set => Set(ref _exportFilterIndex, value);
}
+ private bool _partDescriptionExpanded = true;
+
+ /// <summary>Whether the description at the top of a part's form is open (2026-10-29, the user's choice: one state for every kind, kept between sessions).</summary>
+ [XmlAttribute, DefaultValue(true)]
+ public bool PartDescriptionExpanded
+ {
+ get => _partDescriptionExpanded;
+ set => Set(ref _partDescriptionExpanded, value);
+ }
+
private List<ExportHint> _exportHints = [];
/// <summary>
diff --git a/WaveDudeNext.WPF/Strings/Strings.DE.xaml b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
index 9a1d48e..e083517 100644
--- a/WaveDudeNext.WPF/Strings/Strings.DE.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.DE.xaml
@@ -268,6 +268,8 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="TreeColorSchemes">Farbschemata</s:String>
<s:String x:Key="SectionGeneral">Allgemein</s:String>
+ <s:String x:Key="SectionDescription">Beschreibung</s:String>
+ <s:String x:Key="TipPartDescription">Zeigt oder verbirgt, was diese Art Bauteil ist</s:String>
<s:String x:Key="SectionCanvas">Leinwand</s:String>
<s:String x:Key="SectionImageSources">Quellen aus dem Bild</s:String>
<s:String x:Key="SectionRun">Lauf</s:String>
@@ -598,6 +600,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.PartPoint.X">X relativ zum Mittelpunkt des Bauteils in Leinwandpixeln, vor der Drehung.</s:String>
<s:String x:Key="Label.PartPoint.Y">Y</s:String>
<s:String x:Key="Hint.PartPoint.Y">Y relativ zum Mittelpunkt des Bauteils in Leinwandpixeln, vor der Drehung.</s:String>
+ <!-- was jede Art Bauteil ist (2026-10-29): der Tooltip des Eintrags im Bauteilmenü und der Text oben im Formular des Bauteils -->
+ <s:String x:Key="Kind.LensPart">Eine Linse oder ein Spiegel: ein Streifen des Durchmessers zwischen zwei Kugelflächen, jede nach dem Vorzeichen ihres Radius gewölbt, flach oder hohl, um die Mittendicke getrennt. Als Spiegel reflektiert er alles; als Linse bricht sie nach ihrem Index, auf Wunsch mit Entspiegelung und Absorption.</s:String>
+ <s:String x:Key="Kind.FiberPart">Eine Faser: ein Kern höheren Index in einem Mantel, entlang eines glatten Pfads aus Bézier-Segmenten durch ihre Knoten, mit flachen oder runden Enden. Eine in den Kern eingekoppelte Welle wird dem Pfad entlang geführt; der Mantel kann Streulicht an seinem Rand absorbieren.</s:String>
+ <s:String x:Key="Kind.BraggReflectorPart">Ein Bragg-Reflektor: Paare von Schichten zweier Indizes, entlang der Achse gestapelt. Er reflektiert stark um die Wellenlänge, auf die die Schichtdicken abgestimmt sind, je eine Viertelwelle, und lässt andere durch.</s:String>
+ <s:String x:Key="Kind.GrinLensPart">Eine Gradientenindex-Linse: ein Rechteck, dessen Index von der Achse zum Rand parabolisch abfällt, sodass es wie eine Linse mit ebenen Flächen fokussiert.</s:String>
+ <s:String x:Key="Kind.ZonePlatePart">Eine Zonenplatte: Fresnel-Zonen für eine Entwurfsfrequenz und eine Brennweite, jede zweite Zone ein absorbierender Block, die Mittelzone offen oder, invertiert, ein Block. Sie fokussiert durch Beugung; eine optionale Fassung hält Licht auf, das außen am Durchmesser vorbeiläuft.</s:String>
+ <s:String x:Key="Kind.PolygonPart">Ein regelmäßiges Vieleck aus Glas oder als Spiegel, nach Seitenzahl und Seitenlänge.</s:String>
+ <s:String x:Key="Kind.RectanglePart">Ein Rechteck aus Glas oder als Spiegel, nach Länge und Breite; verkettet ein Quadrat. Ein ebener Spiegel ist ein langes, schmales.</s:String>
+ <s:String x:Key="Kind.EllipsePart">Eine Ellipse aus Glas oder als Spiegel, nach Länge und Breite ihres Kastens; verkettet ein Kreis.</s:String>
+ <s:String x:Key="Kind.TrianglePart">Ein Dreieck aus Glas oder als Spiegel: die Basis quer zur Achse, die Spitze entlang ihr, die Basiswinkel nach Vorgabe oder von Hand.</s:String>
+ <s:String x:Key="Kind.OutlinePart">Ein freier Umriss aus Glas oder als Spiegel: eine geschlossene Form durch die Punkte, die Sie setzen und ziehen; weniger als drei malen nichts.</s:String>
+ <s:String x:Key="Kind.XorGatePart">Ein optisches XOR-Gatter: zwei Eingangswellenleiter, ein Phasenabschnitt, der den unteren Eingang eine Viertelperiode vorausgehen lässt, und ein Koppler, dessen oberer Ausgang ihre Differenz führt. Er leuchtet, wenn ein Eingang leuchtet, nicht beide, bei kohärenten Eingängen der Entwurfsfrequenz.</s:String>
+ <s:String x:Key="Kind.AndGatePart">Ein optisches AND-Gatter: derselbe Koppler mit dem unteren Eingang eine Viertelperiode zurück, sodass der obere Ausgang die Summe führt. Am hellsten mit beiden Eingängen, etwa viermal so hell wie mit einem; ein passives lineares Gatter hat kein echteres AND.</s:String>
+ <s:String x:Key="Kind.OrGatePart">Ein optisches OR-Gatter: derselbe Koppler mit dem unteren Eingang ein Zwölftel einer Periode voraus, sodass der obere Ausgang die halbe Leistung jedes Eingangs und beider führt. Er leuchtet mit einem Eingang oder beiden.</s:String>
<s:String x:Key="Label.LensPart.Mirror">Spiegel</s:String>
<s:String x:Key="Hint.LensPart.Mirror">Das Bauteil als Spiegel statt als Linse. Brechungsindex, Entspiegelung und Absorption werden dann ignoriert.</s:String>
<s:String x:Key="Label.LensPart.RefractiveIndex">Brechungsindex</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.EN.xaml b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
index 1e224ef..dad53d9 100644
--- a/WaveDudeNext.WPF/Strings/Strings.EN.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.EN.xaml
@@ -270,6 +270,8 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="TreeColorSchemes">Colour schemes</s:String>
<s:String x:Key="SectionGeneral">General</s:String>
+ <s:String x:Key="SectionDescription">Description</s:String>
+ <s:String x:Key="TipPartDescription">Show or hide what this kind of part is</s:String>
<s:String x:Key="SectionCanvas">Canvas</s:String>
<s:String x:Key="SectionImageSources">Sources from the image</s:String>
<s:String x:Key="SectionRun">Run</s:String>
@@ -600,6 +602,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.PartPoint.X">X relative to the part's centre in canvas pixels, before rotation.</s:String>
<s:String x:Key="Label.PartPoint.Y">Y</s:String>
<s:String x:Key="Hint.PartPoint.Y">Y relative to the part's centre in canvas pixels, before rotation.</s:String>
+ <!-- what each kind of part is (2026-10-29): the Add part entry's tooltip and the text at the top of the part's form -->
+ <s:String x:Key="Kind.LensPart">A lens or a mirror: a strip of the diameter between two spherical surfaces, each bulging outward, flat or hollow by the sign of its radius, the centre thickness apart. As a mirror it reflects everything; as a lens it refracts by its index, with an anti-reflection coating and absorption if wanted.</s:String>
+ <s:String x:Key="Kind.FiberPart">A fibre: a core of higher index inside a cladding, along a smooth path of Bézier segments through its nodes, with flat or round ends. A wave coupled into the core is guided along the path; the cladding can absorb stray light at its rim.</s:String>
+ <s:String x:Key="Kind.BraggReflectorPart">A Bragg reflector: pairs of layers of two indices stacked along the axis. It reflects strongly around the wavelength the layer thicknesses are tuned to, a quarter wave each, and passes others.</s:String>
+ <s:String x:Key="Kind.GrinLensPart">A gradient-index lens: a rectangle whose index falls from the axis to the edge in a parabolic profile, so it focuses like a lens with flat faces.</s:String>
+ <s:String x:Key="Kind.ZonePlatePart">A zone plate: Fresnel zones cut for a design frequency and a focal length, every second zone an absorbing block, the central zone open or, inverted, a block. It focuses by diffraction; an optional mount stops light passing outside the diameter.</s:String>
+ <s:String x:Key="Kind.PolygonPart">A regular polygon of glass or mirror, by its number of sides and the side length.</s:String>
+ <s:String x:Key="Kind.RectanglePart">A rectangle of glass or mirror, by length and width; linked, a square. A flat mirror is a long, narrow one.</s:String>
+ <s:String x:Key="Kind.EllipsePart">An ellipse of glass or mirror, by the length and width of its box; linked, a circle.</s:String>
+ <s:String x:Key="Kind.TrianglePart">A triangle of glass or mirror: the base across the axis, the apex along it, the base angles set by a preset or by hand.</s:String>
+ <s:String x:Key="Kind.OutlinePart">A free outline of glass or mirror: a closed shape through the points you place and drag; fewer than three paint nothing.</s:String>
+ <s:String x:Key="Kind.XorGatePart">An optical XOR gate: two input waveguides, a phase section putting the lower input a quarter period ahead, and a coupler whose upper output carries their difference. It lights when one input is lit, not both, for coherent inputs at the design frequency.</s:String>
+ <s:String x:Key="Kind.AndGatePart">An optical AND gate: the same coupler with the lower input a quarter period behind, so the upper output carries the sum. It is brightest with both inputs lit, about four times a single one; a passive linear gate has no truer AND.</s:String>
+ <s:String x:Key="Kind.OrGatePart">An optical OR gate: the same coupler with the lower input a twelfth of a period ahead, so the upper output carries half the power of either input and of both. It lights with one input or both.</s:String>
<s:String x:Key="Label.LensPart.Mirror">Mirror</s:String>
<s:String x:Key="Hint.LensPart.Mirror">Make the part a mirror instead of a lens. The refractive index, the coating and the absorption are ignored then.</s:String>
<s:String x:Key="Label.LensPart.RefractiveIndex">Refractive index</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.FR.xaml b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
index 2a801e9..40c406f 100644
--- a/WaveDudeNext.WPF/Strings/Strings.FR.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.FR.xaml
@@ -268,6 +268,8 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="TreeColorSchemes">Palettes de couleurs</s:String>
<s:String x:Key="SectionGeneral">Général</s:String>
+ <s:String x:Key="SectionDescription">Description</s:String>
+ <s:String x:Key="TipPartDescription">Affiche ou masque ce qu'est ce type de pièce</s:String>
<s:String x:Key="SectionCanvas">Toile</s:String>
<s:String x:Key="SectionImageSources">Sources issues de l'image</s:String>
<s:String x:Key="SectionRun">Exécution</s:String>
@@ -598,6 +600,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.PartPoint.X">X par rapport au centre du composant en pixels de la toile, avant rotation.</s:String>
<s:String x:Key="Label.PartPoint.Y">Y</s:String>
<s:String x:Key="Hint.PartPoint.Y">Y par rapport au centre du composant en pixels de la toile, avant rotation.</s:String>
+ <!-- ce qu'est chaque type de pièce (2026-10-29) : l'infobulle de l'entrée du menu Ajouter une pièce et le texte en haut du formulaire de la pièce -->
+ <s:String x:Key="Kind.LensPart">Une lentille ou un miroir : une bande du diamètre entre deux surfaces sphériques, chacune bombée, plate ou creuse selon le signe de son rayon, séparées de l'épaisseur au centre. En miroir, il réfléchit tout ; en lentille, elle réfracte selon son indice, avec un traitement antireflet et une absorption si on le souhaite.</s:String>
+ <s:String x:Key="Kind.FiberPart">Une fibre : un cœur d'indice plus élevé dans une gaine, le long d'un chemin lisse de segments de Bézier passant par ses nœuds, aux extrémités plates ou rondes. Une onde couplée dans le cœur est guidée le long du chemin ; la gaine peut absorber la lumière parasite à son bord.</s:String>
+ <s:String x:Key="Kind.BraggReflectorPart">Un réflecteur de Bragg : des paires de couches de deux indices empilées le long de l'axe. Il réfléchit fortement autour de la longueur d'onde à laquelle les épaisseurs des couches sont accordées, un quart d'onde chacune, et laisse passer les autres.</s:String>
+ <s:String x:Key="Kind.GrinLensPart">Une lentille à gradient d'indice : un rectangle dont l'indice décroît de l'axe au bord selon un profil parabolique, de sorte qu'il focalise comme une lentille à faces planes.</s:String>
+ <s:String x:Key="Kind.ZonePlatePart">Une plaque zonée : des zones de Fresnel taillées pour une fréquence de conception et une distance focale, une zone sur deux étant un bloc absorbant, la zone centrale ouverte ou, inversée, un bloc. Elle focalise par diffraction ; une monture optionnelle arrête la lumière qui passe hors du diamètre.</s:String>
+ <s:String x:Key="Kind.PolygonPart">Un polygone régulier de verre ou en miroir, par son nombre de côtés et la longueur du côté.</s:String>
+ <s:String x:Key="Kind.RectanglePart">Un rectangle de verre ou en miroir, par longueur et largeur ; lié, un carré. Un miroir plan est un rectangle long et étroit.</s:String>
+ <s:String x:Key="Kind.EllipsePart">Une ellipse de verre ou en miroir, par la longueur et la largeur de sa boîte ; liée, un cercle.</s:String>
+ <s:String x:Key="Kind.TrianglePart">Un triangle de verre ou en miroir : la base en travers de l'axe, le sommet le long de celui-ci, les angles à la base fixés par un préréglage ou à la main.</s:String>
+ <s:String x:Key="Kind.OutlinePart">Un contour libre de verre ou en miroir : une forme fermée passant par les points que vous placez et déplacez ; moins de trois ne peignent rien.</s:String>
+ <s:String x:Key="Kind.XorGatePart">Une porte XOR optique : deux guides d'onde d'entrée, une section de phase mettant l'entrée inférieure un quart de période en avance, et un coupleur dont la sortie supérieure porte leur différence. Elle s'allume quand une entrée est allumée, pas les deux, pour des entrées cohérentes à la fréquence de conception.</s:String>
+ <s:String x:Key="Kind.AndGatePart">Une porte AND optique : le même coupleur avec l'entrée inférieure un quart de période en retard, de sorte que la sortie supérieure porte la somme. Elle est la plus brillante avec les deux entrées, environ quatre fois une seule ; une porte linéaire passive n'a pas de AND plus vrai.</s:String>
+ <s:String x:Key="Kind.OrGatePart">Une porte OR optique : le même coupleur avec l'entrée inférieure un douzième de période en avance, de sorte que la sortie supérieure porte la moitié de la puissance de chaque entrée et des deux. Elle s'allume avec une entrée ou les deux.</s:String>
<s:String x:Key="Label.LensPart.Mirror">Miroir</s:String>
<s:String x:Key="Hint.LensPart.Mirror">Faire du composant un miroir au lieu d'une lentille. L'indice de réfraction, le traitement antireflet et l'absorption sont alors ignorés.</s:String>
<s:String x:Key="Label.LensPart.RefractiveIndex">Indice de réfraction</s:String>
diff --git a/WaveDudeNext.WPF/Strings/Strings.NL.xaml b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
index 7436605..4c157a7 100644
--- a/WaveDudeNext.WPF/Strings/Strings.NL.xaml
+++ b/WaveDudeNext.WPF/Strings/Strings.NL.xaml
@@ -268,6 +268,8 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="TreeColorSchemes">Kleurenschema's</s:String>
<s:String x:Key="SectionGeneral">Algemeen</s:String>
+ <s:String x:Key="SectionDescription">Beschrijving</s:String>
+ <s:String x:Key="TipPartDescription">Toont of verbergt wat dit soort onderdeel is</s:String>
<s:String x:Key="SectionCanvas">Canvas</s:String>
<s:String x:Key="SectionImageSources">Bronnen uit de afbeelding</s:String>
<s:String x:Key="SectionRun">Run</s:String>
@@ -598,6 +600,20 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<s:String x:Key="Hint.PartPoint.X">X ten opzichte van het middelpunt van het onderdeel in canvaspixels, vóór rotatie.</s:String>
<s:String x:Key="Label.PartPoint.Y">Y</s:String>
<s:String x:Key="Hint.PartPoint.Y">Y ten opzichte van het middelpunt van het onderdeel in canvaspixels, vóór rotatie.</s:String>
+ <!-- wat elk soort onderdeel is (2026-10-29): de tooltip van de ingang in het onderdeelmenu en de tekst bovenaan het formulier van het onderdeel -->
+ <s:String x:Key="Kind.LensPart">Een lens of een spiegel: een strook van de diameter tussen twee boloppervlakken, elk bol, vlak of hol naar het teken van zijn straal, de middendikte uit elkaar. Als spiegel kaatst hij alles terug; als lens breekt hij naar zijn index, desgewenst met een antireflectielaag en absorptie.</s:String>
+ <s:String x:Key="Kind.FiberPart">Een vezel: een kern met hogere index in een mantel, langs een glad pad van Bézier-segmenten door zijn knopen, met vlakke of ronde uiteinden. Een in de kern gekoppelde golf wordt langs het pad geleid; de mantel kan strooilicht aan zijn rand absorberen.</s:String>
+ <s:String x:Key="Kind.BraggReflectorPart">Een Bragg-reflector: paren lagen van twee indices, langs de as gestapeld. Hij kaatst sterk terug rond de golflengte waarop de laagdikten zijn afgestemd, elk een kwart golf, en laat andere door.</s:String>
+ <s:String x:Key="Kind.GrinLensPart">Een gradiëntindexlens: een rechthoek waarvan de index van de as naar de rand parabolisch afneemt, zodat hij focust als een lens met vlakke vlakken.</s:String>
+ <s:String x:Key="Kind.ZonePlatePart">Een zoneplaat: Fresnelzones gesneden voor een ontwerpfrequentie en een brandpuntsafstand, elke tweede zone een absorberend blok, de middelste zone open of, omgekeerd, een blok. Hij focust door buiging; een optionele vatting houdt licht tegen dat buiten de diameter passeert.</s:String>
+ <s:String x:Key="Kind.PolygonPart">Een regelmatige veelhoek van glas of als spiegel, naar het aantal zijden en de zijdelengte.</s:String>
+ <s:String x:Key="Kind.RectanglePart">Een rechthoek van glas of als spiegel, naar lengte en breedte; gekoppeld een vierkant. Een vlakke spiegel is een lange, smalle.</s:String>
+ <s:String x:Key="Kind.EllipsePart">Een ellips van glas of als spiegel, naar de lengte en breedte van zijn kader; gekoppeld een cirkel.</s:String>
+ <s:String x:Key="Kind.TrianglePart">Een driehoek van glas of als spiegel: de basis dwars op de as, de top erlangs, de basishoeken naar een voorinstelling of met de hand.</s:String>
+ <s:String x:Key="Kind.OutlinePart">Een vrije omtrek van glas of als spiegel: een gesloten vorm door de punten die u plaatst en sleept; minder dan drie tekenen niets.</s:String>
+ <s:String x:Key="Kind.XorGatePart">Een optische XOR-poort: twee ingangsgolfgeleiders, een fasesectie die de onderste ingang een kwart periode vooruit zet, en een koppelaar waarvan de bovenste uitgang hun verschil draagt. Hij licht op als één ingang brandt, niet beide, bij coherente ingangen op de ontwerpfrequentie.</s:String>
+ <s:String x:Key="Kind.AndGatePart">Een optische AND-poort: dezelfde koppelaar met de onderste ingang een kwart periode achter, zodat de bovenste uitgang de som draagt. Het helderst met beide ingangen, ongeveer viermaal één; een passieve lineaire poort heeft geen echtere AND.</s:String>
+ <s:String x:Key="Kind.OrGatePart">Een optische OR-poort: dezelfde koppelaar met de onderste ingang een twaalfde periode vooruit, zodat de bovenste uitgang de halve kracht van elke ingang en van beide draagt. Hij licht op met één ingang of beide.</s:String>
<s:String x:Key="Label.LensPart.Mirror">Spiegel</s:String>
<s:String x:Key="Hint.LensPart.Mirror">Het onderdeel een spiegel maken in plaats van een lens. De brekingsindex, de coating en de absorptie worden dan genegeerd.</s:String>
<s:String x:Key="Label.LensPart.RefractiveIndex">Brekingsindex</s:String>
diff --git a/WaveDudeNext.WPF/Themes/Editors.xaml b/WaveDudeNext.WPF/Themes/Editors.xaml
index 32f082b..cace522 100644
--- a/WaveDudeNext.WPF/Themes/Editors.xaml
+++ b/WaveDudeNext.WPF/Themes/Editors.xaml
@@ -630,4 +630,62 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
<Setter Property="Margin" Value="4,0" />
</Style>
+ <!-- the header of a part form's description (2026-10-29, the user's choice): the section label's look with a chevron at the
+ left that turns to point down while the text below is open; the focus is the accent on the underline, as on the chain -->
+ <Style x:Key="DescriptionToggle" TargetType="{x:Type ToggleButton}">
+ <Setter Property="FontWeight" Value="SemiBold" />
+ <Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
+ <Setter Property="HorizontalAlignment" Value="Stretch" />
+ <Setter Property="HorizontalContentAlignment" Value="Left" />
+ <Setter Property="Margin" Value="0,2,0,6" />
+ <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ToggleButton}">
+ <Border x:Name="Bd" Background="Transparent" BorderBrush="{DynamicResource ControlBorder}" BorderThickness="0,0,0,1" Padding="0,0,0,2" SnapsToDevicePixels="True">
+ <DockPanel>
+ <Path x:Name="Glyph" DockPanel.Dock="Left" Data="{StaticResource ChevronRightGeometry}" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.3"
+ Width="6" Height="11" Stretch="Uniform" Margin="1,0,7,0" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
+ <Path.RenderTransform>
+ <RotateTransform x:Name="Turn" Angle="0" />
+ </Path.RenderTransform>
+ </Path>
+ <ContentPresenter VerticalAlignment="Center" />
+ </DockPanel>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsChecked" Value="True">
+ <Trigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetName="Turn" Storyboard.TargetProperty="Angle" To="90" Duration="0:0:0.12" />
+ </Storyboard>
+ </BeginStoryboard>
+ </Trigger.EnterActions>
+ <Trigger.ExitActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetName="Turn" Storyboard.TargetProperty="Angle" To="0" Duration="0:0:0.12" />
+ </Storyboard>
+ </BeginStoryboard>
+ </Trigger.ExitActions>
+ </Trigger>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter TargetName="Bd" Property="Background" Value="{DynamicResource ButtonHover}" />
+ </Trigger>
+ <Trigger Property="IsKeyboardFocused" Value="True">
+ <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Accent}" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ <!-- the description's text under its header -->
+ <Style x:Key="FormDescription" TargetType="{x:Type TextBlock}">
+ <Setter Property="Foreground" Value="{DynamicResource WindowForeground}" />
+ <Setter Property="TextWrapping" Value="Wrap" />
+ <Setter Property="Margin" Value="0,0,0,10" />
+ </Style>
+
</ResourceDictionary>
diff --git a/WaveDudeNext.WPF/Views/PartCommonView.xaml b/WaveDudeNext.WPF/Views/PartCommonView.xaml
index 2e46ff9..70be15a 100644
--- a/WaveDudeNext.WPF/Views/PartCommonView.xaml
+++ b/WaveDudeNext.WPF/Views/PartCommonView.xaml
@@ -22,10 +22,34 @@ version. It is distributed WITHOUT ANY WARRANTY. See the LICENSE.md file or
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WaveDudeNext.WPF.Controls"
xmlns:meta="clr-namespace:WaveDudeNext.WPF.Markup"
- xmlns:model="clr-namespace:WaveDudeNext.Model;assembly=WaveDudeNext">
+ xmlns:model="clr-namespace:WaveDudeNext.Model;assembly=WaveDudeNext"
+ xmlns:converters="clr-namespace:WaveDudeNext.WPF.Converters"
+ xmlns:localization="clr-namespace:WaveDudeNext.WPF.Localization"
+ xmlns:p="clr-namespace:WaveDudeNext.WPF">
+
+ <UserControl.Resources>
+ <converters:KindDescriptionConverter x:Key="KindDescription" />
+ <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
+ </UserControl.Resources>
<!-- the members every part has: name, enabled, centre and angle; placed first in each kind's form -->
<StackPanel>
+ <!-- what this kind is (2026-10-29, the user's choice, beside the Add part menu's tooltips): the Kind.<Type> string under a
+ header whose chevron turns while it is open; open or closed is one user setting for every kind -->
+ <ToggleButton Style="{StaticResource DescriptionToggle}" Content="{DynamicResource SectionDescription}" ToolTip="{DynamicResource TipPartDescription}"
+ IsChecked="{Binding Source={x:Static p:Settings.Default}, Path=PartDescriptionExpanded, Mode=TwoWay}"
+ AutomationProperties.Name="{DynamicResource TipPartDescription}" AutomationProperties.AutomationId="PartDescriptionToggle" />
+ <TextBlock Style="{StaticResource FormDescription}" AutomationProperties.AutomationId="PartDescription"
+ Visibility="{Binding Source={x:Static p:Settings.Default}, Path=PartDescriptionExpanded, Converter={StaticResource BoolToVisibility}}">
+ <TextBlock.Text>
+ <MultiBinding Converter="{StaticResource KindDescription}">
+ <Binding />
+ <!-- the language, so the text is re-read on a switch -->
+ <Binding Path="Current" Source="{x:Static localization:LanguageController.Instance}" />
+ </MultiBinding>
+ </TextBlock.Text>
+ </TextBlock>
+
<Label Style="{StaticResource FormSection}" Content="{DynamicResource SectionGeneral}" />
<controls:FormPanel>
<TextBlock Style="{StaticResource FormLabel}" Text="{meta:Label model:OpticalPart.Name}" />