mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-14 02:15:07 -05:00
Drawing.PartColors (a public array aliasing the active scheme's), Drawing.UseGoldenAngleColors and a non-atomic colour counter were process-global display state. PartPalette now holds a copy of the colours and the golden-angle flag; PartColorPalette.Current/Use swap it as a whole, Drawing.GetPartColor/GetNextColor read it, and the counter increments atomically. Colours shown are unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
98 lines
5.6 KiB
Markdown
98 lines
5.6 KiB
Markdown
# Nesting-view colors
|
|
|
|
Choose **Tools > Options > Color scheme > Workshop**, then **Save** for a
|
|
high-contrast per-drawing view:
|
|
|
|
- Generated fills: hue advances by 137.508 degrees per drawing (skipping the
|
|
green band reserved for etch) and cycles through eight saturation/lightness
|
|
tiers on an irrational stride, so parts sharing a sheet stay far apart in
|
|
color. All copies of a drawing keep its color.
|
|
- Thin dark gray `#303030` cut outlines.
|
|
- Bright green `#00FF00` etch strokes, independent of the part fill, so marks
|
|
that are not cuts cannot be mistaken for part outlines.
|
|
- Pale gray `#F2F2F2` sheet and neutral gray background.
|
|
|
|
The generator continues beyond the twelve preview samples instead of wrapping
|
|
through a short palette. It maximizes separation between consecutive drawing
|
|
indices, not spatial neighbors; very large jobs can still place similar colors
|
|
side by side. This is not a colorblind-safe or perceptually uniform palette. Selected parts retain the
|
|
standard translucent blue highlight; etch and cut colors stay unchanged.
|
|
Classic, Pastel and Dark remain available; saved scheme choices are not changed.
|
|
The scheme is an application setting, not part of a nest. Applying a scheme
|
|
recolors drawings in open nests, and opening a nest recolors its drawings from the
|
|
active scheme. Only a color picked on purpose in Drawing Properties (or stored on a
|
|
library record) is kept; see [drawing colors](nest-file-format.md#drawing-colors).
|
|
Drawing Properties shows whether the color is custom or automatic, and its
|
|
**Automatic** button returns a custom color to the drawing's scheme color.
|
|
|
|
In plate views and drawing thumbnails, scribe/etch motions have a separate stroke
|
|
from material cuts. A closed etched circle or lettering does not make a hole in
|
|
the displayed part fill. An etch-only part remains selectable by its closed
|
|
mark in the plate view; etch lines still do not become cut material. Selection
|
|
changes the part highlight, not the etch color.
|
|
Lead-in/out strokes keep their existing orange-red appearance. Preview placements
|
|
show etches too. A cut coincident with an etch is drawn over the etch, so it is not
|
|
hidden by the mark.
|
|
|
|
This is a display aid, not a geometry classifier or machining-safety certificate.
|
|
Only motions classified as `Scribe` receive etch styling; a line incorrectly
|
|
classified as `Cut` remains a cut line. Drawing geometry, layer classifications,
|
|
cutting plans and post-processor output are not changed by the renderer. The CAD
|
|
conversion/program-editing views retain their own source/classification colors.
|
|
|
|
## Festive schemes
|
|
|
|
**Halloween**, **Christmas** and **4th of July** are built-in schemes chosen like
|
|
any other; OpenNest never switches to them automatically. Their background,
|
|
sheet and accent colors carry the theme, while each 12-color part palette stays
|
|
varied, light enough for black part IDs and clear of the green etch stroke.
|
|
Etch, cut-outline and selection behavior match Classic.
|
|
|
|
## Custom scheme files
|
|
|
|
Scheme JSON files in `Schemes/` beside the application may specify `etchColor`
|
|
and `partOutlineColor` as `#RRGGBB`. Optional `selectedPartColor` specifies an opaque
|
|
selection fill; missing or null retains the legacy translucent selection highlight.
|
|
Missing `etchColor` uses the bright green etch default.
|
|
Missing or null `partOutlineColor` retains the legacy darker-than-fill outline.
|
|
Optional `useGoldenAngleColors: true` selects generated drawing colors; missing
|
|
or false keeps the explicit `partColors` palette and its legacy cycling behavior.
|
|
Workshop tests check the first 1,000 generated fills stay far in RGB distance
|
|
from both the dark cut outline and the bright green etch stroke, and that no
|
|
fill hue falls in the etch green band. Selected rendering has separate bitmap tests.
|
|
Custom drawing colors are not automatically contrast-corrected. Existing scheme
|
|
names, saved choices, custom palettes and geometry remain unchanged.
|
|
|
|
## Shared code and the Avalonia app
|
|
|
|
The schemes, their JSON format, the `Schemes/` folder and the recolor rule live in
|
|
`OpenNest.Desktop` (`ColorScheme`, `ColorSchemeRegistry`, `ColorSchemeSerializer`,
|
|
and `ColorShade`, a port of `ControlPaint.Dark` for the legacy part outline), so
|
|
both desktop apps share them; `Schemes/*.json` in that project copies beside both
|
|
apps. Applying a scheme hands Core an immutable copy of its drawing colors through
|
|
`PartColorPalette.Use(new PartPalette(...))`; `Drawing.GetPartColor` and `GetNextColor`
|
|
read `PartColorPalette.Current`, so editing a scheme's array later changes nothing until
|
|
it is applied again. WinForms draws with per-thread GDI+ pens from `GdiSchemeTools`; the Avalonia
|
|
plate canvas draws with Skia colours from `SkiaSchemePalette`. The Avalonia app
|
|
applies the scheme saved as `ActiveColorScheme` in the shared user-settings file
|
|
when it starts, and recolors a nest's drawings when it opens one; it has no
|
|
Options screen to change the scheme yet. Its plate canvas builds part paths from
|
|
`OpenNest.Desktop.Rendering` (a port of the WinForms `GraphicsHelper` layer routing:
|
|
etches stroked apart from cuts, tabs filled but not cut, break cuts never filled), so
|
|
the etch, cut and fill rules above hold there too; WinForms still draws with
|
|
`GraphicsHelper`.
|
|
|
|
## Verification
|
|
|
|
On Windows, run:
|
|
|
|
```powershell
|
|
dotnet test OpenNest.WinForms.Tests/OpenNest.WinForms.Tests.csproj -c Release --filter FullyQualifiedName~EtchDisplayTests
|
|
```
|
|
|
|
Then inspect an actual nest with both cuts and etches: select/deselect and move a
|
|
part, zoom in/out, inspect drawing thumbnails, and switch away from Workshop and
|
|
back. Confirm the marks remain readable, closed marks stay filled and real holes
|
|
remain holes. Automated bitmap tests verify the rendering rules, not an operator's
|
|
assessment of readability on a particular display.
|