From 4d55e11318e8bb08f0ac087f038cfe7dafe6cdd0 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Fri, 30 Oct 2026 16:11:30 -0400 Subject: [PATCH] style: use one spelling across the codebase The repo mixed variants such as center/centre and color/colour, so a name could be spelled either way and searches missed half the hits. Standardize on the US spelling, matching .NET's own APIs (Color, Center). Wire values owned by other systems keep their spelling: the material ledger's "Cancelled" hold status and GitHub's "cancelled" job status. No behavior change beyond the spelling of a few status messages. Co-Authored-By: Claude Opus 5.5 --- AGENTS.md | 2 +- OpenNest.Console/Program.cs | 2 +- OpenNest.Core/Breakoffs/BreakoffBuilder.cs | 2 +- OpenNest.Core/Breakoffs/BreakoffLayout.cs | 2 +- .../CuttingPlanning/ContourEntryCandidate.cs | 2 +- .../CuttingPlanning/ContourEntryRanking.cs | 14 +-- .../CNC/CuttingPlanning/CuttingPlanCommit.cs | 8 +- .../IncrementalClosureDrift.cs | 2 +- .../CNC/CuttingPlanning/PreparedContours.cs | 34 +++--- .../CuttingPlanning/ReleasedContourState.cs | 2 +- .../CNC/CuttingPlanning/SeamOvercut.cs | 2 +- .../CuttingStrategy/ContourCuttingStrategy.cs | 66 ++++++------ .../CNC/CuttingStrategy/ErodedPierce.cs | 8 +- OpenNest.Core/CutOff.cs | 4 +- OpenNest.Core/CutOffTrim.cs | 4 +- OpenNest.Core/Diagnostics/OverlapMarker.cs | 6 +- .../Diagnostics/PlateOverlapAnalyzer.cs | 6 +- .../Diagnostics/PlateOverlapReport.cs | 2 +- .../Diagnostics/PostVerificationGeometry.cs | 6 +- OpenNest.Core/Geometry/Collision.cs | 2 +- OpenNest.Core/Geometry/DrawingAligner.cs | 2 +- OpenNest.Core/Geometry/KeepOutOverlap.cs | 8 +- OpenNest.Core/Geometry/MaximalRectangles.cs | 6 +- OpenNest.Core/Geometry/PolyLabel.cs | 4 +- OpenNest.Core/Geometry/SlideContact.cs | 4 +- OpenNest.Core/Support/SupportAnalyzer.cs | 8 +- .../TabbedCutouts/TabbedCutoutLayout.cs | 4 +- OpenNest.Data/BrowseSession.cs | 4 +- .../MaterialLedger/LedgerHoldSummary.cs | 2 +- OpenNest.Data/MaterialLedger/LedgerHolds.cs | 4 +- .../MaterialLedger/LedgerStockAssignment.cs | 2 +- OpenNest.Data/NestDetailsSession.cs | 2 +- OpenNest.Data/SetReleaseSession.cs | 2 +- .../Undo/ChangeScopeTests.cs | 2 +- OpenNest.Desktop/Undo/NestFingerprint.cs | 2 +- .../Fill/ClampZonePushTests.cs | 8 +- .../Fill/ExpanderSpecRegressionTests.cs | 2 +- OpenNest.Engine.Tests/Fill/ExpanderTests.cs | 8 +- .../Jobs/ClampRemovalRepairTests.cs | 6 +- .../Jobs/Cutouts/CutoutLatticeFillTests.cs | 2 +- .../Jobs/Cutouts/CutoutNfpProposalTests.cs | 6 +- .../Jobs/NestJobRunnerTests.cs | 2 +- .../Jobs/NestJobValidationTests.cs | 2 +- .../Jobs/NestPipelineCommitTests.cs | 2 +- .../Jobs/RepeatedPlateGroupingTests.cs | 2 +- .../Jobs/TinyClampZoneTests.cs | 6 +- .../FlatBarNestingEngineTests.cs | 2 +- .../NestingEngines/IrregularBlockTests.cs | 4 +- .../NestingEngines/IrregularClampZoneTests.cs | 2 +- .../IrregularExactContactTests.cs | 2 +- .../PlateFillServiceTests.cs | 2 +- .../RectanglePacking/AreaPackerTests.cs | 2 +- OpenNest.Engine/BestFit/BestFitCache.cs | 2 +- .../CuttingPlanning/BestEffortCuttingPlan.cs | 6 +- .../CuttingPlanning/ContourEntrySelection.cs | 16 +-- .../CuttingPlanning/CuttingGridOrder.cs | 22 ++-- .../CuttingPlanning/CuttingHoleOrder.cs | 30 +++--- .../CuttingPlanning/CuttingNestedOrder.cs | 16 +-- .../CuttingPlanning/CuttingPartOrder.cs | 52 +++++----- .../CuttingPlanning/CuttingPlanBatch.cs | 28 ++--- .../CuttingPlanning/CuttingPlanModels.cs | 2 +- .../CuttingPlanning/CuttingPlanService.cs | 10 +- .../CuttingPlanning/JointCuttingPlanSearch.cs | 98 +++++++++--------- .../PreferredContourEntries.cs | 16 +-- OpenNest.Engine/Fill/Expander.cs | 26 ++--- OpenNest.Engine/Fill/PairFiller.cs | 2 +- OpenNest.Engine/Fill/RemnantFiller.cs | 2 +- OpenNest.Engine/Jobs/ClampRemovalRecovery.cs | 4 +- OpenNest.Engine/Jobs/InteractiveClamps.cs | 2 +- .../Jobs/NestJobPlacementValidator.cs | 2 +- OpenNest.Engine/Jobs/NestLayoutCheck.cs | 2 +- .../Jobs/Placement/Fillers/PlateFiller.cs | 2 +- .../Default/DefaultNestingEngine.cs | 2 +- .../NestingEngines/FlatBar/BarCatalog.cs | 2 +- .../NestingEngines/FlatBar/BarLayout.cs | 16 +-- .../NestingEngines/FlatBar/BarPacker.cs | 2 +- .../FlatBar/FlatBarNestingEngine.cs | 2 +- .../NestingEngines/Rectangles/SheetPacker.cs | 2 +- .../RectanglePacking/AreaPacker.cs | 4 +- .../RectanglePacking/MaxRectsSheet.cs | 2 +- .../Sequencing/DrawnPathSequencing.cs | 6 +- OpenNest.Engine/Strategies/FillContext.cs | 2 +- .../McpEngineHarnessProcessTests.cs | 6 +- .../NestingPipelineTests.cs | 4 +- OpenNest.IO/DrawingPackage.cs | 2 +- OpenNest.IO/NestSnapshot.cs | 2 +- OpenNest.Mcp/Tools/CuttingTools.cs | 4 +- OpenNest.Mcp/Tools/NestingTools.cs | 2 +- OpenNest.Mcp/Tools/TestTools.cs | 2 +- .../Benchmark/BenchmarkScoringTests.cs | 4 +- .../Benchmark/LegacyNestValidator.cs | 2 +- .../Benchmark/NestLayoutCheckTimingTests.cs | 2 +- OpenNest.Tests/BestFit/BestFitCacheTests.cs | 2 +- .../Breakoffs/BreakoffBuilderTests.cs | 2 +- .../CNC/ProgramSubProgramTransformTests.cs | 4 +- .../CIFiberPostProcessorTests.cs | 12 +-- .../CIFiberSampleRegressionTests.cs | 2 +- OpenNest.Tests/ClampRailTests.cs | 2 +- OpenNest.Tests/CutOffs/CutOffGapTests.cs | 4 +- OpenNest.Tests/CutOffs/CutOffRoundoffTests.cs | 4 +- OpenNest.Tests/CutOffs/CutOffSegmentsTests.cs | 4 +- OpenNest.Tests/CutOffs/CutOffTrimTests.cs | 2 +- .../BestEffortCuttingPlanTests.cs | 12 +-- .../CuttingPlanning/CircleNextCutTests.cs | 22 ++-- .../ContinuedContourCheckTests.cs | 2 +- .../ContourCandidateEmissionTests.cs | 2 +- .../ContourEntryCandidateTests.cs | 44 ++++---- .../ContourEntryFeasibilityTests.cs | 20 ++-- .../ContourEntryRankingTests.cs | 50 ++++----- .../ContourEntrySelectionTests.cs | 8 +- .../ContourRecoveryFileTests.cs | 6 +- .../CutOffSegmentPlanningTests.cs | 2 +- .../CutPinFrameLifecycleTests.cs | 8 +- .../CuttingPlanning/CutPinResolverTests.cs | 2 +- .../CuttingPlanning/CuttingGridOrderTests.cs | 16 +-- .../CuttingPlanning/CuttingHoleOrderTests.cs | 64 ++++++------ .../CuttingNestedOrderTests.cs | 18 ++-- .../CuttingPlanning/CuttingPartOrderTests.cs | 18 ++-- .../CuttingPlanning/CuttingPlanBatchTests.cs | 10 +- .../CuttingPlanning/CuttingPlanCommitTests.cs | 4 +- .../CuttingPlanMessageTests.cs | 8 +- .../CuttingPlanServiceTests.cs | 6 +- .../CuttingPlanning/DrawingPinReviewTests.cs | 10 +- .../CuttingPlanning/ErodedPierceTests.cs | 16 +-- .../CuttingPlanning/HoleDepartureTests.cs | 10 +- .../HoleEndpointBudgetTests.cs | 18 ++-- .../CuttingPlanning/HoleLookAheadTests.cs | 16 +-- .../CuttingPlanning/ImportedArcHoleTests.cs | 8 +- .../IncrementalClosureDriftTests.cs | 4 +- .../InterlockingHoleRouteTests.cs | 10 +- .../CuttingPlanning/JointCuttingPlanTests.cs | 8 +- .../CuttingPlanning/LazyCuttingSearchTests.cs | 10 +- .../LeadPathValidationTests.cs | 2 +- .../MaterialContainmentTests.cs | 2 +- .../NearbyMaterialCheckTests.cs | 14 +-- .../PerimeterLookAheadTests.cs | 26 ++--- .../CuttingPlanning/PierceZoneTests.cs | 20 ++-- .../CuttingPlanning/PinnedContourTests.cs | 2 +- .../CuttingPlanning/PinnedLeadWarningTests.cs | 26 ++--- .../PreferredContourEntriesTests.cs | 54 +++++----- .../ProblemNestRegressionTests.cs | 2 +- .../CuttingPlanning/SeamClosureReplayTests.cs | 2 +- .../CuttingPlanning/SettingsFreshnessTests.cs | 2 +- .../SideCoverageRegressionTests.cs | 2 +- .../SupportTabPlanningTests.cs | 2 +- .../CuttingStrategy/TabbedLeadOutTests.cs | 12 +-- OpenNest.Tests/Data/LedgerCodeCheckTests.cs | 2 +- .../Data/NestDetailsSessionTests.cs | 8 +- OpenNest.Tests/Data/NestNameConflictsTests.cs | 6 +- OpenNest.Tests/Data/RemoteNestHistoryTests.cs | 4 +- .../Diagnostics/NestedPartReviewTests.cs | 4 +- .../Diagnostics/OverlapMarkerTests.cs | 4 +- .../PlateOverlapAnalyzerClampZoneTests.cs | 12 +-- OpenNest.Tests/DrawingProgramSnapshotTests.cs | 2 +- OpenNest.Tests/Engine/PartClassifierTests.cs | 2 +- OpenNest.Tests/Fill/FillExtentsTests.cs | 2 +- .../Fill/OverlapCheckPerformanceTests.cs | 2 +- .../Fill/PartOverlapCheckerTests.cs | 4 +- .../Geometry/CollisionOverlapOnlyTests.cs | 2 +- .../Geometry/DrawingAlignerTests.cs | 4 +- .../Geometry/PolyLabelDifferentialTests.cs | 2 +- OpenNest.Tests/Geometry/PolyLabelTests.cs | 2 +- .../Geometry/PolygonAreaMomentsTests.cs | 4 +- OpenNest.Tests/IO/ConvertedEtchMarkTests.cs | 2 +- OpenNest.Tests/ML/FeatureExtractorTests.cs | 2 +- OpenNest.Tests/PlateCenterPartsTests.cs | 2 +- .../Strategies/FillPipelineTests.cs | 2 +- .../TabbedCutouts/TabbedCutoutBuilderTests.cs | 2 +- OpenNest.Training/sketch-search/README.md | 6 +- OpenNest.Training/sketch-search/search.py | 2 +- .../sketch-search/sketch_common.py | 4 +- OpenNest.Training/sketch-search/train.py | 2 +- .../Controls/CutOffSegmentLabelTests.cs | 4 +- .../Controls/CutSimulationOverlayTests.cs | 2 +- .../Forms/AutoNestFormLedgerStockTests.cs | 2 +- .../Forms/AutoNestFormStockOptionsTests.cs | 2 +- .../Forms/DrawingLibraryFormTests.cs | 2 +- .../Forms/DrawingSetFormsTests.cs | 2 +- .../Forms/ImportBomToSetFormTests.cs | 4 +- .../Forms/LedgerCodeRecheckTests.cs | 2 +- .../Forms/MainFormCharacterizationTests.cs | 2 +- .../Forms/NestValidationFormTests.cs | 2 +- .../Forms/OperationProgressFormTests.cs | 12 +-- .../Forms/UndoRecordingTests.cs | 6 +- OpenNest/Actions/ActionSequenceByPath.cs | 2 +- OpenNest/Controls/DrawingLibraryView.cs | 2 +- OpenNest/Controls/DrawingSetBrowser.cs | 2 +- OpenNest/Controls/EntityView.cs | 4 +- OpenNest/Controls/GridStyle.cs | 2 +- OpenNest/Controls/PlateRenderer.cs | 2 +- OpenNest/Controls/PostSettingsEditor.cs | 2 +- OpenNest/Controls/ReleasePanel.cs | 2 +- OpenNest/Controls/SelectionManager.cs | 8 +- OpenNest/Forms/AddReleaseDrawingsForm.cs | 4 +- OpenNest/Forms/AutoNestForm.cs | 4 +- OpenNest/Forms/AutomaticCutOffForm.cs | 2 +- OpenNest/Forms/CadConverterForm.cs | 4 +- OpenNest/Forms/Commands/AutoNestCommand.cs | 4 +- .../Forms/Commands/NestStorageController.cs | 2 +- OpenNest/Forms/CuttingInspectionPanel.cs | 26 ++--- OpenNest/Forms/EditDrawingSetForm.cs | 4 +- OpenNest/Forms/ImportBomToSetForm.cs | 2 +- OpenNest/Forms/LedgerCodeRecheck.cs | 4 +- OpenNest/Forms/NestDrawingsToSet.cs | 2 +- OpenNest/Forms/OperationProgressForm.cs | 4 +- OpenNest/LayoutPart.cs | 2 +- OpenNest/ToolStripRenderer.cs | 6 +- .../CIFiberProgramWriter.cs | 2 +- README.md | 2 +- docs/automatic-nesting.md | 8 +- docs/automatic-scrap-cutoffs.md | 6 +- docs/breakoffs.md | 2 +- docs/cincinnati-ci-fiber-post-output.md | 2 +- docs/cutting-planner.md | 56 +++++----- docs/geometry/expand-spacing.md | 4 +- docs/geometry/lead-in-placement.md | 16 +-- docs/geometry/pierce-zone.md | 6 +- docs/geometry/visual-overlap-check.md | 2 +- docs/irregular-stock.md | 2 +- docs/nest-storage.md | 10 +- docs/nesting-engines.md | 2 +- docs/performance/fill-verification.md | 2 +- docs/performance/synthetic-nest-validity.md | 2 +- docs/post-verification.md | 2 +- docs/support-tabs.md | 8 +- docs/undo-redo.md | 8 +- ...test_check_synthetic_nests.cpython-313.pyc | Bin 0 -> 15464 bytes scripts/check-synthetic-nests.py | 2 +- scripts/test_ci_results.py | 2 +- scripts/windows-acceptance.json | 14 +-- 230 files changed, 864 insertions(+), 864 deletions(-) create mode 100644 scripts/__pycache__/test_check_synthetic_nests.cpython-313.pyc diff --git a/AGENTS.md b/AGENTS.md index f13be0a2..2c8246b4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -66,7 +66,7 @@ Read the relevant contract before changing its behavior: - [Nest file format](docs/nest-file-format.md) - [Irregular stock](docs/irregular-stock.md): outlined sheets, what honors the outline and what refuses it - [Directional slides](docs/geometry/directional-slides.md) and [pair-spacing limits](docs/geometry/pair-spacing.md) -- [Lead-in placement](docs/geometry/lead-in-placement.md) (including the planner's eroded pierce for cutouts too small for their lead-in and the stop at a feature's centre line) and [pierce zones](docs/geometry/pierce-zone.md): opt-in `PierceDiameter` clearance, the hole pole fallback and the planner's perimeter scrap fallback +- [Lead-in placement](docs/geometry/lead-in-placement.md) (including the planner's eroded pierce for cutouts too small for their lead-in and the stop at a feature's center line) and [pierce zones](docs/geometry/pierce-zone.md): opt-in `PierceDiameter` clearance, the hole pole fallback and the planner's perimeter scrap fallback - [Breakoffs](docs/breakoffs.md): tabbed scrap; `Break`-layer open cuts that are cut but are not material - [Tabbed cutouts](docs/tabbed-cutouts.md): holes cut in pieces around `Tab`-layer spans that are material but never cut; nesting reads material through `NestingMaterial.ForNesting`, so nothing nests in them - [Support tabs](docs/support-tabs.md): the nest's support grid, the center-of-gravity check, and Plan Cutting's tab placement for parts the grid cannot hold level diff --git a/OpenNest.Console/Program.cs b/OpenNest.Console/Program.cs index d52a5097..9f8c450e 100644 --- a/OpenNest.Console/Program.cs +++ b/OpenNest.Console/Program.cs @@ -35,7 +35,7 @@ static class NestConsole } catch (OperationCanceledException) { - Console.Error.WriteLine("Nesting cancelled; nothing saved."); + Console.Error.WriteLine("Nesting canceled; nothing saved."); return 2; } catch (Exception ex) diff --git a/OpenNest.Core/Breakoffs/BreakoffBuilder.cs b/OpenNest.Core/Breakoffs/BreakoffBuilder.cs index 883c2b80..a8c8efa9 100644 --- a/OpenNest.Core/Breakoffs/BreakoffBuilder.cs +++ b/OpenNest.Core/Breakoffs/BreakoffBuilder.cs @@ -8,7 +8,7 @@ namespace OpenNest.Breakoffs { /// /// Resolves and applies s: the joining line becomes open cuts on the - /// break layer between tabs, each travelling with the scrap on its left so the cutting + /// break layer between tabs, each traveling with the scrap on its left so the cutting /// strategies pierce and lead in from the scrap. /// public static class BreakoffBuilder diff --git a/OpenNest.Core/Breakoffs/BreakoffLayout.cs b/OpenNest.Core/Breakoffs/BreakoffLayout.cs index d255dbfd..e0cd288a 100644 --- a/OpenNest.Core/Breakoffs/BreakoffLayout.cs +++ b/OpenNest.Core/Breakoffs/BreakoffLayout.cs @@ -49,7 +49,7 @@ namespace OpenNest.Breakoffs /// /// for tab limited so the tab stays on the - /// joining line and keeps a gap from its neighbours. + /// joining line and keeps a gap from its neighbors. /// public double ClampTabCenter(int index, double center) { diff --git a/OpenNest.Core/CNC/CuttingPlanning/ContourEntryCandidate.cs b/OpenNest.Core/CNC/CuttingPlanning/ContourEntryCandidate.cs index 68e00051..eb0e7195 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/ContourEntryCandidate.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/ContourEntryCandidate.cs @@ -53,7 +53,7 @@ internal enum AutomaticEntryKind /// /// Which automatic entries a perimeter tabbed for support offers (see -/// ); every other contour offers its whole catalogue. +/// ); every other contour offers its whole catalog. /// internal enum SupportEntries { diff --git a/OpenNest.Core/CNC/CuttingPlanning/ContourEntryRanking.cs b/OpenNest.Core/CNC/CuttingPlanning/ContourEntryRanking.cs index 30dde691..78c027c8 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/ContourEntryRanking.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/ContourEntryRanking.cs @@ -7,7 +7,7 @@ using OpenNest.Geometry; namespace OpenNest.CNC.CuttingPlanning; /// -/// Pure deterministic ordering of the automatic entry catalogue toward the next cut: +/// Pure deterministic ordering of the automatic entry catalog toward the next cut: /// circles rank by outgoing distance; other contours use facing sides, tier and travel, /// then a stable geometric key. It adds no /// candidates, mutates nothing, runs no lead checks and applies no cap — feasibility @@ -62,12 +62,12 @@ internal static class ContourEntryRanking if (p.Y > maxY) maxY = p.Y; } - // Facing sides from the target relative to the centre, matching the source plan: - // horizontal right when the target is right of centre else left; vertical likewise. - var centreX = minX + (maxX - minX) * 0.5; - var centreY = minY + (maxY - minY) * 0.5; - var facingRight = target != null && target.Value.X > centreX; - var facingTop = target != null && target.Value.Y > centreY; + // Facing sides from the target relative to the center, matching the source plan: + // horizontal right when the target is right of center else left; vertical likewise. + var centerX = minX + (maxX - minX) * 0.5; + var centerY = minY + (maxY - minY) * 0.5; + var facingRight = target != null && target.Value.X > centerX; + var facingTop = target != null && target.Value.Y > centerY; return candidates .Select(c => (Candidate: c, Score: Score(c, minX, minY, maxX, maxY, facingRight, facingTop, target, arrival))) diff --git a/OpenNest.Core/CNC/CuttingPlanning/CuttingPlanCommit.cs b/OpenNest.Core/CNC/CuttingPlanning/CuttingPlanCommit.cs index 91089c43..63b39dc2 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/CuttingPlanCommit.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/CuttingPlanCommit.cs @@ -62,7 +62,7 @@ public enum CuttingCommitStatus Applied, Stale, InvalidInput, - Cancelled, + Canceled, Failed } @@ -107,7 +107,7 @@ internal static class CuttingPlanCommit Action beforeInstall) { if (token.IsCancellationRequested) - return new(CuttingCommitStatus.Cancelled, "Cancelled before commit."); + return new(CuttingCommitStatus.Canceled, "Canceled before commit."); var scope = plans?.ToArray(); if (scope == null || scope.Length == 0 || scope.Any(p => p?.Expected == null || p.Order == null)) return Invalid(null, "A nonempty set of captured plate plans is required."); @@ -126,7 +126,7 @@ internal static class CuttingPlanCommit } catch (OperationCanceledException) { - return new(CuttingCommitStatus.Cancelled, "Cancelled before commit."); + return new(CuttingCommitStatus.Canceled, "Canceled before commit."); } if (difference != null) return new(CuttingCommitStatus.Stale, difference, plan.Expected.Plate); @@ -200,7 +200,7 @@ internal static class CuttingPlanCommit // Last cancellation point. The boundary below has no await, search or geometry work. if (token.IsCancellationRequested) - return new(CuttingCommitStatus.Cancelled, "Cancelled before commit."); + return new(CuttingCommitStatus.Canceled, "Canceled before commit."); var undo = new List<(Plate Plate, Part[] Order, (Part Part, PartCuttingState State)[] States, (CutOff CutOff, bool FarEdgeFirst, Program Program)[] CutOffs)>(); diff --git a/OpenNest.Core/CNC/CuttingPlanning/IncrementalClosureDrift.cs b/OpenNest.Core/CNC/CuttingPlanning/IncrementalClosureDrift.cs index e73d6a67..14a09b0c 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/IncrementalClosureDrift.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/IncrementalClosureDrift.cs @@ -79,7 +79,7 @@ internal static class IncrementalClosureDrift var endPoint = last.EndPoint + correction; if (last is ArcMove arc) { - // Keep the arc's centre (relative to its start) equidistant from its moved end. + // Keep the arc's center (relative to its start) equidistant from its moved end. var chord = endPoint.DistanceTo(new Vector()); if (chord <= Tolerance.Epsilon) return false; diff --git a/OpenNest.Core/CNC/CuttingPlanning/PreparedContours.cs b/OpenNest.Core/CNC/CuttingPlanning/PreparedContours.cs index 7d3022ac..9b079b8c 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/PreparedContours.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/PreparedContours.cs @@ -180,7 +180,7 @@ public sealed class PreparedContours /// False when the outside is a display perimeter that is never cut: all contours are holes. public bool HasCutPerimeter => hasCutPerimeter; - /// Resolved pins this preparation could not honour: a tab on an internal contour. + /// Resolved pins this preparation could not honor: a tab on an internal contour. public IReadOnlyList RejectedPins { get; } = Array.Empty(); /// True when a drawing pin fixes this contour's entry, leads and tab. @@ -512,7 +512,7 @@ public sealed class PreparedContours } /// - /// The uncapped preferred automatic start catalogue for one contour, in preference then + /// The uncapped preferred automatic start catalog for one contour, in preference then /// contour-travel order: convex corners of the contour's own winding, then straight-edge /// midpoints, then tangent line/arc joints. Reflex and cusp vertices, collinear /// line/line splits, circles and interior points never appear; each geometric point is @@ -528,12 +528,12 @@ public sealed class PreparedContours if (pinned[contourOrdinal] is { } pin) return new[] { new ContourEntryCandidate(pin, AutomaticEntryKind.Pinned) }; if (IsSingleCircle(shape)) - throw new ArgumentException("Circles have no preferred corners or joints; use the fallback catalogue."); + throw new ArgumentException("Circles have no preferred corners or joints; use the fallback catalog."); return SupportFiltered(contourOrdinal, PreferredCandidates(shape, contourOrdinal, token), SupportEntries.Steadying); } /// - /// The complete uncapped automatic start catalogue: the preferred points of + /// The complete uncapped automatic start catalog: the preferred points of /// followed by tier-3 fallbacks — native arc /// midpoints, near-convex-corner points on straight edges, the eight compass points of a /// whole circle, and the exact target-facing closest point toward @@ -541,7 +541,7 @@ public sealed class PreparedContours /// A pure-circle contour therefore yields compass points instead of refusing. Every /// fallback passes the same reflex/cusp exclusion and geometric duplicate merge as the /// preferred tier; fallbacks never replace a preferred point at the same geometry. A - /// pinned contour's catalogue is its pinned entry alone: nothing may relocate it. + /// pinned contour's catalog is its pinned entry alone: nothing may relocate it. /// internal IReadOnlyList AutomaticEntryCandidatesWithFallbacks( int contourOrdinal, @@ -562,7 +562,7 @@ public sealed class PreparedContours /// /// Whether this preparation tabs its perimeter for support (see ): - /// its automatic catalogue then keeps to steadying points unless asked for a fallback. + /// its automatic catalog then keeps to steadying points unless asked for a fallback. /// internal bool HasSupportTab => support != null && !IsPinned(PerimeterOrdinal); @@ -603,7 +603,7 @@ public sealed class PreparedContours /// Preferred tier: convex corners, straight midpoints, tangent joints. private List PreferredCandidates(Shape shape, int contourOrdinal, CancellationToken token) - => CataloguePoints(shape, token) + => CatalogPoints(shape, token) .Select(p => new ContourEntryCandidate(Entry(contourOrdinal, p.EntityOrdinal, p.Point), p.Kind, p.CornerReach)) .ToList(); @@ -649,7 +649,7 @@ public sealed class PreparedContours // endpoint and so never lands on the reflex/cusp vertex at the far end. if (lead > 0 && !(count == 1 && shape.Entities[0] is Circle)) { - foreach (var corner in CataloguePoints(shape, token) + foreach (var corner in CatalogPoints(shape, token) .Where(p => p.Kind == AutomaticEntryKind.ConvexCorner)) { token.ThrowIfCancellationRequested(); @@ -763,13 +763,13 @@ public sealed class PreparedContours }; /// - /// The preferred catalogue points for one contour: for each entity, its convex corner + /// The preferred catalog points for one contour: for each entity, its convex corner /// (end vertex, classified from the contour's own winding) and its straight-edge midpoint, /// plus tangent line/arc joints. The joints of a corner fillet (see ) /// are that corner's convex corners. Reflex, cusp and collinear-split vertices contribute /// nothing; a single whole circle yields no points at all. /// - private List<(int EntityOrdinal, Vector Point, AutomaticEntryKind Kind, double CornerReach)> CataloguePoints( + private List<(int EntityOrdinal, Vector Point, AutomaticEntryKind Kind, double CornerReach)> CatalogPoints( Shape shape, CancellationToken token) { var found = new List<(int, Vector, AutomaticEntryKind, double)>(); @@ -787,7 +787,7 @@ public sealed class PreparedContours token.ThrowIfCancellationRequested(); var entity = shape.Entities[i]; - // Vertex reached by travelling along entity i (its end point), reported under + // Vertex reached by traveling along entity i (its end point), reported under // entity i. The closed contour guarantees every vertex appears exactly once // this way; each is classified from the contour's own winding. var vertex = End(entity); @@ -965,20 +965,20 @@ public sealed class PreparedContours ? throw new ArgumentException("Foreign contour ordinal.") : shapes[ordinal]; /// - /// Representative POINTS per contour ordinal (bounding-box centre) for hole routing + /// Representative POINTS per contour ordinal (bounding-box center) for hole routing /// only — the S10 CuttingHoleOrder proxy. The perimeter has no entry; it is the /// route's fixed endpoint, not a stop. These are ordering proxies, never cut points. /// - internal IReadOnlyList HoleCentres(CancellationToken token = default) + internal IReadOnlyList HoleCenters(CancellationToken token = default) { token.ThrowIfCancellationRequested(); - var centres = new Vector?[Count]; + var centers = new Vector?[Count]; for (var contour = 0; contour < PerimeterOrdinal; contour++) { token.ThrowIfCancellationRequested(); - centres[contour] = GetShape(contour).BoundingBox.Center; + centers[contour] = GetShape(contour).BoundingBox.Center; } - return centres; + return centers; } /// The bounding box of contour , local. A routing hint only. @@ -1000,7 +1000,7 @@ public sealed class PreparedContours /// which treat a point within of an endpoint as that endpoint and /// start the contour there. An entry that close to a vertex is that vertex, so the lead-in ends /// where the contour starts: otherwise the span between them (5e-8 in on imported arcs whose - /// stored centre sits beside the chord's midpoint) is never cut. + /// stored center sits beside the chord's midpoint) is never cut. /// private static Vector SnapToVertex(Shape shape, int entityOrdinal, Vector point) { diff --git a/OpenNest.Core/CNC/CuttingPlanning/ReleasedContourState.cs b/OpenNest.Core/CNC/CuttingPlanning/ReleasedContourState.cs index 34fcb6ce..87db463b 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/ReleasedContourState.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/ReleasedContourState.cs @@ -343,7 +343,7 @@ public sealed class ReleasedContourState /// contour with its own leads already encloses whatever it releases and counts as one node. /// Open cuts may touch any cut only at their own ends, and must form no loop through those /// nodes or each other: a forest of open paths separates no region of the sheet. Kerf and - /// tab strength are not modelled, exactly as for a single open contour. + /// tab strength are not modeled, exactly as for a single open contour. /// private const double JointTolerance = 1e-5; diff --git a/OpenNest.Core/CNC/CuttingPlanning/SeamOvercut.cs b/OpenNest.Core/CNC/CuttingPlanning/SeamOvercut.cs index 13261612..687feb6c 100644 --- a/OpenNest.Core/CNC/CuttingPlanning/SeamOvercut.cs +++ b/OpenNest.Core/CNC/CuttingPlanning/SeamOvercut.cs @@ -160,7 +160,7 @@ internal static class SeamOvercut return true; } - /// The angle travelled around from one point to another, in [0, 2pi). + /// The angle traveled around from one point to another, in [0, 2pi). private static double Travel(Vector center, Vector from, Vector to, bool clockwise) { var start = System.Math.Atan2(from.Y - center.Y, from.X - center.X); diff --git a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs index 239c2425..b1a3d149 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs @@ -315,7 +315,7 @@ namespace OpenNest.CNC.CuttingStrategy EmitContour(result, shape, choice.Point, shape.Entities[choice.EntityOrdinal], choice.ContourOrdinal == perimeterOrdinal ? ContourType.External : null, exactCirclePrograms: true, scrapPierce: choice.Pierce, - stopAtCentreLine: contourParameters?[choice.ContourOrdinal] == null); + stopAtCenterLine: contourParameters?[choice.ContourOrdinal] == null); } } finally @@ -442,7 +442,7 @@ namespace OpenNest.CNC.CuttingStrategy ContourType? forceType = null, bool exactCirclePrograms = false, Vector? scrapPierce = null, - bool stopAtCentreLine = false + bool stopAtCenterLine = false ) { var contourType = forceType ?? DetectContourType(shape); @@ -474,8 +474,8 @@ namespace OpenNest.CNC.CuttingStrategy leadIn = StraightLeadIn(point, holePierce, out normal); else { - if (stopAtCentreLine) - leadIn = StopAtCentreLine(shape, point, leadIn, normal, winding); + if (stopAtCenterLine) + leadIn = StopAtCenterLine(shape, point, leadIn, normal, winding); leadIn = ClampLeadInForCircle(leadIn, circle, point, normal, Parameters.GetEffectivePierceClearance()); leadIn = ResolvePierceZone(shape, point, leadIn, normal, Parameters.GetPierceZoneRadius(), winding); @@ -529,8 +529,8 @@ namespace OpenNest.CNC.CuttingStrategy Parameters.GetEffectivePierceClearance(), out leadInNormal); if (contourType == ContourType.Internal) { - if (stopAtCentreLine) - leadIn = StopAtCentreLine(shape, point, leadIn, leadInNormal, turn); + if (stopAtCenterLine) + leadIn = StopAtCenterLine(shape, point, leadIn, leadInNormal, turn); leadIn = ResolvePierceZone(shape, point, leadIn, leadInNormal, Parameters.GetPierceZoneRadius(), turn); } } @@ -1067,10 +1067,10 @@ namespace OpenNest.CNC.CuttingStrategy /// Keeps a hole's lead-in pierce clear of the hole wall. /// A lead-in whose pierce already keeps it, or that pierces on the contour itself, is /// returned as given. Otherwise the pierce moves straight in from the wall to the hole's - /// centre line, or the lead's own length in when that comes first (see - /// ). A lead that cannot keep the zone there moves onto the + /// center line, or the lead's own length in when that comes first (see + /// ). A lead that cannot keep the zone there moves onto the /// line from toward the nearest point that keeps it (see - /// ) or else the hole's pole of inaccessibility (the centre of a + /// ) or else the hole's pole of inaccessibility (the center of a /// round hole), as close to the contour as the zone allows. Either way the lead becomes /// a straight line from there, generated with . A hole too small /// for the zone is pierced at the pole itself, its best clearance; the lead validator and @@ -1094,7 +1094,7 @@ namespace OpenNest.CNC.CuttingStrategy if (Clear(configured)) return leadIn; - var depth = CentreLineDepth(hole, point, normal, configured.DistanceTo(point)); + var depth = CenterLineDepth(hole, point, normal, configured.DistanceTo(point)); if (depth > Math.Tolerance.Epsilon && Clear(point + Inward(normal) * depth)) return new LineLeadIn { Length = depth, ApproachAngle = 90 }; @@ -1104,7 +1104,7 @@ namespace OpenNest.CNC.CuttingStrategy return leadIn; // The pole of a letter can be a stroke away: head for the stroke beside the entry, on - // its centre line when the lead reaches that far. + // its center line when the lead reaches that far. var reach = configured.DistanceTo(point); var toward = pole; if (circle == null && ErodedPierce.Find(hole, System.Math.Max(pierceRadius, reach), new[] { point }, 1) @@ -1148,14 +1148,14 @@ namespace OpenNest.CNC.CuttingStrategy /// /// Keeps a cutout's lead-in out of the cutout's far half. A lead longer than the cutout is - /// deep at its entry, measured straight in from the wall to the centre line where the walls - /// meet as the cutout erodes, reaches past the centre line or runs along a narrow stroke, as + /// deep at its entry, measured straight in from the wall to the center line where the walls + /// meet as the cutout erodes, reaches past the center line or runs along a narrow stroke, as /// does one whose own line gets closer to a wall again. It becomes a straight one, generated - /// with , from that centre line (the centre of a round hole) or + /// with , from that center line (the center of a round hole) or /// from the lead's own length in when that comes first. Any other lead keeps its shape, and /// one that leaves a cutout other than a round hole is left for the lead check to refuse. /// - public static LeadIn StopAtCentreLine(Shape hole, Vector point, LeadIn leadIn, double normal, RotationType turn) + public static LeadIn StopAtCenterLine(Shape hole, Vector point, LeadIn leadIn, double normal, RotationType turn) { if (leadIn is NoLeadIn || !hole.IsClosed()) return leadIn; @@ -1172,42 +1172,42 @@ namespace OpenNest.CNC.CuttingStrategy if (inside && Clearance(hole, pierce) >= along.X * inward.X + along.Y * inward.Y - Math.Tolerance.Epsilon) return leadIn; - var depth = CentreLineDepth(hole, point, normal, length); + var depth = CenterLineDepth(hole, point, normal, length); if (depth <= Math.Tolerance.Epsilon || inside && depth >= length - Math.Tolerance.Epsilon && !PeaksBeforeItsEnd(hole, point, along)) return leadIn; if (circle == null) { var polygon = hole.ToPolygonWithTolerance(Math.Tolerance.ChainTolerance); - for (var i = 1; i <= CentreLineSteps; i++) - if (!polygon.ContainsPoint(point + along * ((double)i / CentreLineSteps))) + for (var i = 1; i <= CenterLineSteps; i++) + if (!polygon.ContainsPoint(point + along * ((double)i / CenterLineSteps))) return leadIn; } return new LineLeadIn { Length = depth, ApproachAngle = 90 }; } // How far a straight line in from the wall runs, up to maxDepth, before it reaches the - // centre line: the distance to the wall grows at a steady rate until a second wall is as + // center line: the distance to the wall grows at a steady rate until a second wall is as // near, then levels off along a stroke or falls. - private static double CentreLineDepth(Shape hole, Vector point, double normal, double maxDepth) + private static double CenterLineDepth(Shape hole, Vector point, double normal, double maxDepth) { if (hole.Entities.Count == 1 && hole.Entities[0] is Circle circle) return System.Math.Min(maxDepth, circle.Radius); var inward = Inward(normal); - var step = maxDepth / CentreLineSteps; + var step = maxDepth / CenterLineSteps; var rate = Clearance(hole, point + inward * step) / step; // A corner's curved lead keeps an edge's normal, which runs along the other edge. - if (rate < MinimumCentreLineRate) + if (rate < MinimumCenterLineRate) return maxDepth; - bool Rising(double depth) => Clearance(hole, point + inward * (depth + step / CentreLineSteps)) - - Clearance(hole, point + inward * depth) >= rate / 2 * (step / CentreLineSteps); - for (var i = 1; i < CentreLineSteps; i++) + bool Rising(double depth) => Clearance(hole, point + inward * (depth + step / CenterLineSteps)) + - Clearance(hole, point + inward * depth) >= rate / 2 * (step / CenterLineSteps); + for (var i = 1; i < CenterLineSteps; i++) { if (Rising(step * i)) continue; double low = step * (i - 1), high = step * i; - for (var refine = 0; refine < CentreLineRefinements; refine++) + for (var refine = 0; refine < CenterLineRefinements; refine++) { var middle = (low + high) / 2; if (Rising(middle)) @@ -1223,9 +1223,9 @@ namespace OpenNest.CNC.CuttingStrategy private static bool PeaksBeforeItsEnd(Shape hole, Vector point, Vector along) { var peak = 0.0; - for (var i = 1; i <= CentreLineSteps; i++) + for (var i = 1; i <= CenterLineSteps; i++) { - var clearance = Clearance(hole, point + along * ((double)i / CentreLineSteps)); + var clearance = Clearance(hole, point + along * ((double)i / CenterLineSteps)); if (clearance < peak - Math.Tolerance.Epsilon) return true; peak = System.Math.Max(peak, clearance); @@ -1250,10 +1250,10 @@ namespace OpenNest.CNC.CuttingStrategy // Bounds the pole search on long, thin holes; the result is checked before use. private const int PoleSearchCells = 4096; - // Samples along a lead when looking for the centre line, then the steps narrowing in on it. - private const int CentreLineSteps = 64; - private const int CentreLineRefinements = 16; - private const double MinimumCentreLineRate = 0.01; + // Samples along a lead when looking for the center line, then the steps narrowing in on it. + private const int CenterLineSteps = 64; + private const int CenterLineRefinements = 16; + private const double MinimumCenterLineRate = 0.01; private LeadIn SelectLeadIn(ContourType contourType) { @@ -1451,7 +1451,7 @@ namespace OpenNest.CNC.CuttingStrategy } /// - /// Where a break cut (travelling with its scrap on the left) is entered: the end with more + /// Where a break cut (traveling with its scrap on the left) is entered: the end with more /// scrap before , the unit direction into the scrap there, and /// whether that is the cut's far end. /// diff --git a/OpenNest.Core/CNC/CuttingStrategy/ErodedPierce.cs b/OpenNest.Core/CNC/CuttingStrategy/ErodedPierce.cs index 25c53b4d..d0fb5c86 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/ErodedPierce.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/ErodedPierce.cs @@ -20,9 +20,9 @@ namespace OpenNest.CNC.CuttingStrategy /// The pierce search for cutouts too small for their configured lead-in (text, slots, small /// holes): erode the cutout inward, as a laser kerf offset would, and pierce in what is left. /// The erosion goes as deep as the caller asks when the cutout has room for it, else almost - /// to its pole of inaccessibility; a round hole is pierced at its centre. Each target, an entry the planner ranked, gets the + /// to its pole of inaccessibility; a round hole is pierced at its center. Each target, an entry the planner ranked, gets the /// nearest point of the deepest erosion that still reaches the wall beside it, stepping down to - /// half that depth: a letter stroke is pierced on its own centre line next to the entry, and + /// half that depth: a letter stroke is pierced on its own center line next to the entry, and /// only a target with no stroke beside it falls back to the deepest place. The lead then runs /// straight from the pierce to the wall. /// @@ -30,7 +30,7 @@ namespace OpenNest.CNC.CuttingStrategy { /// /// The share of a cutout's inscribed radius the erosion keeps when the full clearance does - /// not fit: deep enough to stay near the centre line, with room for every place the + /// not fit: deep enough to stay near the center line, with room for every place the /// cutout is about as wide as its widest. /// public const double DepthFraction = 0.9; @@ -86,7 +86,7 @@ namespace OpenNest.CNC.CuttingStrategy return new(targets.Take(max).Select(_ => pole).ToArray(), inscribed); // Each target gets the deepest level that reaches the wall beside it: a stroke - // narrower than the cutout's widest place is still pierced on its own centre line, near + // narrower than the cutout's widest place is still pierced on its own center line, near // the entry, rather than only at the widest place. var pierces = new List(); var shallowest = depth; diff --git a/OpenNest.Core/CutOff.cs b/OpenNest.Core/CutOff.cs index 14fbabfd..27569d6f 100644 --- a/OpenNest.Core/CutOff.cs +++ b/OpenNest.Core/CutOff.cs @@ -253,7 +253,7 @@ namespace OpenNest /// True when , the placed part of , cuts /// one continuous straight line on the definition's axis across the whole sheet, so it /// splits the sheet in two. Anything else (gaps around parts, limits short of an edge, a - /// line on the sheet edge, a stale or unrecognised program) does not separate the sheet. + /// line on the sheet edge, a stale or unrecognized program) does not separate the sheet. /// internal static bool SeparatesSheet(Part part, CutOff definition, Box sheet) { @@ -347,7 +347,7 @@ namespace OpenNest } // An outlined sheet is cut only where the line crosses material: each crossing is a - // span of its own, started at the material's edge and overtravelled past the far + // span of its own, started at the material's edge and overtraveled past the far // one, within the user's limits. var spans = plate.Outline == null ? new List<(double Start, double End)> { (lineStart, lineEnd) } diff --git a/OpenNest.Core/CutOffTrim.cs b/OpenNest.Core/CutOffTrim.cs index 8ee81563..5afe3f5b 100644 --- a/OpenNest.Core/CutOffTrim.cs +++ b/OpenNest.Core/CutOffTrim.cs @@ -61,8 +61,8 @@ namespace OpenNest /// /// Trims and extends cut-offs against the cut-offs that cross them, by changing only their /// start and end limits and their gaps (see docs/automatic-scrap-cutoffs.md, "Trim and - /// extend"). A trim stops on the crossing line's centre, inside its kerf; trimming a piece - /// between two crossing lines leaves a gap from one centre to the other. An extend closes the + /// extend"). A trim stops on the crossing line's center, inside its kerf; trimming a piece + /// between two crossing lines leaves a gap from one center to the other. An extend closes the /// gap at the picked end, or runs the line's end to the next crossing line beyond it, or to /// the sheet edge, which clears the limit. /// diff --git a/OpenNest.Core/Diagnostics/OverlapMarker.cs b/OpenNest.Core/Diagnostics/OverlapMarker.cs index 35b2747e..162457ca 100644 --- a/OpenNest.Core/Diagnostics/OverlapMarker.cs +++ b/OpenNest.Core/Diagnostics/OverlapMarker.cs @@ -48,13 +48,13 @@ internal static class OverlapMarker point = default; var minY = outline.Min(vertex => vertex.Y); var maxY = outline.Max(vertex => vertex.Y); - var centre = (minY + maxY) / 2; + var center = (minY + maxY) / 2; double below = minY, above = maxY; foreach (var vertex in outline.Concat(holes.SelectMany(hole => hole))) { - if (vertex.Y <= centre && vertex.Y > below) + if (vertex.Y <= center && vertex.Y > below) below = vertex.Y; - else if (vertex.Y > centre && vertex.Y < above) + else if (vertex.Y > center && vertex.Y < above) above = vertex.Y; } var y = (below + above) / 2; diff --git a/OpenNest.Core/Diagnostics/PlateOverlapAnalyzer.cs b/OpenNest.Core/Diagnostics/PlateOverlapAnalyzer.cs index ffa0d9e6..24974d15 100644 --- a/OpenNest.Core/Diagnostics/PlateOverlapAnalyzer.cs +++ b/OpenNest.Core/Diagnostics/PlateOverlapAnalyzer.cs @@ -348,10 +348,10 @@ public static class PlateOverlapAnalyzer new Vector(zone.Right, zone.Top), new Vector(zone.Left, zone.Top), new Vector(zone.Left, zone.Bottom), // Regions repeat their closing vertex exactly. }; - var centre = new Vector((zone.Left + zone.Right) / 2, (zone.Bottom + zone.Top) / 2); + var center = new Vector((zone.Left + zone.Right) / 2, (zone.Bottom + zone.Top) / 2); return new PlateOverlapPair(part.Input.Id, ClampFindingSlot.IdFor(clamp.Ordinal), part.Input.Name, - $"Clamp '{clamp.Id}'", new List { new(corners, zone.Length * zone.Width) }, centre, - centre); + $"Clamp '{clamp.Id}'", new List { new(corners, zone.Length * zone.Width) }, center, + center); } private static Polygon RectanglePolygon(Box box, Vector offset) diff --git a/OpenNest.Core/Diagnostics/PlateOverlapReport.cs b/OpenNest.Core/Diagnostics/PlateOverlapReport.cs index 429e7274..73227037 100644 --- a/OpenNest.Core/Diagnostics/PlateOverlapReport.cs +++ b/OpenNest.Core/Diagnostics/PlateOverlapReport.cs @@ -95,7 +95,7 @@ public sealed class PlateOverlapPair /// its pole of inaccessibility, or an interior scan-line point when a thin island defeats /// the bounded pole search. Markers, hit testing and inspection rings use this point. /// A tolerance-free tiny-clamp finding (a clamp narrower than the chord tolerance) keeps - /// its conservative whole-clamp region, so its marker is the clamp's centre, within half + /// its conservative whole-clamp region, so its marker is the clamp's center, within half /// the clamp's size of the material. Returned by value. /// public Vector Marker { get; } diff --git a/OpenNest.Core/Diagnostics/PostVerificationGeometry.cs b/OpenNest.Core/Diagnostics/PostVerificationGeometry.cs index be82e0f5..c87e3152 100644 --- a/OpenNest.Core/Diagnostics/PostVerificationGeometry.cs +++ b/OpenNest.Core/Diagnostics/PostVerificationGeometry.cs @@ -49,7 +49,7 @@ internal static class PostVerificationGeometry /// /// The relative rounding allowance of native line/circle intersections. Their discriminant /// b^2 - 4ac cancels: its absolute error stays below about 30 units of roundoff times - /// |d1|^2 (|d2|^2 + r^2) (d1 the line, d2 from the circle's centre to the line's start), so a + /// |d1|^2 (|d2|^2 + r^2) (d1 the line, d2 from the circle's center to the line's start), so a /// spurious root can lie at most about 1e-7 times the span of both extents beyond the true /// distance between line and circle (about 2e-9 is seen in practice). A long lead beside a /// small circle needs the full check; a short lead beside a nearby part does not. @@ -473,11 +473,11 @@ internal static class PostVerificationGeometry point.X - Center.Value.X)) <= System.Math.Abs(Sweep) + Epsilon / Radius || point.DistanceTo(Start) <= Epsilon || point.DistanceTo(End) <= Epsilon; - // How far past r^2 a squared distance from the centre still counts as touching the arc. + // How far past r^2 a squared distance from the center still counts as touching the arc. // For small arcs this band reaches well beyond the radius (sqrt(1e-8) = 1e-4 as r -> 0). private double ContactSlack => Epsilon * System.Math.Max(1, Radius * 2); - // The largest distance from the centre that ContactAfterStart can count as contact. + // The largest distance from the center that ContactAfterStart can count as contact. private double ContactReach => System.Math.Sqrt(Radius * Radius + ContactSlack); internal bool ContactAfterStart(Vector origin, Vector direction, double length, diff --git a/OpenNest.Core/Geometry/Collision.cs b/OpenNest.Core/Geometry/Collision.cs index 43def041..2c9c2fdc 100644 --- a/OpenNest.Core/Geometry/Collision.cs +++ b/OpenNest.Core/Geometry/Collision.cs @@ -7,7 +7,7 @@ namespace OpenNest.Geometry /// /// Polygon overlap test with hole subtraction, used by engine and validation per-pair /// checks. It was written as the reference for a GPU kernel; that port is on hold in - /// favour of Clipper2, starting with the material-overlap diagnostic. Engine callers + /// favor of Clipper2, starting with the material-overlap diagnostic. Engine callers /// stay on this kernel until a Clipper2 near-contact differential and the layout gate /// pass. /// diff --git a/OpenNest.Core/Geometry/DrawingAligner.cs b/OpenNest.Core/Geometry/DrawingAligner.cs index 2947f872..1f9748f8 100644 --- a/OpenNest.Core/Geometry/DrawingAligner.cs +++ b/OpenNest.Core/Geometry/DrawingAligner.cs @@ -44,7 +44,7 @@ namespace OpenNest.Geometry /// /// Aligns onto . /// Both programs are treated as read-only. Throws - /// only when cancelled before any + /// only when canceled before any /// measurable work; work limits reached mid-run are reported as reasons on /// the result instead. /// diff --git a/OpenNest.Core/Geometry/KeepOutOverlap.cs b/OpenNest.Core/Geometry/KeepOutOverlap.cs index 32644360..da5b8592 100644 --- a/OpenNest.Core/Geometry/KeepOutOverlap.cs +++ b/OpenNest.Core/Geometry/KeepOutOverlap.cs @@ -69,7 +69,7 @@ public static class KeepOutOverlap /// /// True when the material (perimeter minus holes) shares positive area with the open /// rectangle: some boundary edge runs through its interior, or its interior lies wholly - /// inside the material (tested at its centre). + /// inside the material (tested at its center). /// public static bool MaterialEnters(Polygon perimeter, IReadOnlyList holes, Box box) { @@ -80,12 +80,12 @@ public static class KeepOutOverlap if (RingEnters(hole, box)) return true; - var centre = new Vector((box.Left + box.Right) / 2, (box.Bottom + box.Top) / 2); - if (!Contains(perimeter, centre)) + var center = new Vector((box.Left + box.Right) / 2, (box.Bottom + box.Top) / 2); + if (!Contains(perimeter, center)) return false; if (holes != null) foreach (var hole in holes) - if (Contains(hole, centre)) + if (Contains(hole, center)) return false; return true; } diff --git a/OpenNest.Core/Geometry/MaximalRectangles.cs b/OpenNest.Core/Geometry/MaximalRectangles.cs index b4204f48..a32463fd 100644 --- a/OpenNest.Core/Geometry/MaximalRectangles.cs +++ b/OpenNest.Core/Geometry/MaximalRectangles.cs @@ -19,7 +19,7 @@ public static class MaximalRectangles /// /// The grid has a line through every vertex coordinate plus /// evenly spaced lines per axis. A cell is free only when no edge passes through its - /// interior and its centre is inside the region, so results are exact for regions whose + /// interior and its center is inside the region, so results are exact for regions whose /// edges are all horizontal or vertical. Slanted and curved edges are followed as a /// staircase: results stay inside, but can fall short of the true maximum by up to about /// one cell on each side. Rotate the region to search other rectangle angles. @@ -64,9 +64,9 @@ public static class MaximalRectangles var crossings = new List(); for (var r = 0; r < rows; r++) { - // Even-odd scan along the row's centre line. No vertex lies on it, and an edge that + // Even-odd scan along the row's center line. No vertex lies on it, and an edge that // meets it strictly inside a cell has already marked that cell crossed, so each - // uncrossed cell is on the same side as its centre. + // uncrossed cell is on the same side as its center. var y = (ys[r] + ys[r + 1]) / 2; crossings.Clear(); foreach (var path in paths) diff --git a/OpenNest.Core/Geometry/PolyLabel.cs b/OpenNest.Core/Geometry/PolyLabel.cs index 7bcef39b..4677cd01 100644 --- a/OpenNest.Core/Geometry/PolyLabel.cs +++ b/OpenNest.Core/Geometry/PolyLabel.cs @@ -17,7 +17,7 @@ namespace OpenNest.Geometry /// /// Bounded search for callers that cannot afford refinement along a long thin shape: /// stops after about distance evaluations and returns the best - /// cell centre so far. When the starting grid would exceed a quarter of the budget it is + /// cell center so far. When the starting grid would exceed a quarter of the budget it is /// coarsened so the whole shape is sampled first. The result can lie outside a shape /// thinner than the remaining refinement, so callers must check it. /// @@ -157,7 +157,7 @@ namespace OpenNest.Geometry halfCell = cell.HalfSize / 2; - // Far from the origin a half-step may no longer move the centre; such a cell + // Far from the origin a half-step may no longer move the center; such a cell // cannot be split, and its identical children would multiply without end. if (cell.X - halfCell == cell.X || cell.X + halfCell == cell.X || cell.Y - halfCell == cell.Y || cell.Y + halfCell == cell.Y) diff --git a/OpenNest.Core/Geometry/SlideContact.cs b/OpenNest.Core/Geometry/SlideContact.cs index dc04616f..8fb9cbaa 100644 --- a/OpenNest.Core/Geometry/SlideContact.cs +++ b/OpenNest.Core/Geometry/SlideContact.cs @@ -37,8 +37,8 @@ namespace OpenNest.Geometry internal const double IncidenceTolerance = 1e-7; // Drawing data fixes arc centers to finite precision, so a tangent joint's arc end - // can sit a little past its neighbour's end. A contact this close to a joint takes - // the joint's tangents; otherwise the neighbour reads as a second boundary there. + // can sit a little past its neighbor's end. A contact this close to a joint takes + // the joint's tangents; otherwise the neighbor reads as a second boundary there. internal const double JointTolerance = 1e-6; // Loops are recovered with ShapeBuilder's chaining tolerance: a source contour that diff --git a/OpenNest.Core/Support/SupportAnalyzer.cs b/OpenNest.Core/Support/SupportAnalyzer.cs index 0fc9c6d9..f9b8b678 100644 --- a/OpenNest.Core/Support/SupportAnalyzer.cs +++ b/OpenNest.Core/Support/SupportAnalyzer.cs @@ -360,19 +360,19 @@ namespace OpenNest.Support yield break; var step = perimeter / TabSamples; - var travelled = 0.0; + var traveled = 0.0; var next = step; for (var i = 0; i < outline.Count; i++) { var a = outline[i]; var b = outline[(i + 1) % outline.Count]; var length = a.DistanceTo(b); - while (length > 0 && next < travelled + length) + while (length > 0 && next < traveled + length) { - yield return a + (b - a) * ((next - travelled) / length); + yield return a + (b - a) * ((next - traveled) / length); next += step; } - travelled += length; + traveled += length; } } } diff --git a/OpenNest.Core/TabbedCutouts/TabbedCutoutLayout.cs b/OpenNest.Core/TabbedCutouts/TabbedCutoutLayout.cs index fc0f8812..1c62f55b 100644 --- a/OpenNest.Core/TabbedCutouts/TabbedCutoutLayout.cs +++ b/OpenNest.Core/TabbedCutouts/TabbedCutoutLayout.cs @@ -28,7 +28,7 @@ namespace OpenNest.TabbedCutouts public double Length { get; internal set; } /// - /// One open cut per span of the contour between tabs, in contour order, travelling + /// One open cut per span of the contour between tabs, in contour order, traveling /// counterclockwise (the slug on the left). /// public IReadOnlyList> Pieces { get; internal set; } @@ -65,7 +65,7 @@ namespace OpenNest.TabbedCutouts /// /// for tab limited so the tab keeps a - /// gap from its neighbours around the contour and does not pass the contour's start + /// gap from its neighbors around the contour and does not pass the contour's start /// (which would reorder the tabs). /// public double ClampTabCenter(int index, double center) diff --git a/OpenNest.Data/BrowseSession.cs b/OpenNest.Data/BrowseSession.cs index 478e0aaa..14becf47 100644 --- a/OpenNest.Data/BrowseSession.cs +++ b/OpenNest.Data/BrowseSession.cs @@ -17,7 +17,7 @@ public interface IBrowsePage /// /// Browse state shared by the paged server lists: the requested search, sort and page, and the /// last page applied. Every change issues one bounded server query. A response that a later -/// request superseded is discarded (and the earlier request is cancelled), so an older result +/// request superseded is discarded (and the earlier request is canceled), so an older result /// can never replace a newer one. Call from one thread (the UI thread). /// public abstract class BrowseSession : IDisposable @@ -130,7 +130,7 @@ public abstract class BrowseSession : IDisposable private async Task RunAsync() { ObjectDisposedException.ThrowIf(_disposed, this); - // Supersede before cancelling: a request that completes synchronously when cancelled + // Supersede before canceling: a request that completes synchronously when canceled // must already see itself as superseded. Each source is released by its own request. var previous = _pending; using var cancellation = new CancellationTokenSource(); diff --git a/OpenNest.Data/MaterialLedger/LedgerHoldSummary.cs b/OpenNest.Data/MaterialLedger/LedgerHoldSummary.cs index 74496c91..f61615c4 100644 --- a/OpenNest.Data/MaterialLedger/LedgerHoldSummary.cs +++ b/OpenNest.Data/MaterialLedger/LedgerHoldSummary.cs @@ -50,7 +50,7 @@ public sealed class LedgerHoldSummary public int OpenHolds { get; } - /// Holds in any other status: released, closed, cancelled, exception or unknown. + /// Holds in any other status: released, closed, canceled, exception or unknown. public int ClosedHolds { get; } /// Sheets without an open hold. diff --git a/OpenNest.Data/MaterialLedger/LedgerHolds.cs b/OpenNest.Data/MaterialLedger/LedgerHolds.cs index fe761171..85ef92ca 100644 --- a/OpenNest.Data/MaterialLedger/LedgerHolds.cs +++ b/OpenNest.Data/MaterialLedger/LedgerHolds.cs @@ -26,13 +26,13 @@ public static class LedgerHoldStatuses public const string AwaitingCloseout = "AwaitingCloseout"; public const string ClosedConsumed = "ClosedConsumed"; public const string ClosedReturned = "ClosedReturned"; - public const string Cancelled = "Cancelled"; + public const string Canceled = "Cancelled"; public const string Exception = "Exception"; /// /// True for holds that still keep a sheet for the nest and need closing out: the statuses ML /// counts against free stock. Released means the hold was let go, not sent to cutting, so it - /// is not open; nor are closed, cancelled, exception and unknown statuses. + /// is not open; nor are closed, canceled, exception and unknown statuses. /// public static bool IsOpen(string? status) => string.Equals(status, Proposed, StringComparison.OrdinalIgnoreCase) diff --git a/OpenNest.Data/MaterialLedger/LedgerStockAssignment.cs b/OpenNest.Data/MaterialLedger/LedgerStockAssignment.cs index d87fad03..9e49ed6b 100644 --- a/OpenNest.Data/MaterialLedger/LedgerStockAssignment.cs +++ b/OpenNest.Data/MaterialLedger/LedgerStockAssignment.cs @@ -2,7 +2,7 @@ namespace OpenNest.Data.MaterialLedger; /// /// Gives the plates Auto Nest committed on ledger stock their item codes. Runs only after the -/// proposal was validated, kept and committed, so a rejected or cancelled one never changes +/// proposal was validated, kept and committed, so a rejected or canceled one never changes /// codes. Codes are hand-off data for MaterialLedger holds, not inventory accounting. /// public static class LedgerStockAssignment diff --git a/OpenNest.Data/NestDetailsSession.cs b/OpenNest.Data/NestDetailsSession.cs index f87f8ae7..b1f4db1e 100644 --- a/OpenNest.Data/NestDetailsSession.cs +++ b/OpenNest.Data/NestDetailsSession.cs @@ -49,7 +49,7 @@ public sealed class NestDetailsSession : IDisposable public async Task LoadAsync(Guid id) { ObjectDisposedException.ThrowIf(_disposed, this); - // Supersede before cancelling: a load that completes synchronously when cancelled + // Supersede before canceling: a load that completes synchronously when canceled // must already see itself as superseded. Each source is released by its own load. var cancellation = Supersede(); var generation = _generation; diff --git a/OpenNest.Data/SetReleaseSession.cs b/OpenNest.Data/SetReleaseSession.cs index e6bfbf74..8b56f6bb 100644 --- a/OpenNest.Data/SetReleaseSession.cs +++ b/OpenNest.Data/SetReleaseSession.cs @@ -148,7 +148,7 @@ public sealed class SetReleaseResult /// matches its record, units the new nest does not use, an insert refusal) creates /// nothing, and so does a server too old to record drawings released on their own, which is /// checked first. Uploads then run in order; the first failure stops them, and cancellation is -/// honoured between uploads, never during one. Nests already uploaded stay as ordinary +/// honored between uploads, never during one. Nests already uploaded stay as ordinary /// nests and are listed in the result; the release is posted only when every chosen group /// was created. Nothing is rolled back. /// diff --git a/OpenNest.Desktop.Tests/Undo/ChangeScopeTests.cs b/OpenNest.Desktop.Tests/Undo/ChangeScopeTests.cs index 372ffd9c..12f78973 100644 --- a/OpenNest.Desktop.Tests/Undo/ChangeScopeTests.cs +++ b/OpenNest.Desktop.Tests/Undo/ChangeScopeTests.cs @@ -38,7 +38,7 @@ public class ChangeScopeTests using (ChangeScope.Nested(root)) { - // Left incomplete, as when the nested edit throws or is cancelled. + // Left incomplete, as when the nested edit throws or is canceled. } root.MarkChanged(); diff --git a/OpenNest.Desktop/Undo/NestFingerprint.cs b/OpenNest.Desktop/Undo/NestFingerprint.cs index cf798f32..636e56fa 100644 --- a/OpenNest.Desktop/Undo/NestFingerprint.cs +++ b/OpenNest.Desktop/Undo/NestFingerprint.cs @@ -8,7 +8,7 @@ namespace OpenNest.Undo /// cut-offs, and the drawings with their required quantities. Two equal fingerprints do not /// prove two nests equal; a differing one means the nest changed since it was taken. Objects /// count by reference, so compare fingerprints of one live nest, never across a restore. - /// Derived values (nested counts, colours, the modified date) are left out. + /// Derived values (nested counts, colors, the modified date) are left out. /// internal static class NestFingerprint { diff --git a/OpenNest.Engine.Tests/Fill/ClampZonePushTests.cs b/OpenNest.Engine.Tests/Fill/ClampZonePushTests.cs index b84acfdf..9b333c42 100644 --- a/OpenNest.Engine.Tests/Fill/ClampZonePushTests.cs +++ b/OpenNest.Engine.Tests/Fill/ClampZonePushTests.cs @@ -143,7 +143,7 @@ public class ClampZonePushTests var upper = AddSquare(plate, 4, 5, 2); var lower = AddSquare(plate, 4, 3.1, 2); var result = Expander.Expand(new List { upper, lower }, plate); - Assert.False(result.Cancelled); + Assert.False(result.Canceled); Assert.True(lower.BoundingBox.Bottom >= 3 - 1e-6, $"Achieved={result.AchievedSpacing}, lower at {lower.Location.Y}"); } @@ -159,7 +159,7 @@ public class ClampZonePushTests var result = Expander.Expand(new List { upper, lower }, plate); - Assert.False(result.Cancelled); + Assert.False(result.Canceled); AssertClear(plate, upper, lower); } @@ -172,7 +172,7 @@ public class ClampZonePushTests var result = Expander.Expand(new List { straddler, clear }, plate); - Assert.False(result.Cancelled); + Assert.False(result.Canceled); // The clear member must not be driven into any clamp while its partner is stuck. AssertClear(plate, clear); } @@ -189,7 +189,7 @@ public class ClampZonePushTests var result = Expander.Expand(new List { a, b, c }, plate); - Assert.False(result.Cancelled); + Assert.False(result.Canceled); // Whatever the achieved spacing or reported violations, no clear member may // end inside a clamp keep-out. AssertClear(plate, a, b, c); diff --git a/OpenNest.Engine.Tests/Fill/ExpanderSpecRegressionTests.cs b/OpenNest.Engine.Tests/Fill/ExpanderSpecRegressionTests.cs index ffd572dd..925fbb9b 100644 --- a/OpenNest.Engine.Tests/Fill/ExpanderSpecRegressionTests.cs +++ b/OpenNest.Engine.Tests/Fill/ExpanderSpecRegressionTests.cs @@ -56,7 +56,7 @@ public class ExpanderSpecRegressionTests var result = Expander.Separate(new List { a, b }, plate, spacing: 3); Assert.False(result.Converged); Assert.True(result.Positions[1].X + 2 <= 12 + 1e-6, - $"native disk crossed third wall: centre={result.Positions[1].X:R}"); + $"native disk crossed third wall: center={result.Positions[1].X:R}"); Assert.Equal(9, b.Location.X); Assert.Equal(12, wall.Location.X); } diff --git a/OpenNest.Engine.Tests/Fill/ExpanderTests.cs b/OpenNest.Engine.Tests/Fill/ExpanderTests.cs index 77a29f0f..85933304 100644 --- a/OpenNest.Engine.Tests/Fill/ExpanderTests.cs +++ b/OpenNest.Engine.Tests/Fill/ExpanderTests.cs @@ -173,7 +173,7 @@ public class ExpanderTests } [Fact] - public void Expand_CancelledBeforeRun_LeavesEverythingInPlace() + public void Expand_CanceledBeforeRun_LeavesEverythingInPlace() { var plate = MakePlate(24, 24); var a = AddSquare(plate, 6, 10); @@ -187,7 +187,7 @@ public class ExpanderTests token: cts.Token ); - Assert.True(result.Cancelled); + Assert.True(result.Canceled); Assert.Equal(6, a.Location.X, 6); Assert.Equal(14, b.Location.X, 6); } @@ -529,7 +529,7 @@ public class ExpanderTests var result = Expander.Expand(new List { insert, other }, plate, new Expander.Options { MaxSpacing = 1 }); - Assert.False(result.Cancelled); + Assert.False(result.Canceled); Assert.True(result.AchievedSpacing >= 0.99); Assert.InRange(insert.Location.X, 6 - 1e-4, 12 + 1e-4); Assert.False(MateriallyOverlaps(insert, host)); @@ -610,7 +610,7 @@ public class ExpanderTests }, cts.Token); Assert.True(seen, $"checkpoint {cancelAt} was not reached"); - Assert.True(result.Cancelled); + Assert.True(result.Canceled); foreach (var state in before) { Assert.Same(state.Program, state.Part.Program); diff --git a/OpenNest.Engine.Tests/Jobs/ClampRemovalRepairTests.cs b/OpenNest.Engine.Tests/Jobs/ClampRemovalRepairTests.cs index a0218977..ed0a110c 100644 --- a/OpenNest.Engine.Tests/Jobs/ClampRemovalRepairTests.cs +++ b/OpenNest.Engine.Tests/Jobs/ClampRemovalRepairTests.cs @@ -9,7 +9,7 @@ namespace OpenNest.Engine.Tests.Jobs; /// /// Slice 6 task 6.4: regressions for the independent Slice 3b reviews of last-resort clamp /// removal (D8/D9, C10-C13). Geometry: a 23"-long, 3"-wide sheet with 1.5 x 0.625 clamps -/// centred at X = 6 and X = 21 (clamp-1 spans X [5.25, 6.75], clamp-2 [20.25, 21.75]); a +/// centerd at X = 6 and X = 21 (clamp-1 spans X [5.25, 6.75], clamp-2 [20.25, 21.75]); a /// 3"-tall part always crosses the clamp band, a 14"-wide part fits only with one clamp /// removed, a 22"-wide part only with both removed. /// @@ -359,10 +359,10 @@ public class ClampRemovalRepairTests Assert.Equal(8, outcome.Result.Plates.Count); Assert.All(outcome.Result.Plates, sheet => Assert.Empty(sheet.Stock.ClampZones)); } - // PM 3df03af2 (C11/D8 "the fewest clamps"): the minimal set need not be neighbours. The + // PM 3df03af2 (C11/D8 "the fewest clamps"): the minimal set need not be neighbors. The // notch over the middle clamp lets it stay while the two outer clamps come off. [Fact] - public void FewestClampsNeedNotBeNeighbours() + public void FewestClampsNeedNotBeNeighbors() { var program = new OpenNest.CNC.Program(); program.MoveTo(0, 0); diff --git a/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutLatticeFillTests.cs b/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutLatticeFillTests.cs index 36b5655b..b5bb6dd1 100644 --- a/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutLatticeFillTests.cs +++ b/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutLatticeFillTests.cs @@ -38,7 +38,7 @@ public class CutoutLatticeFillTests [Theory] [InlineData(7.0)] // diagonal 9.90: wider than the cutout less its wall spacing - [InlineData(6.75)] // corners 4.773 from the centre; the usable radius is 4.75 + [InlineData(6.75)] // corners 4.773 from the center; the usable radius is 4.75 public void InsertThatCannotClearTheCutoutWallIsNeverPlaced(double side) { Assert.Empty(CutoutLatticeFill.Fill(Ring(), 0, Squares(side, 4), 4, Spacing)); diff --git a/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutNfpProposalTests.cs b/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutNfpProposalTests.cs index 1ddf5cfb..15b6fd2a 100644 --- a/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutNfpProposalTests.cs +++ b/OpenNest.Engine.Tests/Jobs/Cutouts/CutoutNfpProposalTests.cs @@ -146,9 +146,9 @@ public class CutoutNfpProposalTests { var frame = JobBuilder.Part("frame", TestShapes.Ring(20, 10), 1); var insert = JobBuilder.Rectangle("insert", 6, 6, 1); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); Assert.Throws(() => CutoutNfpProposal.Find(frame, 0, insert, Spacing, - cancelled.Token)); + canceled.Token)); } } diff --git a/OpenNest.Engine.Tests/Jobs/NestJobRunnerTests.cs b/OpenNest.Engine.Tests/Jobs/NestJobRunnerTests.cs index 0721b7b2..95551dad 100644 --- a/OpenNest.Engine.Tests/Jobs/NestJobRunnerTests.cs +++ b/OpenNest.Engine.Tests/Jobs/NestJobRunnerTests.cs @@ -49,7 +49,7 @@ public class NestJobRunnerTests } [Fact] - public void PreCancelledEmptyJobThrows() + public void PreCanceledEmptyJobThrows() { using var cancellation = new CancellationTokenSource(); cancellation.Cancel(); diff --git a/OpenNest.Engine.Tests/Jobs/NestJobValidationTests.cs b/OpenNest.Engine.Tests/Jobs/NestJobValidationTests.cs index 17a5ad02..d58a914f 100644 --- a/OpenNest.Engine.Tests/Jobs/NestJobValidationTests.cs +++ b/OpenNest.Engine.Tests/Jobs/NestJobValidationTests.cs @@ -183,7 +183,7 @@ public class NestJobValidationTests public void EtchMarksAreLeftOutOfNestingGeometry() { // The etch tick sticks 0.5 past the right edge. As material it would be open geometry - // leaving the part and would overlap the neighbour placed 0.2 away; as a mark it is ignored. + // leaving the part and would overlap the neighbor placed 0.2 away; as a mark it is ignored. var job = new NestJob( new[] { new NestJobPart("part", PartGeometrySnapshot.FromProgram(RectangleWithEtch(LayerType.Scribe)), 2) }, new[] { new NestPlateStock("stock", new Size(30, 30), 1) } diff --git a/OpenNest.Engine.Tests/Jobs/NestPipelineCommitTests.cs b/OpenNest.Engine.Tests/Jobs/NestPipelineCommitTests.cs index 071ef469..1ed0cd04 100644 --- a/OpenNest.Engine.Tests/Jobs/NestPipelineCommitTests.cs +++ b/OpenNest.Engine.Tests/Jobs/NestPipelineCommitTests.cs @@ -143,7 +143,7 @@ public class NestPipelineCommitTests } [Fact] - public void CancelledCommitDoesNotCreateAnyPlate() + public void CanceledCommitDoesNotCreateAnyPlate() { var drawing = new Drawing("part", TestDrawingFactory.Rectangle()); var nest = new Nest(); diff --git a/OpenNest.Engine.Tests/Jobs/RepeatedPlateGroupingTests.cs b/OpenNest.Engine.Tests/Jobs/RepeatedPlateGroupingTests.cs index 2e6302f1..74d545e1 100644 --- a/OpenNest.Engine.Tests/Jobs/RepeatedPlateGroupingTests.cs +++ b/OpenNest.Engine.Tests/Jobs/RepeatedPlateGroupingTests.cs @@ -298,7 +298,7 @@ public class RepeatedPlateGroupingTests } [Fact] - public void CancelledGroupingAndCommitLeaveInputsUntouched() + public void CanceledGroupingAndCommitLeaveInputsUntouched() { using var source = new CancellationTokenSource(); source.Cancel(); diff --git a/OpenNest.Engine.Tests/Jobs/TinyClampZoneTests.cs b/OpenNest.Engine.Tests/Jobs/TinyClampZoneTests.cs index 6fdb3903..7dfb080e 100644 --- a/OpenNest.Engine.Tests/Jobs/TinyClampZoneTests.cs +++ b/OpenNest.Engine.Tests/Jobs/TinyClampZoneTests.cs @@ -201,7 +201,7 @@ public class TinyClampZoneTests private static Program DiskProgram() { - // Radius 2 centred at (10, 10), two absolute CCW half circles. + // Radius 2 centerd at (10, 10), two absolute CCW half circles. var program = new Program(); program.MoveTo(12, 10); program.ArcTo(8, 10, 10, 10, RotationType.CCW); @@ -273,8 +273,8 @@ public class TinyClampZoneTests var arc = new ShapeProfile(OpenNest.Converters.ConvertProgram.ToGeometry(program)) .Perimeter.Entities.OfType().Single(); var native = arc.ToPoints(arc.SegmentsForTolerance(Tiny / 4)).First(v => v.X > 11.9 && v.Y < 19.5); - var centre = new Vector(10, 20); - var outward = centre + (native - centre) / 2 * (2 + 6e-7); + var center = new Vector(10, 20); + var outward = center + (native - center) / 2 * (2 + 6e-7); return (program, new Box(outward.X - Tiny, outward.Y, Tiny, Tiny)); } diff --git a/OpenNest.Engine.Tests/NestingEngines/FlatBarNestingEngineTests.cs b/OpenNest.Engine.Tests/NestingEngines/FlatBarNestingEngineTests.cs index 4266ed94..d1c81117 100644 --- a/OpenNest.Engine.Tests/NestingEngines/FlatBarNestingEngineTests.cs +++ b/OpenNest.Engine.Tests/NestingEngines/FlatBarNestingEngineTests.cs @@ -54,7 +54,7 @@ public class FlatBarNestingEngineTests public void MitredEndsInterlockByTurningAlternateParts() { // 45-degree mitres: a 23-long box, but turned copies nest 20 apart. Five fit on a - // 105 bar only when every other part is turned and slid into its neighbour. + // 105 bar only when every other part is turned and slid into its neighbor. var trapezoid = Part("mitre", Polyline((0, 0), (23, 0), (20, 3), (3, 3)), 5, RotationPolicy.Automatic); var job = Job([trapezoid], [Stock("bar", 3, 105, spacing: 0.25)]); diff --git a/OpenNest.Engine.Tests/NestingEngines/IrregularBlockTests.cs b/OpenNest.Engine.Tests/NestingEngines/IrregularBlockTests.cs index c2327efa..38152c78 100644 --- a/OpenNest.Engine.Tests/NestingEngines/IrregularBlockTests.cs +++ b/OpenNest.Engine.Tests/NestingEngines/IrregularBlockTests.cs @@ -133,13 +133,13 @@ public class IrregularBlockTests var type = PartCatalog.Build(job)[0]; var drawing = new Drawing("box", program); using var cancellation = new CancellationTokenSource(); - var members = new CancellingMembers(Enumerable.Range(0, 3) + var members = new CancelingMembers(Enumerable.Range(0, 3) .Select(i => new OpenNest.Part(drawing) { Location = new Vector(i * 3, 0) }).ToArray(), cancellation); Assert.Throws(() => BlockCatalog.Resolve(type, members, type.Orientations.ToList(), 0.25, cancellation.Token)); } - private sealed class CancellingMembers(OpenNest.Part[] parts, CancellationTokenSource cancellation) + private sealed class CancelingMembers(OpenNest.Part[] parts, CancellationTokenSource cancellation) : IReadOnlyList { public int Count => parts.Length; diff --git a/OpenNest.Engine.Tests/NestingEngines/IrregularClampZoneTests.cs b/OpenNest.Engine.Tests/NestingEngines/IrregularClampZoneTests.cs index ad2e2e81..51b1f7e6 100644 --- a/OpenNest.Engine.Tests/NestingEngines/IrregularClampZoneTests.cs +++ b/OpenNest.Engine.Tests/NestingEngines/IrregularClampZoneTests.cs @@ -184,7 +184,7 @@ public class IrregularClampZoneTests } [Fact] - public void CancelledClampPackingDoesNotReturnAnEmptySuccess() + public void CanceledClampPackingDoesNotReturnAnEmptySuccess() { var stock = Stock("sheet", 4, 5, clampZones: [new("rail", new Box(0, 0, 5, 1))]); var job = Job([Rectangle("part", 2, 2, 1)], [stock]); diff --git a/OpenNest.Engine.Tests/NestingEngines/IrregularExactContactTests.cs b/OpenNest.Engine.Tests/NestingEngines/IrregularExactContactTests.cs index 3b74b49f..a51f25b7 100644 --- a/OpenNest.Engine.Tests/NestingEngines/IrregularExactContactTests.cs +++ b/OpenNest.Engine.Tests/NestingEngines/IrregularExactContactTests.cs @@ -38,7 +38,7 @@ public class IrregularExactContactTests [InlineData(8.5, 3.501)] [InlineData(8.501, 3.5)] [InlineData(8.52, 3.52)] // Generator smoke stock: a looser control, not exact-contact acceptance. - public void LargerNeighbouringStockStillPlacesThePart(double width, double length) + public void LargerNeighboringStockStillPlacesThePart(double width, double length) { var job = RectangleJob(width, length, 1, RotationPolicy.Automatic); diff --git a/OpenNest.Engine.Tests/PlateFillServiceTests.cs b/OpenNest.Engine.Tests/PlateFillServiceTests.cs index c134ca54..ffa47e00 100644 --- a/OpenNest.Engine.Tests/PlateFillServiceTests.cs +++ b/OpenNest.Engine.Tests/PlateFillServiceTests.cs @@ -130,7 +130,7 @@ public class PlateFillServiceTests [Theory] [MemberData(nameof(StrategiesData))] - public void FillItem_ReturnsNoParts_WhenTokenIsAlreadyCancelled(string strategy) + public void FillItem_ReturnsNoParts_WhenTokenIsAlreadyCanceled(string strategy) { // Quantity > 2 keeps the request off the qty 1-2 fast path so the cancellation // check inside the strategy pipeline is actually reached. diff --git a/OpenNest.Engine.Tests/RectanglePacking/AreaPackerTests.cs b/OpenNest.Engine.Tests/RectanglePacking/AreaPackerTests.cs index 9a969de8..9645cb54 100644 --- a/OpenNest.Engine.Tests/RectanglePacking/AreaPackerTests.cs +++ b/OpenNest.Engine.Tests/RectanglePacking/AreaPackerTests.cs @@ -243,7 +243,7 @@ public class AreaPackerTests } [Fact] - public void Pack_CancelledTokenStillReturnsFirstValidLayout() + public void Pack_CanceledTokenStillReturnsFirstValidLayout() { var area = new Box(0, 0, 30, 20); var items = new List { Item("a", 6, 4, 5), Item("b", 4, 3, 4) }; diff --git a/OpenNest.Engine/BestFit/BestFitCache.cs b/OpenNest.Engine/BestFit/BestFitCache.cs index b1faa747..1944a4d8 100644 --- a/OpenNest.Engine/BestFit/BestFitCache.cs +++ b/OpenNest.Engine/BestFit/BestFitCache.cs @@ -103,7 +103,7 @@ namespace OpenNest.Engine.BestFit } /// - /// Like , but cancelling stops + /// Like , but canceling stops /// the wait, not the computation: it finishes in the background and caches its result. /// Callers must pass a drawing nothing else mutates, such as a canonical copy. /// diff --git a/OpenNest.Engine/CuttingPlanning/BestEffortCuttingPlan.cs b/OpenNest.Engine/CuttingPlanning/BestEffortCuttingPlan.cs index d289891c..40f6f793 100644 --- a/OpenNest.Engine/CuttingPlanning/BestEffortCuttingPlan.cs +++ b/OpenNest.Engine/CuttingPlanning/BestEffortCuttingPlan.cs @@ -46,10 +46,10 @@ internal static class BestEffortCuttingPlan var choices = new List(); var approach = position - source.Location; // Source order is not a route: tour the holes from the arrival (the same - // nearest-neighbour + 2-opt proposal the search uses) so the rapids between + // nearest-neighbor + 2-opt proposal the search uses) so the rapids between // them do not double back across each other. The perimeter is still last. var holes = Enumerable.Range(0, prepared.PerimeterOrdinal).ToArray(); - var route = CuttingHoleOrder.Plan(holes, CuttingHoleOrder.Centres(prepared, approach, token), + var route = CuttingHoleOrder.Plan(holes, CuttingHoleOrder.Centers(prepared, approach, token), approach, null, token); foreach (var contour in prepared.HasCutPerimeter ? route.Append(prepared.PerimeterOrdinal) : route) { @@ -92,7 +92,7 @@ internal static class BestEffortCuttingPlan } catch (OperationCanceledException) { - return new(CuttingPlanStatus.Cancelled); + return new(CuttingPlanStatus.Canceled); } catch (Exception exception) when (exception is ArgumentException or NotSupportedException or InvalidOperationException or ArithmeticException) diff --git a/OpenNest.Engine/CuttingPlanning/ContourEntrySelection.cs b/OpenNest.Engine/CuttingPlanning/ContourEntrySelection.cs index a21c600b..637711d7 100644 --- a/OpenNest.Engine/CuttingPlanning/ContourEntrySelection.cs +++ b/OpenNest.Engine/CuttingPlanning/ContourEntrySelection.cs @@ -16,7 +16,7 @@ internal enum ContourSelectionShortfall None, /// - /// The finite catalogue was fully evaluated and the selection is all there is. With an + /// The finite catalog was fully evaluated and the selection is all there is. With an /// empty selection this is exactly the sentence "no tested lead-in fits on part N, /// contour M" — and ONLY here may that sentence be spoken. /// @@ -31,7 +31,7 @@ internal enum ContourSelectionShortfall /// /// Outcome of one bounded selection: selected choices in global rank order, how many -/// distinct candidates were evaluated, which ones (in catalogue order, for cost tests), +/// distinct candidates were evaluated, which ones (in catalog order, for cost tests), /// which evaluated uncertain (never refused — the caller's full check stays the authority /// on those), and why the selection stopped. /// @@ -45,7 +45,7 @@ internal sealed record ContourSelectionResult( /// /// Bounded, lazy selection of lead-feasible entry candidates for ONE contour. Greedy global -/// rank order until the cap (default 16) fills or the finite catalogue ends — rejected and +/// rank order until the cap (default 16) fills or the finite catalog ends — rejected and /// incomplete candidates never consume a slot. When the cap can afford it (4+), one /// corrective scan makes sure every side of the candidate bounding rectangle that HAS a /// feasible candidate is represented, replacing the worst selected candidate only when @@ -65,7 +65,7 @@ internal static class ContourEntrySelection /// /// Selects up to feasible choices from one contour's - /// globally ranked catalogue. is the S07 adapter verdict, + /// globally ranked catalog. is the S07 adapter verdict, /// called lazily at most once per distinct candidate. /// internal static ContourSelectionResult Select( @@ -111,7 +111,7 @@ internal static class ContourEntrySelection return known; } - // Phase 1: greedy global order until the cap fills or the catalogue ends. + // Phase 1: greedy global order until the cap fills or the catalog ends. for (; index < candidates.Count && selected.Count < maxEntries; index++) { var verdict = Verdict(candidates[index]); @@ -128,7 +128,7 @@ internal static class ContourEntrySelection selected.Add(candidates[index]); } - // Phase 2: reconsider the globally ranked catalogue for each missing side, reusing + // Phase 2: reconsider the globally ranked catalog for each missing side, reusing // verdicts passed while chasing earlier sides and evaluating the tail lazily. // A clear candidate on that side is appended when // a slot remains, otherwise it replaces the worst selected candidate whose removal @@ -182,10 +182,10 @@ internal static class ContourEntrySelection } else { - // Unreachable: phase 1 ends at cap or catalogue end and phase 2 chases every + // Unreachable: phase 1 ends at cap or catalog end and phase 2 chases every // side to the end; a cancellation throws before this point. shortfall = ContourSelectionShortfall.Incomplete; - reason = "Selection stopped before the catalogue ended."; + reason = "Selection stopped before the catalog ended."; } var ordered = selected diff --git a/OpenNest.Engine/CuttingPlanning/CuttingGridOrder.cs b/OpenNest.Engine/CuttingPlanning/CuttingGridOrder.cs index fd198fb3..889ced4f 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingGridOrder.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingGridOrder.cs @@ -10,16 +10,16 @@ namespace OpenNest.Engine.CuttingPlanning; /// /// Proposes a serpentine whole-part order for large plates whose parts sit in aligned rows and /// columns: each row in turn, alternating direction, starting from the corner nearest the tool. -/// Part centres are binned into rows by Y and columns by X within a quarter of the smallest part -/// extent; a plate is a grid when every gap between neighbouring rows and columns is wider than +/// Part centers are binned into rows by Y and columns by X within a quarter of the smallest part +/// extent; a plate is a grid when every gap between neighboring rows and columns is wider than /// that, no two parts share a cell and the cells are at least a quarter occupied (interleaved /// rows fill half). Rows run along whichever axis gives the shorter route. It replaces the -/// travelling-salesman improvement, whose passes grow with the square of the part count, and, +/// traveling-salesman improvement, whose passes grow with the square of the part count, and, /// like that order, is only a proposal: the forward search still checks every rapid and lead. /// internal static class CuttingGridOrder { - /// Smaller plates keep the travelling-salesman order, which is fast enough there. + /// Smaller plates keep the traveling-salesman order, which is fast enough there. internal const int MinimumParts = 200; /// The bin tolerance as a fraction of the smallest part extent on that axis. @@ -36,10 +36,10 @@ internal static class CuttingGridOrder var count = extents.Count; if (count < MinimumParts) return null; - var centres = extents.Select(box => box.Center).ToArray(); - var rows = Bins(centres.Select(c => c.Y).ToArray(), + var centers = extents.Select(box => box.Center).ToArray(); + var rows = Bins(centers.Select(c => c.Y).ToArray(), BinFraction * extents.Min(box => box.Top - box.Bottom), token); - var columns = Bins(centres.Select(c => c.X).ToArray(), + var columns = Bins(centers.Select(c => c.X).ToArray(), BinFraction * extents.Min(box => box.Right - box.Left), token); if (rows == null || columns == null) return null; @@ -60,7 +60,7 @@ internal static class CuttingGridOrder foreach (var reverseFirst in new[] { false, true }) { var order = Serpentine(lines, along, reverseLines, reverseFirst); - var length = Length(order, centres, start); + var length = Length(order, centers, start); if (length < bestLength) { best = order; @@ -116,11 +116,11 @@ internal static class CuttingGridOrder return order.ToArray(); } - private static double Length(int[] order, Vector[] centres, Vector start) + private static double Length(int[] order, Vector[] centers, Vector start) { - var length = start.DistanceTo(centres[order[0]]); + var length = start.DistanceTo(centers[order[0]]); for (var i = 1; i < order.Length; i++) - length += centres[order[i - 1]].DistanceTo(centres[order[i]]); + length += centers[order[i - 1]].DistanceTo(centers[order[i]]); return length; } } diff --git a/OpenNest.Engine/CuttingPlanning/CuttingHoleOrder.cs b/OpenNest.Engine/CuttingPlanning/CuttingHoleOrder.cs index 35a9fa09..7063ba41 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingHoleOrder.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingHoleOrder.cs @@ -9,11 +9,11 @@ namespace OpenNest.Engine.CuttingPlanning; /// /// Proposes the ORDER in which a part's remaining holes are cut when the perimeter entry is -/// already chosen: an open path from the tool's arrival through every hole centre and ON to -/// the selected perimeter entry — the terminal edge is real rapid travel and is optimised, +/// already chosen: an open path from the tool's arrival through every hole center and ON to +/// the selected perimeter entry — the terminal edge is real rapid travel and is optimized, /// not scored after the fact. It reuses 's bounded nearest- -/// neighbour + 2-opt/Or-opt machinery (no exhaustive permutations) with an optional fixed -/// endpoint, so whole-part routing without an endpoint keeps byte-identical behaviour. +/// neighbor + 2-opt/Or-opt machinery (no exhaustive permutations) with an optional fixed +/// endpoint, so whole-part routing without an endpoint keeps byte-identical behavior. /// This is a proposal only: the search still certifies every rapid and emitted lead along /// it, exactly as it does for part orders. /// @@ -22,41 +22,41 @@ internal static class CuttingHoleOrder /// /// One representative point per hole ordinal of , in its LOCAL /// coordinates. The tool arriving inside a cutout from a part nested there says nothing - /// useful about that cutout's centre: it is routed from where the tool is instead, before + /// useful about that cutout's center: it is routed from where the tool is instead, before /// a later hop to it has to cross the other parts nested in it. /// - internal static Vector[] Centres(PreparedContours prepared, Vector localArrival, CancellationToken token) + internal static Vector[] Centers(PreparedContours prepared, Vector localArrival, CancellationToken token) { - var centres = prepared.HoleCentres(token).Select(c => c ?? Vector.Zero).ToArray(); + var centers = prepared.HoleCenters(token).Select(c => c ?? Vector.Zero).ToArray(); for (var hole = 0; hole < prepared.PerimeterOrdinal; hole++) if (prepared.HoleContains(hole, localArrival)) - centres[hole] = localArrival; - return centres; + centers[hole] = localArrival; + return centers; } /// /// Orders (stable ordinals, each appearing exactly once in the /// result, never the perimeter) to minimize arrival -> holes -> distance. supplies one + /// name="perimeterEntry"/> distance. supplies one /// representative point per hole ordinal. Empty holes give an empty order. Without a /// perimeter entry the path is open: it ends at whichever hole keeps it shortest. /// internal static IReadOnlyList Plan(IReadOnlyList holes, - IReadOnlyList centresByOrdinal, Vector arrival, Vector? perimeterEntry, + IReadOnlyList centersByOrdinal, Vector arrival, Vector? perimeterEntry, CancellationToken token = default) { if (holes == null) throw new ArgumentException("Hole ordinals are required.", nameof(holes)); - if (centresByOrdinal == null) - throw new ArgumentException("Hole centres are required.", nameof(centresByOrdinal)); + if (centersByOrdinal == null) + throw new ArgumentException("Hole centers are required.", nameof(centersByOrdinal)); token.ThrowIfCancellationRequested(); if (holes.Count == 0) return Array.Empty(); var none = Array.Empty(); var prerequisites = holes.Select(_ => (IReadOnlyCollection)none).ToList(); - var centres = holes.Select(hole => centresByOrdinal[hole]).ToList(); - var route = CuttingPartOrder.Plan(centres, arrival, prerequisites, token, perimeterEntry); + var centers = holes.Select(hole => centersByOrdinal[hole]).ToList(); + var route = CuttingPartOrder.Plan(centers, arrival, prerequisites, token, perimeterEntry); return route.Select(index => holes[index]).ToArray(); } } diff --git a/OpenNest.Engine/CuttingPlanning/CuttingNestedOrder.cs b/OpenNest.Engine/CuttingPlanning/CuttingNestedOrder.cs index f27bfef4..0b5d8d3b 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingNestedOrder.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingNestedOrder.cs @@ -10,17 +10,17 @@ namespace OpenNest.Engine.CuttingPlanning; /// Proposes a whole-part order for plates with parts nested inside other parts' cutouts. A host /// is cut after everything inside it, so the tool reaches it from whichever inner part was cut /// last; from the middle of a crowded cutout every straight approach crosses a finished -/// neighbour. Each host's inner parts are therefore toured as one run that ends beside the +/// neighbor. Each host's inner parts are therefore toured as one run that ends beside the /// host's own contours, immediately before the host. Plates without nested parts get exactly /// 's order. Like that order, this is only a proposal. /// internal static class CuttingNestedOrder { - /// One representative point per part ordinal. + /// One representative point per part ordinal. /// Ordinals that must come before each part, learned rules included. /// Per part ordinal, the parts nested inside its cutouts at any depth. /// The point on a host's contours nearest a tool position. - internal sealed record Context(IReadOnlyList Centres, + internal sealed record Context(IReadOnlyList Centers, IReadOnlyList> Prerequisites, IReadOnlyList> Inside, Func HostEntry, CancellationToken Token); @@ -44,7 +44,7 @@ internal static class CuttingNestedOrder rootOf[inner] = outer; var roots = parts.Where(p => !rootOf.ContainsKey(p)).ToArray(); // A rule between parts of two groups orders the groups. - var groupRules = context.Centres.Select(_ => new HashSet()).ToArray(); + var groupRules = context.Centers.Select(_ => new HashSet()).ToArray(); foreach (var part in parts) { var group = rootOf.GetValueOrDefault(part, part); @@ -63,13 +63,13 @@ internal static class CuttingNestedOrder int[] rootOrder; try { - rootOrder = CuttingPartOrder.Plan(roots, context.Centres, start, hostsLast, context.Token, endpoint); + rootOrder = CuttingPartOrder.Plan(roots, context.Centers, start, hostsLast, context.Token, endpoint); } catch (InvalidOperationException) { try { - rootOrder = CuttingPartOrder.Plan(roots, context.Centres, start, groupRules, context.Token, endpoint); + rootOrder = CuttingPartOrder.Plan(roots, context.Centers, start, groupRules, context.Token, endpoint); } catch (InvalidOperationException) { @@ -84,7 +84,7 @@ internal static class CuttingNestedOrder if (inner.Length != 0) order.AddRange(Plan(inner, position, context, context.HostEntry(root, position))); order.Add(root); - position = context.Centres[root]; + position = context.Centers[root]; } var placed = new HashSet(); foreach (var part in order) @@ -95,6 +95,6 @@ internal static class CuttingNestedOrder } return order.ToArray(); - int[] Flat() => CuttingPartOrder.Plan(parts, context.Centres, start, context.Prerequisites, context.Token, endpoint); + int[] Flat() => CuttingPartOrder.Plan(parts, context.Centers, start, context.Prerequisites, context.Token, endpoint); } } diff --git a/OpenNest.Engine/CuttingPlanning/CuttingPartOrder.cs b/OpenNest.Engine/CuttingPlanning/CuttingPartOrder.cs index b1fbf940..39035eda 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingPartOrder.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingPartOrder.cs @@ -7,8 +7,8 @@ using OpenNest.Geometry; namespace OpenNest.Engine.CuttingPlanning; /// -/// Proposes a whole-part visiting order as an open travelling-salesman path from the start point -/// over part centres: nearest neighbour, then 2-opt and Or-opt improvement, never placing a part +/// Proposes a whole-part visiting order as an open traveling-salesman path from the start point +/// over part centers: nearest neighbor, then 2-opt and Or-opt improvement, never placing a part /// before one of its prerequisites. It is only a proposal; the forward search still checks every /// rapid and lead along it. /// @@ -20,24 +20,24 @@ internal static class CuttingPartOrder internal const int MaxPasses = 50; /// The part ordinals to order; prerequisites outside this set count as done. - /// One representative point per part ordinal. + /// One representative point per part ordinal. /// The modeled tool position before the first of these parts. /// Ordinals that must come before each part; must be acyclic. /// Optional fixed final position after the last of these parts. - internal static int[] Plan(IReadOnlyList parts, IReadOnlyList centres, Vector start, + internal static int[] Plan(IReadOnlyList parts, IReadOnlyList centers, Vector start, IReadOnlyList> prerequisites, CancellationToken token, Vector? endpoint = null) { var local = new Dictionary(); for (var i = 0; i < parts.Count; i++) local.Add(parts[i], i); - var localCentres = parts.Select(p => centres[p]).ToArray(); + var localCenters = parts.Select(p => centers[p]).ToArray(); var localPrerequisites = parts .Select(p => (IReadOnlyCollection)prerequisites[p].Where(local.ContainsKey).Select(q => local[q]).ToArray()) .ToArray(); - return Plan(localCentres, start, localPrerequisites, token, endpoint).Select(i => parts[i]).ToArray(); + return Plan(localCenters, start, localPrerequisites, token, endpoint).Select(i => parts[i]).ToArray(); } - /// One representative point per part ordinal. + /// One representative point per part ordinal. /// The modeled tool position before the first part. /// Ordinals that must come before each part; must be acyclic. /// @@ -45,27 +45,27 @@ internal static class CuttingPartOrder /// terminal edge). The terminal edge joins EVERY improvement delta, not just final /// scoring. Null keeps the previous whole-part open-route semantics exactly. /// - internal static int[] Plan(IReadOnlyList centres, Vector start, + internal static int[] Plan(IReadOnlyList centers, Vector start, IReadOnlyList> prerequisites, CancellationToken token, Vector? endpoint = null) { - var count = centres.Count; - var order = NearestNeighbour(centres, start, prerequisites, token); + var count = centers.Count; + var order = NearestNeighbor(centers, start, prerequisites, token); var position = new int[count]; for (var pass = 0; pass < MaxPasses; pass++) { token.ThrowIfCancellationRequested(); - var improved = TwoOpt(order, centres, start, prerequisites, position, token, endpoint); - improved |= OrOpt(order, centres, start, prerequisites, position, token, endpoint); + var improved = TwoOpt(order, centers, start, prerequisites, position, token, endpoint); + improved |= OrOpt(order, centers, start, prerequisites, position, token, endpoint); if (!improved) break; } return order; } - private static int[] NearestNeighbour(IReadOnlyList centres, Vector start, + private static int[] NearestNeighbor(IReadOnlyList centers, Vector start, IReadOnlyList> prerequisites, CancellationToken token) { - var count = centres.Count; + var count = centers.Count; var placed = new bool[count]; var order = new int[count]; var current = start; @@ -78,7 +78,7 @@ internal static class CuttingPartOrder { if (placed[part] || prerequisites[part].Any(p => !placed[p])) continue; - var distance = current.DistanceTo(centres[part]); + var distance = current.DistanceTo(centers[part]); if (distance < bestDistance - Epsilon) { best = part; @@ -89,30 +89,30 @@ internal static class CuttingPartOrder throw new InvalidOperationException("Part prerequisites form a cycle."); placed[best] = true; order[step] = best; - current = centres[best]; + current = centers[best]; } return order; } // Reverses order[i..j] when that shortens the open path and keeps every prerequisite earlier. - private static bool TwoOpt(int[] order, IReadOnlyList centres, Vector start, + private static bool TwoOpt(int[] order, IReadOnlyList centers, Vector start, IReadOnlyList> prerequisites, int[] position, CancellationToken token, Vector? endpoint = null) { var improved = false; var count = order.Length; // The terminal edge belongs to every delta: reversing the route's tail swaps which - // endpoint-side centre faces the fixed final position. + // endpoint-side center faces the fixed final position. double Tail(Vector from) => endpoint is { } e ? from.DistanceTo(e) : 0; for (var i = 0; i < count - 1; i++) { token.ThrowIfCancellationRequested(); for (var j = i + 1; j < count; j++) { - var before = Point(i - 1).DistanceTo(centres[order[i]]) - + (j + 1 < count ? centres[order[j]].DistanceTo(centres[order[j + 1]]) : Tail(centres[order[j]])); - var after = Point(i - 1).DistanceTo(centres[order[j]]) - + (j + 1 < count ? centres[order[i]].DistanceTo(centres[order[j + 1]]) : Tail(centres[order[i]])); + var before = Point(i - 1).DistanceTo(centers[order[i]]) + + (j + 1 < count ? centers[order[j]].DistanceTo(centers[order[j + 1]]) : Tail(centers[order[j]])); + var after = Point(i - 1).DistanceTo(centers[order[j]]) + + (j + 1 < count ? centers[order[i]].DistanceTo(centers[order[j + 1]]) : Tail(centers[order[i]])); if (after >= before - Epsilon || !CanReverse(order, i, j, prerequisites, position)) continue; Array.Reverse(order, i, j - i + 1); @@ -121,7 +121,7 @@ internal static class CuttingPartOrder } return improved; - Vector Point(int index) => index < 0 ? start : centres[order[index]]; + Vector Point(int index) => index < 0 ? start : centers[order[index]]; } // A reversal breaks a prerequisite only when both parts lie inside the reversed span. @@ -138,7 +138,7 @@ internal static class CuttingPartOrder } // Moves a run of one to three parts to a later or earlier gap when that shortens the path. - private static bool OrOpt(int[] order, IReadOnlyList centres, Vector start, + private static bool OrOpt(int[] order, IReadOnlyList centers, Vector start, IReadOnlyList> prerequisites, int[] position, CancellationToken token, Vector? endpoint = null) { @@ -172,12 +172,12 @@ internal static class CuttingPartOrder // end — the fixed endpoint when one was supplied, so the terminal edge is in every delta). double Gap(int a, int b) { - var from = a < 0 ? start : centres[order[a]]; + var from = a < 0 ? start : centers[order[a]]; if (b >= count) return endpoint is { } e ? from.DistanceTo(e) : 0; if (b < 0) return 0; - return from.DistanceTo(centres[order[b]]); + return from.DistanceTo(centers[order[b]]); } } diff --git a/OpenNest.Engine/CuttingPlanning/CuttingPlanBatch.cs b/OpenNest.Engine/CuttingPlanning/CuttingPlanBatch.cs index a15c95b5..25c56587 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingPlanBatch.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingPlanBatch.cs @@ -159,7 +159,7 @@ public sealed class CuttingPlanBatch /// Checks and plans every plate from its captured snapshots. Safe on a worker: live plates are /// not read. Overlapping material blocks a plate whatever its route. A free search that ends /// without a complete plan within its budget is retried with the current order; the proposal - /// reports that it kept the order. Incomplete geometry also gets a separately labelled, + /// reports that it kept the order. Incomplete geometry also gets a separately labeled, /// unverified fallback when supported closed contours can still be emitted. /// public CuttingPlanProposal Plan(IProgress progress = null, @@ -177,7 +177,7 @@ public sealed class CuttingPlanBatch } catch (OperationCanceledException) { - plans[index] = new(entry.Plate, entry.Number, new(CuttingPlanStatus.Cancelled), null, null); + plans[index] = new(entry.Plate, entry.Number, new(CuttingPlanStatus.Canceled), null, null); continue; } @@ -237,7 +237,7 @@ public sealed class CuttingPlanBatch } catch (OperationCanceledException) { - return (new(CuttingPlanStatus.Cancelled), true); + return (new(CuttingPlanStatus.Canceled), true); } return best; } @@ -265,7 +265,7 @@ public sealed class CuttingPlanBatch // A replayed proposal whose only warnings are fixed emissions passed every strict // check; fixed emissions never steer the search, so the full pass cannot improve it. if (first.IndependentlyReplayed && first.Status is CuttingPlanStatus.Ready or CuttingPlanStatus.BestEffort - || first.Status == CuttingPlanStatus.Cancelled) + || first.Status == CuttingPlanStatus.Canceled) return first; } return CuttingPlanService.Plan(snapshot, token); @@ -277,7 +277,7 @@ public sealed class CuttingPlanBatch return strict; var fallback = BestEffortCuttingPlan.Plan(entry.Fallback, token); if (fallback.Status != CuttingPlanStatus.BestEffort) - return fallback.Status == CuttingPlanStatus.Cancelled ? fallback : strict; + return fallback.Status == CuttingPlanStatus.Canceled ? fallback : strict; return new(CuttingPlanStatus.BestEffort, fallback.ProposedOrder, strict.Findings.Concat(fallback.Findings).Distinct(), rapidDistance: fallback.RapidDistance) { Snapshot = entry.Fallback }; @@ -310,7 +310,7 @@ public sealed class CuttingPlanPlateResult /// The free-order attempt that ran out of budget before the current order was kept; else null. public CuttingPlanResult ReorderAttempt { get; } - /// The clean-material overlap check (part ids are current part positions); null if cancelled first. + /// The clean-material overlap check (part ids are current part positions); null if canceled first. public PlateOverlapReport Overlap { get; } public bool KeptCurrentOrder => ReorderAttempt != null; @@ -331,7 +331,7 @@ public sealed class CuttingPlanPlateResult /// public bool SearchLimitReached => !CanApplyWithWarnings && !IsRouteReady && (Result.Status == CuttingPlanStatus.NoSolutionWithinBudget || KeptCurrentOrder - && Result.Status is not (CuttingPlanStatus.Cancelled or CuttingPlanStatus.UnsupportedGeometry + && Result.Status is not (CuttingPlanStatus.Canceled or CuttingPlanStatus.UnsupportedGeometry or CuttingPlanStatus.InvalidInput)); /// @@ -374,13 +374,13 @@ public sealed class CuttingPlanProposal public IReadOnlyList Plates { get; } - public bool IsCancelled => Plates.Any(p => p.Result.Status == CuttingPlanStatus.Cancelled); + public bool IsCanceled => Plates.Any(p => p.Result.Status == CuttingPlanStatus.Canceled); - public bool CanApply => Plates.Count > 0 && !IsCancelled && ownedParameters != null + public bool CanApply => Plates.Count > 0 && !IsCanceled && ownedParameters != null && Plates.All(p => p.IsReady); /// All plates have usable output, possibly requiring explicit warning acceptance. - public bool CanApplyWithWarnings => Plates.Count > 0 && !IsCancelled && ownedParameters != null + public bool CanApplyWithWarnings => Plates.Count > 0 && !IsCanceled && ownedParameters != null && Plates.All(p => p.CanApplyWithWarnings); public bool RequiresWarningAcceptance => CanApplyWithWarnings && !CanApply; @@ -483,8 +483,8 @@ public sealed class CuttingPlanProposal { var lines = new List(); var blocked = Plates.Count(p => !p.CanApplyWithWarnings); - if (IsCancelled) - lines.Add("Planning was cancelled. Nothing has changed."); + if (IsCanceled) + lines.Add("Planning was canceled. Nothing has changed."); else if (CanApply) lines.Add($"Ready to apply to {Count(Plates.Count, "plate")}: " + $"{Count(Plates.Count(p => p.OrderChanged), "plate")} with a new part order, " @@ -557,7 +557,7 @@ public sealed class CuttingPlanProposal yield break; } - var missingLead = !plate.IsRouteReady && result.Status != CuttingPlanStatus.Cancelled + var missingLead = !plate.IsRouteReady && result.Status != CuttingPlanStatus.Canceled && result.Findings.Any(f => f.Kind == PostVerificationKind.MissingLeadIn); yield return heading + (plate.IsRouteReady ? "blocked: parts overlap or could not be checked for overlap." @@ -613,7 +613,7 @@ public sealed class CuttingPlanProposal CuttingPlanStatus.UnsupportedGeometry => "blocked: unsupported geometry or an incomplete check.", CuttingPlanStatus.InvalidInput => "blocked: invalid input.", CuttingPlanStatus.NoSolutionWithinBudget => "no complete plan was found within the search limit.", - CuttingPlanStatus.Cancelled => "cancelled.", + CuttingPlanStatus.Canceled => "canceled.", _ => status.ToString(), }; diff --git a/OpenNest.Engine/CuttingPlanning/CuttingPlanModels.cs b/OpenNest.Engine/CuttingPlanning/CuttingPlanModels.cs index 38575794..8e6fc692 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingPlanModels.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingPlanModels.cs @@ -295,7 +295,7 @@ public enum CuttingPlanStatus UnsupportedGeometry, InvalidInput, NoSolutionWithinBudget, - Cancelled, + Canceled, /// Usable owned programs, but geometric safety checks did not pass. Never Ready. BestEffort } diff --git a/OpenNest.Engine/CuttingPlanning/CuttingPlanService.cs b/OpenNest.Engine/CuttingPlanning/CuttingPlanService.cs index 40b91e10..68fa1cdc 100644 --- a/OpenNest.Engine/CuttingPlanning/CuttingPlanService.cs +++ b/OpenNest.Engine/CuttingPlanning/CuttingPlanService.cs @@ -182,7 +182,7 @@ public static class CuttingPlanService } catch (OperationCanceledException) { - return Failure(CuttingPlanStatus.Cancelled, "Capture cancelled."); + return Failure(CuttingPlanStatus.Canceled, "Capture canceled."); } catch (CuttingDependencyException exception) { @@ -260,7 +260,7 @@ public static class CuttingPlanService private static CuttingPlanResult PlanCaptured(CuttingPlanSnapshot snapshot, CancellationToken token) { if (token.IsCancellationRequested) - return new(CuttingPlanStatus.Cancelled); + return new(CuttingPlanStatus.Canceled); if (snapshot == null) return new(CuttingPlanStatus.InvalidInput); if (snapshot.Failure is { } failure) @@ -300,7 +300,7 @@ public static class CuttingPlanService if (snapshot.Regeneration) { var joint = JointCuttingPlanSearch.Run(snapshot, token); - // Capture warnings (drawing pins that could not be honoured) stay visible on a refusal. + // Capture warnings (drawing pins that could not be honored) stay visible on a refusal. if (joint.Status != CuttingPlanStatus.Ready) return new(joint.Status, findings: snapshot.Findings.Concat(joint.Findings), expansions: joint.Expansions); return ReplayPrograms(snapshot, joint.Order, joint.Expansions, token); @@ -312,7 +312,7 @@ public static class CuttingPlanService } catch (OperationCanceledException) { - return new(CuttingPlanStatus.Cancelled); + return new(CuttingPlanStatus.Canceled); } } @@ -407,7 +407,7 @@ public static class CuttingPlanService var distance = 0.0; var findings = new List(); // Violations inside fixed emissions: accepted as given, reported, never refused (D1a). - // Capture adds the drawing pins it could not honour; their contours were planned normally. + // Capture adds the drawing pins it could not honor; their contours were planned normally. var warnings = new List(snapshot.Findings); // Rapids that raise the head over cut parts are listed, never refused. var raises = new List(); diff --git a/OpenNest.Engine/CuttingPlanning/JointCuttingPlanSearch.cs b/OpenNest.Engine/CuttingPlanning/JointCuttingPlanSearch.cs index c2db6789..5c66e8c9 100644 --- a/OpenNest.Engine/CuttingPlanning/JointCuttingPlanSearch.cs +++ b/OpenNest.Engine/CuttingPlanning/JointCuttingPlanSearch.cs @@ -68,7 +68,7 @@ internal static class JointCuttingPlanSearch } catch (OperationCanceledException) { - return new(CuttingPlanStatus.Cancelled, [], [], walk.Expansions, walk.LeadPrechecks); + return new(CuttingPlanStatus.Canceled, [], [], walk.Expansions, walk.LeadPrechecks); } return Run(snapshot, token, new Walk(snapshot, token, [], walk.Expansions, walk.LeadPrechecks), []); } @@ -107,11 +107,11 @@ internal static class JointCuttingPlanSearch return kept.Order != null ? walk.Ready(kept.Order) : walk.Exhausted(); } - var centres = snapshot.Placements.Select(Centre).ToArray(); + var centers = snapshot.Placements.Select(Center).ToArray(); var prerequisites = Enumerable.Range(0, count) .Select(i => new HashSet(snapshot.Dependencies.PrerequisitesOf(i).Except(excluded))).ToArray(); - var nesting = NestedOrder(snapshot, centres, prerequisites, token); + var nesting = NestedOrder(snapshot, centers, prerequisites, token); // A large aligned grid with no required order is toured row by row; anything else, // and every replan after a learned rule, gets the general order. var extents = snapshot.Placements.Select(CutExtent).ToArray(); @@ -166,7 +166,7 @@ internal static class JointCuttingPlanSearch } catch (OperationCanceledException) { - return new(CuttingPlanStatus.Cancelled, [], [], walk.Expansions, walk.LeadPrechecks); + return new(CuttingPlanStatus.Canceled, [], [], walk.Expansions, walk.LeadPrechecks); } } @@ -191,19 +191,19 @@ internal static class JointCuttingPlanSearch } // Captured containment (never learned rules) and each host's placed cut contours. - private static CuttingNestedOrder.Context NestedOrder(CuttingPlanSnapshot snapshot, Vector[] centres, + private static CuttingNestedOrder.Context NestedOrder(CuttingPlanSnapshot snapshot, Vector[] centers, HashSet[] prerequisites, CancellationToken token) { var inside = snapshot.Placements.Select((placement, host) => placement.IsCutOff ? [] : snapshot.Dependencies.PrerequisitesOf(host).Where(p => !snapshot.Placements[p].IsCutOff).ToArray()).ToArray(); var contours = new Dictionary(); - return new(centres, prerequisites, inside, (host, position) => + return new(centers, prerequisites, inside, (host, position) => { if (!contours.TryGetValue(host, out var entities)) contours[host] = entities = snapshot.Placements[host].Execution.Motions .Where(m => !m.Rapid && m.Layer is LayerType.Cut or LayerType.Display && m.Curve != null) .Select(m => m.Curve.ToEntity()).ToArray(); - return entities.Length == 0 ? centres[host] + return entities.Length == 0 ? centers[host] : entities.Select(e => e.ClosestPointTo(position)).MinBy(point => point.DistanceTo(position)); }, token); } @@ -263,8 +263,8 @@ internal static class JointCuttingPlanSearch return false; } - // The centre of the part's placed cut material, for ordering only. - private static Vector Centre(FixedProgramPlacement placement) => + // The center of the part's placed cut material, for ordering only. + private static Vector Center(FixedProgramPlacement placement) => CutExtent(placement)?.Center ?? placement.Execution.DeparturePoint; // The extent of the part's placed cut material, or null when it has none. @@ -398,7 +398,7 @@ internal static class JointCuttingPlanSearch } finally { - // Ready, stalled, cancelled and budget-exhausted searches can all leave + // Ready, stalled, canceled and budget-exhausted searches can all leave // suspended siblings. Release their captured prefixes on every exit. foreach (var frame in stack) frame.Children?.Dispose(); @@ -419,7 +419,7 @@ internal static class JointCuttingPlanSearch } /// - /// The NEXT cut's centre that the outside entry should face, or null for the last + /// The NEXT cut's center that the outside entry should face, or null for the last /// part. Supplied order: the next not-yet-finished part in that order (the sequence /// is re-read after every learned-order replan). Sequence-free fallback: nearest /// dependency-ready remaining part once the current part counts as finished, stable @@ -428,7 +428,7 @@ internal static class JointCuttingPlanSearch /// should face, so a kept order with segments gets the entries planned without them. /// Global coordinates. /// - private Vector? LookAheadCentre(Node node, int[] sequence, FixedProgramPlacement source) => + private Vector? LookAheadCenter(Node node, int[] sequence, FixedProgramPlacement source) => NextCut(node, sequence, source) is { } next ? Facing(source, next) : null; private FixedProgramPlacement NextCut(Node node, int[] sequence, FixedProgramPlacement source) @@ -439,7 +439,7 @@ internal static class JointCuttingPlanSearch for (var i = node.Order.Length + 1; i < sequence.Length; i++) if (!finished.Contains(sequence[i]) && !IsSegment(snapshot.Placements[sequence[i]])) return snapshot.Placements[sequence[i]]; - var from = Centre(source); + var from = Center(source); FixedProgramPlacement best = null; var bestDistance = double.PositiveInfinity; foreach (var candidate in snapshot.Placements @@ -447,7 +447,7 @@ internal static class JointCuttingPlanSearch && snapshot.Dependencies.IsReady(p.SourceOrdinal, finished)) .OrderBy(p => p.SourceOrdinal)) { - var distance = Centre(candidate).DistanceTo(from); + var distance = Center(candidate).DistanceTo(from); if (distance < bestDistance - 1e-9) { bestDistance = distance; @@ -472,26 +472,26 @@ internal static class JointCuttingPlanSearch var cuts = next.Execution.Motions .Where(m => !m.Rapid && m.Layer is LayerType.Cut or LayerType.Display && m.Curve != null) .Select(m => m.Curve.ToEntity().BoundingBox).ToList(); - if (cuts.Count == 0 || facing != Centre(next)) + if (cuts.Count == 0 || facing != Center(next)) return [facing]; var box = cuts.GetBoundingBox(); return [facing, new(box.Left, box.Bottom), new(box.Right, box.Bottom), new(box.Left, box.Top), new(box.Right, box.Top)]; } - // The next cut as seen from the current part. A host's centre lies in the middle of + // The next cut as seen from the current part. A host's center lies in the middle of // its cutout, among the parts nested there; a part inside it leaves toward the // nearest of the host's own contours instead. private Vector Facing(FixedProgramPlacement source, FixedProgramPlacement next) { if (source.IsCutOff || next.IsCutOff || !snapshot.Dependencies.PrerequisitesOf(next.SourceOrdinal).Contains(source.SourceOrdinal)) - return Centre(next); + return Center(next); if (!hostContours.TryGetValue(next.SourceOrdinal, out var contours)) hostContours[next.SourceOrdinal] = contours = next.Execution.Motions .Where(m => !m.Rapid && m.Layer is LayerType.Cut or LayerType.Display && m.Curve != null) .Select(m => m.Curve.ToEntity()).ToArray(); - var from = Centre(source); - return contours.Length == 0 ? Centre(next) + var from = Center(source); + return contours.Length == 0 ? Center(next) : contours.Select(c => c.ClosestPointTo(from)).MinBy(point => point.DistanceTo(from)); } @@ -506,7 +506,7 @@ internal static class JointCuttingPlanSearch // source. Expand already yields its contour/entry rank order, so emit and // validate a sibling only when DFS reaches it. Free whole-part selection // still needs every source's distances before it can rank them. Recovery - // instead visits dependency-ready sources lazily by their material centres. + // instead visits dependency-ready sources lazily by their material centers. if (sequence != null || node.Active != null || contourRecovery) return Expand(node, sequence, attempt, preferredOnly, contourRecovery); var edges = Expand(node, sequence, attempt, preferredOnly, contourRecovery).ToList(); @@ -542,7 +542,7 @@ internal static class JointCuttingPlanSearch ? [snapshot.Placements[sequence[node.Order.Length]]] : []; } if (contourRecovery) - sources = sources.OrderBy(p => Centre(p).DistanceTo(node.Position)).ThenBy(p => p.SourceOrdinal); + sources = sources.OrderBy(p => Center(p).DistanceTo(node.Position)).ThenBy(p => p.SourceOrdinal); foreach (var source in sources) { token.ThrowIfCancellationRequested(); @@ -587,7 +587,7 @@ internal static class JointCuttingPlanSearch var state = new ActivePart(source, [], node.Position, node.Checker, 0, node, perimeters[index]); yield return new(new(node.Order, node.Position, node.Checker, state, null), - Centre(source).DistanceTo(node.Position), source.SourceOrdinal, -1, index, index); + Center(source).DistanceTo(node.Position), source.SourceOrdinal, -1, index, index); } continue; } @@ -699,7 +699,7 @@ internal static class JointCuttingPlanSearch source.Prepared.HasCutPerimeter || source.Material is { IsComplete: true, HasDisplayPerimeter: true }; // Recovery only: solve directed contour transitions rather than assuming - // that a centre-to-centre hole tour can cross the already released material. + // that a center-to-center hole tour can cross the already released material. // One complete checked chain per outside endpoint; original DFS remains fallback. // arrivalMayCross (safest route only): the rapid onto the part may cross cut contours; // every other motion of the part stays strict. @@ -719,12 +719,12 @@ internal static class JointCuttingPlanSearch Attempt attempt, bool arrivalMayCross, List heldBack) { var prepared = source.Prepared; - var target = LookAheadCentre(node, sequence, source) - source.Location; + var target = LookAheadCenter(node, sequence, source) - source.Location; ContourChoice[] perimeters; if (prepared.HasCutPerimeter) { // Placement origins are authored program coordinates, not a downstream cut. - // Use the same material-centre look-ahead as the retained entry search. + // Use the same material-center look-ahead as the retained entry search. var ranked = prepared.AutomaticEntryCandidatesWithFallbacks(prepared.PerimeterOrdinal, token: token) .OrderBy(c => c.Choice.Point.DistanceTo(target ?? node.RoutePosition - source.Location)).ToArray(); perimeters = ranked.Where(c => Evaluate(source, c).Status == ContourFeasibilityStatus.Clear) @@ -742,12 +742,12 @@ internal static class JointCuttingPlanSearch ContourChoice[][] Holes() => holes ??= Enumerable.Range(0, prepared.PerimeterOrdinal) .Select(c => { - var catalogue = prepared.AutomaticEntryCandidatesWithFallbacks(c, token: token); - var clear = catalogue.Where(e => Evaluate(source, e).Status == ContourFeasibilityStatus.Clear).ToArray(); + var catalog = prepared.AutomaticEntryCandidatesWithFallbacks(c, token: token); + var clear = catalog.Where(e => Evaluate(source, e).Status == ContourFeasibilityStatus.Clear).ToArray(); // No configured lead-in fits the cutout: pierce where eroding it leaves room. // A widened try adds those pierces to a cutout that refused some of its leads. - if (clear.Length == 0 || widened && clear.Length < catalogue.Count) - clear = [.. clear, .. PreferredContourEntries.ErodedPierces(prepared, c, catalogue, snapshot.MaxEntries, token) + if (clear.Length == 0 || widened && clear.Length < catalog.Count) + clear = [.. clear, .. PreferredContourEntries.ErodedPierces(prepared, c, catalog, snapshot.MaxEntries, token) .Where(e => Evaluate(source, e).Status == ContourFeasibilityStatus.Clear)]; return clear.Select(e => e.Choice).ToArray(); }).ToArray(); @@ -778,7 +778,7 @@ internal static class JointCuttingPlanSearch } PostVerificationGeometry.Curve[] CutCurves(ContourChoice choice) => Motion(choice).Motions .Where(m => !m.Rapid && m.Layer is LayerType.Cut or LayerType.Display).Select(m => m.Curve).ToArray(); - var centres = prepared.HoleCentres(token); + var centers = prepared.HoleCenters(token); var bounds = Enumerable.Range(0, prepared.PerimeterOrdinal).Select(prepared.ContourBounds).ToArray(); var sweepEntries = new Dictionary<(int Hole, int Next, Vector Direction), ContourChoice[]>(); // A hole's sweep entries: at its far side, its far corners and facing the next hole, each with the @@ -791,10 +791,10 @@ internal static class JointCuttingPlanSearch var reach = box.Width + box.Length + 1; var toward = next < 0 ? direction : Unit(bounds[next].Center - box.Center, direction); var across = new Vector(-direction.Y, direction.X) * reach; - var catalogue = new[] { direction * reach, toward * reach, direction * reach + across, direction * reach - across } + var catalog = new[] { direction * reach, toward * reach, direction * reach + across, direction * reach - across } .Select(offset => prepared.ClosestEntry(hole, box.Center + offset)).Distinct() .Select(c => new ContourEntryCandidate(c, AutomaticEntryKind.TargetFacing)).ToArray(); - var extra = catalogue.Concat(PreferredContourEntries.ErodedPierces(prepared, hole, catalogue, catalogue.Length, token)) + var extra = catalog.Concat(PreferredContourEntries.ErodedPierces(prepared, hole, catalog, catalog.Length, token)) .Where(e => Evaluate(source, e).Status == ContourFeasibilityStatus.Clear).Select(e => e.Choice); // Stencil pieces overlap along the direction: leave toward the next piece. var stacked = next >= 0 && Near(bounds[next], direction) < Far(box, direction) - OpenNest.Math.Tolerance.Epsilon; @@ -1084,8 +1084,8 @@ internal static class JointCuttingPlanSearch { var onward = double.PositiveInfinity; foreach (var other in remaining) - if (other != hole && centres[other] is { } centre) - onward = System.Math.Min(onward, departure.DistanceTo(centre + source.Location)); + if (other != hole && centers[other] is { } center) + onward = System.Math.Min(onward, departure.DistanceTo(center + source.Location)); if (!double.IsPositiveInfinity(onward)) return onward; // The last hole: toward the outside entry, or with none, toward the next part. @@ -1136,9 +1136,9 @@ internal static class JointCuttingPlanSearch /// /// The S03-S08 pipeline for one outside contour, in prepared LOCAL coordinates - /// converted exactly once: rank the (fallback-complemented) catalogue toward the + /// converted exactly once: rank the (fallback-complemented) catalog toward the /// next cut, lazily filter through the shared validator adapter, cap at MaxEntries - /// with side coverage. Empty ONLY when the finite catalogue was fully evaluated and + /// with side coverage. Empty ONLY when the finite catalog was fully evaluated and /// nothing fits — then the honest part/contour finding is recorded once. /// private IReadOnlyList AutomaticEntries(Node node, int[] sequence, @@ -1147,7 +1147,7 @@ internal static class JointCuttingPlanSearch var prepared = source.Prepared!; var arrival = node.RoutePosition - source.Location; // One global->local conversion of target and arrival; geometry is already rotated. - Vector? local = LookAheadCentre(node, sequence, source) is { } target + Vector? local = LookAheadCenter(node, sequence, source) is { } target ? target - source.Location : null; return SelectEntries(source, contour, local, arrival, SightTargets(node, sequence, source)); } @@ -1303,7 +1303,7 @@ internal static class JointCuttingPlanSearch }; } - // One contour's automatic catalogue ranked toward the next cut, before lead checks. A + // One contour's automatic catalog ranked toward the next cut, before lead checks. A // support fallback leads with the entries whose tab steadies the part most. private IReadOnlyList RankedEntries(FixedProgramPlacement source, int contour, Vector? target, Vector arrival, Vector[] sightTargets, SupportEntries supportEntries) @@ -1311,9 +1311,9 @@ internal static class JointCuttingPlanSearch // Last contour has no downstream target, but still needs its exact native // closest-arrival fallback. Keep target null in the ranker: arrival is not // a next cut and must not acquire facing-side priority. - var catalogue = source.Prepared.AutomaticEntryCandidatesWithFallbacks(contour, target ?? arrival, token, + var catalog = source.Prepared.AutomaticEntryCandidatesWithFallbacks(contour, target ?? arrival, token, supportEntries); - var ordered = catalogue.RankTowardNextCut(target, arrival); + var ordered = catalog.RankTowardNextCut(target, arrival); // With no lead-out the tool leaves the part from its outside entry. From inside a // slot or pocket the straight way to the next cut runs back over the part just // cut, so entries with the clearest way out lead. Order only: every entry stays. @@ -1340,17 +1340,17 @@ internal static class JointCuttingPlanSearch var prepared = source.Prepared; var holes = Enumerable.Range(0, prepared.PerimeterOrdinal).ToArray(); var localArrival = arrival - source.Location; - var centres = CuttingHoleOrder.Centres(prepared, localArrival, token); + var centers = CuttingHoleOrder.Centers(prepared, localArrival, token); var endpoint = perimeter.Point; var entries = new Dictionary(); - var pierces = holes.ToDictionary(h => h, h => centres[h]); + var pierces = holes.ToDictionary(h => h, h => centers[h]); var route = holes; try { CountExpansion(source); endpoint = PreferredContourEntries.Pierce(prepared, perimeter, token); - route = CuttingHoleOrder.Plan(holes, centres, localArrival, endpoint, token).ToArray(); - var proposal = PreferredContourEntries.TryPlan(prepared, perimeter, route, centres, + route = CuttingHoleOrder.Plan(holes, centers, localArrival, endpoint, token).ToArray(); + var proposal = PreferredContourEntries.TryPlan(prepared, perimeter, route, centers, localArrival, candidate => Evaluate(source, candidate), token); if (proposal.IsPreferred) foreach (var choice in proposal.HoleChoices) @@ -1476,7 +1476,7 @@ internal static class JointCuttingPlanSearch var ready = (snapshot.PreservePartOrder ? [snapshot.Placements[node.Order.Length]] : snapshot.Placements.Where(p => !finished.Contains(p.SourceOrdinal) && snapshot.Dependencies.IsReady(p.SourceOrdinal, finished))) - .OrderBy(p => Centre(p).DistanceTo(node.Position)).ThenBy(p => p.SourceOrdinal).ToArray(); + .OrderBy(p => Center(p).DistanceTo(node.Position)).ThenBy(p => p.SourceOrdinal).ToArray(); // Nearest first, the first part with a route that passes every check wins. When // none of the nearby parts has one, the least unsafe of them is cut. SafestStep best = null; @@ -1532,9 +1532,9 @@ internal static class JointCuttingPlanSearch // the fewest violations to the part's route, nearest along the tour on a tie. var approach = arrival - source.Location; var holes = Enumerable.Range(0, prepared.PerimeterOrdinal).ToArray(); - var centres = CuttingHoleOrder.Centres(prepared, approach, token); - var remaining = CuttingHoleOrder.Plan(holes, centres, approach, null, token).ToList(); - var onward = LookAheadCentre(node, KeptSequence, source) - source.Location; + var centers = CuttingHoleOrder.Centers(prepared, approach, token); + var remaining = CuttingHoleOrder.Plan(holes, centers, approach, null, token).ToList(); + var onward = LookAheadCenter(node, KeptSequence, source) - source.Location; var choices = new List(); Program program = null; OwnedExecution execution = null; @@ -1551,7 +1551,7 @@ internal static class JointCuttingPlanSearch // Leave each hole toward the next one along the tour, so its exit rapid does // not run back across it; the perimeter faces the next part. var next = remaining.FirstOrDefault(h => h != contour, -1); - var entries = SelectEntries(source, contour, next >= 0 ? centres[next] : onward, local); + var entries = SelectEntries(source, contour, next >= 0 ? centers[next] : onward, local); if (entries.Count == 0) entries = [prepared.ClosestEntry(contour, local)]; foreach (var entry in entries) diff --git a/OpenNest.Engine/CuttingPlanning/PreferredContourEntries.cs b/OpenNest.Engine/CuttingPlanning/PreferredContourEntries.cs index 3ff0406f..f1af3faa 100644 --- a/OpenNest.Engine/CuttingPlanning/PreferredContourEntries.cs +++ b/OpenNest.Engine/CuttingPlanning/PreferredContourEntries.cs @@ -36,7 +36,7 @@ internal static class PreferredContourEntries /// Resolves one preferred entry per hole on (cut order, /// from ), ending at . /// Arrival proxies avoid circularity: the actual (local) part arrival for the first - /// hole, otherwise the previous hole's centre. Facing target (the downstream actual + /// hole, otherwise the previous hole's center. Facing target (the downstream actual /// pierce) and tier still rank first. is the S07 adapter /// verdict; candidates it refuses or leaves uncertain are not preferred. /// @@ -44,7 +44,7 @@ internal static class PreferredContourEntries PreparedContours prepared, ContourChoice perimeterChoice, IReadOnlyList holeRoute, - IReadOnlyList centresByOrdinal, + IReadOnlyList centersByOrdinal, Vector arrival, Func evaluate, CancellationToken token = default) @@ -53,8 +53,8 @@ internal static class PreferredContourEntries throw new ArgumentException("Prepared contours are required.", nameof(prepared)); if (perimeterChoice == null || !ReferenceEquals(perimeterChoice.Owner, prepared)) throw new ArgumentException("The perimeter choice must belong to this preparation.", nameof(perimeterChoice)); - if (holeRoute == null || centresByOrdinal == null || evaluate == null) - throw new ArgumentException("Hole route, centres and evaluation are required."); + if (holeRoute == null || centersByOrdinal == null || evaluate == null) + throw new ArgumentException("Hole route, centers and evaluation are required."); token.ThrowIfCancellationRequested(); if (holeRoute.Count == 0) return new(Array.Empty(), ContourSelectionShortfall.Exhausted, null, null); @@ -67,11 +67,11 @@ internal static class PreferredContourEntries { token.ThrowIfCancellationRequested(); var contour = holeRoute[index]; - var arrivalProxy = index == 0 ? arrival : centresByOrdinal[holeRoute[index - 1]]; - // The S04 merged catalogue: preferred kinds when present, fallback kinds + var arrivalProxy = index == 0 ? arrival : centersByOrdinal[holeRoute[index - 1]]; + // The S04 merged catalog: preferred kinds when present, fallback kinds // (compass points, arc midpoints, ...) otherwise — pure circles included. - var catalogue = prepared.AutomaticEntryCandidatesWithFallbacks(contour, target, token); - var ranked = catalogue.RankTowardNextCut(target, arrivalProxy).DepartingClear(prepared, target, token); + var catalog = prepared.AutomaticEntryCandidatesWithFallbacks(contour, target, token); + var ranked = catalog.RankTowardNextCut(target, arrivalProxy).DepartingClear(prepared, target, token); var selection = ContourEntrySelection.Select(ranked, evaluate, 1, token); if (selection.Choices.Count == 0 && selection.Shortfall is ContourSelectionShortfall.Exhausted or ContourSelectionShortfall.Incomplete) diff --git a/OpenNest.Engine/Fill/Expander.cs b/OpenNest.Engine/Fill/Expander.cs index e14c76e1..27348cd6 100644 --- a/OpenNest.Engine/Fill/Expander.cs +++ b/OpenNest.Engine/Fill/Expander.cs @@ -66,8 +66,8 @@ namespace OpenNest.Engine.Fill /// public double AchievedSpacing; - /// True when the run was cancelled; no positions were changed. - public bool Cancelled; + /// True when the run was canceled; no positions were changed. + public bool Canceled; /// Pairs still below the attempted spacing and invalid /// work-area poses, including unresolved negative clearances when no @@ -136,7 +136,7 @@ namespace OpenNest.Engine.Fill } catch (OperationCanceledException) when (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } var entry = context.Positions(); // all parts; movers are [0, count) @@ -148,14 +148,14 @@ namespace OpenNest.Engine.Fill } catch (OperationCanceledException) when (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } result.AchievedSpacing = System.Math.Max(0, sMin); if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } @@ -192,14 +192,14 @@ namespace OpenNest.Engine.Fill if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } var probe = Probe(s); if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } @@ -225,7 +225,7 @@ namespace OpenNest.Engine.Fill { if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } @@ -233,7 +233,7 @@ namespace OpenNest.Engine.Fill var midProbe = Probe(mid); if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } if (midProbe.Converged) @@ -253,7 +253,7 @@ namespace OpenNest.Engine.Fill observer?.Invoke(Checkpoint.BeforeApply); if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } @@ -270,12 +270,12 @@ namespace OpenNest.Engine.Fill } catch (OperationCanceledException) when (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } if (token.IsCancellationRequested) { - result.Cancelled = true; + result.Canceled = true; return result; } Apply(selected, entry, positions); @@ -1090,7 +1090,7 @@ namespace OpenNest.Engine.Fill if (TryNativeDisk(moving, out var movingCenter, out var movingRadius) && TryNativeDisk(stationary, out var fixedCenter, out var fixedRadius)) { - // Full circles are convex. The relative centre distance + // Full circles are convex. The relative center distance // must increase from the start; its ray intersects the // summed-radius disk at most once in forward travel. var relative = movingCenter + movePos - fixedCenter - fixedPos; diff --git a/OpenNest.Engine/Fill/PairFiller.cs b/OpenNest.Engine/Fill/PairFiller.cs index 78d7e6bd..a585808b 100644 --- a/OpenNest.Engine/Fill/PairFiller.cs +++ b/OpenNest.Engine/Fill/PairFiller.cs @@ -228,7 +228,7 @@ namespace OpenNest.Engine.Fill } catch (OperationCanceledException) { - Debug.WriteLine("[PairFiller] Cancelled mid-phase, using results so far"); + Debug.WriteLine("[PairFiller] Canceled mid-phase, using results so far"); } Debug.WriteLine($"[PairFiller] Best pair result: {best?.Count ?? 0} parts"); diff --git a/OpenNest.Engine/Fill/RemnantFiller.cs b/OpenNest.Engine/Fill/RemnantFiller.cs index 8b123ff1..30637b29 100644 --- a/OpenNest.Engine/Fill/RemnantFiller.cs +++ b/OpenNest.Engine/Fill/RemnantFiller.cs @@ -18,7 +18,7 @@ namespace OpenNest.Engine.Fill /// /// are kept-out rectangles (e.g. inflated clamp /// zones) treated like occupied space: they are excluded from the remnant areas - /// every fill attempt sees. Null keeps today's behaviour exactly. + /// every fill attempt sees. Null keeps today's behavior exactly. /// public RemnantFiller(Box workArea, double spacing, IEnumerable boxObstacles = null) { diff --git a/OpenNest.Engine/Jobs/ClampRemovalRecovery.cs b/OpenNest.Engine/Jobs/ClampRemovalRecovery.cs index f43a49b8..ddaef6b3 100644 --- a/OpenNest.Engine/Jobs/ClampRemovalRecovery.cs +++ b/OpenNest.Engine/Jobs/ClampRemovalRecovery.cs @@ -245,7 +245,7 @@ internal static class ClampRemovalRecovery if (!CanRemoveClamps(stock)) continue; token.ThrowIfCancellationRequested(); - // Placement-frame X is signed from the origin, so |centre X| is the distance + // Placement-frame X is signed from the origin, so |center X| is the distance // along the edge in every quadrant. var zones = stock.ClampZones .OrderBy(z => System.Math.Abs(z.Bounds.X + z.Bounds.Length / 2)) @@ -272,7 +272,7 @@ internal static class ClampRemovalRecovery searches.Add((stock, zones, fitting, mandatory)); } - // Then the fewest clamps overall (any set, not only neighbours: a notch can leave a + // Then the fewest clamps overall (any set, not only neighbors: a notch can leave a // middle clamp in place), size by size across stocks in offered order; within a stock // the optional additions nearest the origin first. var maxSize = searches.Count == 0 ? 0 : searches.Max(c => c.Zones.Count); diff --git a/OpenNest.Engine/Jobs/InteractiveClamps.cs b/OpenNest.Engine/Jobs/InteractiveClamps.cs index 41facf34..e71b3864 100644 --- a/OpenNest.Engine/Jobs/InteractiveClamps.cs +++ b/OpenNest.Engine/Jobs/InteractiveClamps.cs @@ -35,7 +35,7 @@ internal static class InteractiveClamps /// /// Placement keep-outs inflated by the full - the same - /// convention the Rectangles lane blocks and engines honour, so fill and pack produce + /// convention the Rectangles lane blocks and engines honor, so fill and pack produce /// placements with at least that clearance from the raw zone. /// public static IReadOnlyList ClearanceRectangles(Plate plate) => diff --git a/OpenNest.Engine/Jobs/NestJobPlacementValidator.cs b/OpenNest.Engine/Jobs/NestJobPlacementValidator.cs index a0736c2b..61dc06af 100644 --- a/OpenNest.Engine/Jobs/NestJobPlacementValidator.cs +++ b/OpenNest.Engine/Jobs/NestJobPlacementValidator.cs @@ -26,7 +26,7 @@ internal static class NestJobPlacementValidator throw new InvalidOperationException("The plate nester returned a null candidate."); var counts = new Dictionary(StringComparer.Ordinal); var placed = new List(); - // Spacing outlines per placement, prepared only once a neighbour comes near. + // Spacing outlines per placement, prepared only once a neighbor comes near. var poses = new List<(JobPartGeometry Geometry, NestJobPlacement Pose)>(); var spaced = new List(); var geometries = new Dictionary(StringComparer.Ordinal); diff --git a/OpenNest.Engine/Jobs/NestLayoutCheck.cs b/OpenNest.Engine/Jobs/NestLayoutCheck.cs index 82e838d9..1da0e57a 100644 --- a/OpenNest.Engine/Jobs/NestLayoutCheck.cs +++ b/OpenNest.Engine/Jobs/NestLayoutCheck.cs @@ -539,7 +539,7 @@ public static class NestLayoutCheck /// material, with holes subtracted on both sides - so a small part /// nested inside another part's cutout (part-in-part) is legal as long as /// it clears the cutout's edge by the spacing. Pairs are pruned with an - /// X-sorted sweep over bounding boxes so only neighbours reach the + /// X-sorted sweep over bounding boxes so only neighbors reach the /// polygon clipper. A pair the outlines flag at a positive spacing is /// reported only when confirm it. /// diff --git a/OpenNest.Engine/Jobs/Placement/Fillers/PlateFiller.cs b/OpenNest.Engine/Jobs/Placement/Fillers/PlateFiller.cs index a5dc50a2..a5735f81 100644 --- a/OpenNest.Engine/Jobs/Placement/Fillers/PlateFiller.cs +++ b/OpenNest.Engine/Jobs/Placement/Fillers/PlateFiller.cs @@ -660,7 +660,7 @@ internal class PlateFiller } catch (OperationCanceledException) { - Debug.WriteLine("[RunPipeline] Cancelled, returning current best"); + Debug.WriteLine("[RunPipeline] Canceled, returning current best"); if (context.ProvisionalLeads(context.CurrentBest)) { context.CurrentBest = context.Provisional; diff --git a/OpenNest.Engine/NestingEngines/Default/DefaultNestingEngine.cs b/OpenNest.Engine/NestingEngines/Default/DefaultNestingEngine.cs index 6e7ffefb..0c79da12 100644 --- a/OpenNest.Engine/NestingEngines/Default/DefaultNestingEngine.cs +++ b/OpenNest.Engine/NestingEngines/Default/DefaultNestingEngine.cs @@ -77,7 +77,7 @@ public sealed class DefaultNestingEngine : INestingEngine } catch (Exception ex) { - // A cancelled solve is rethrown by the token checks around each candidate. + // A canceled solve is rethrown by the token checks around each candidate. firstFailure ??= ExceptionDispatchInfo.Capture(ex); continue; } diff --git a/OpenNest.Engine/NestingEngines/FlatBar/BarCatalog.cs b/OpenNest.Engine/NestingEngines/FlatBar/BarCatalog.cs index b5b90c30..0230e03a 100644 --- a/OpenNest.Engine/NestingEngines/FlatBar/BarCatalog.cs +++ b/OpenNest.Engine/NestingEngines/FlatBar/BarCatalog.cs @@ -33,7 +33,7 @@ internal sealed record BarType( /// validation-aware bounds as the Rectangles lane so box contact passes the layout check. /// Unlike Rectangles, all rotations are kept: a bar accepts any rotation whose cross extent /// fits its width, and the compaction pass may prefer a different rotation of the same length -/// (a part turned 180 degrees so its mitred end nests against its neighbour). +/// (a part turned 180 degrees so its mitred end nests against its neighbor). /// internal static class BarCatalog { diff --git a/OpenNest.Engine/NestingEngines/FlatBar/BarLayout.cs b/OpenNest.Engine/NestingEngines/FlatBar/BarLayout.cs index 12c5b489..0cc63a9a 100644 --- a/OpenNest.Engine/NestingEngines/FlatBar/BarLayout.cs +++ b/OpenNest.Engine/NestingEngines/FlatBar/BarLayout.cs @@ -175,18 +175,18 @@ internal sealed class BarLayout boxStart = segment.Start; (BarPart Part, Part Shape)? best = null; - var neighbours = laid.Skip(first).ToList(); - var slide = neighbours.Count > 0 && !(Boxy(type, bar) && neighbours.All(n => Boxy(n.Part.Type, bar))); + var neighbors = laid.Skip(first).ToList(); + var slide = neighbors.Count > 0 && !(Boxy(type, bar) && neighbors.All(n => Boxy(n.Part.Type, bar))); foreach (var orientation in bar.Fits[type.Index].Take(slide ? MaxSlideOrientations : 1)) { var start = boxStart; var shape = Shape(bar, type, orientation, start); if (slide) { - var travel = Slide(bar, shape, neighbours, segment, start); + var travel = Slide(bar, shape, neighbors, segment, start); if (travel > 0) { - start = Confirm(bar, type, orientation, start, travel, neighbours); + start = Confirm(bar, type, orientation, start, travel, neighbors); shape = Shape(bar, type, orientation, start); } } @@ -200,7 +200,7 @@ internal sealed class BarLayout } /// How far the part can slide back before its offset outline meets a laid part. - private static double Slide(BarStock bar, Part shape, List<(BarPart Part, Part Shape)> neighbours, + private static double Slide(BarStock bar, Part shape, List<(BarPart Part, Part Shape)> neighbors, BarSegment segment, double start) { var room = start - segment.Start; @@ -208,7 +208,7 @@ internal sealed class BarLayout return 0; var direction = bar.AlongX ? new Vector(-1, 0) : new Vector(0, -1); var huge = new Box(-1e9, -1e9, 2e9, 2e9); - var obstacles = neighbours.Select(n => n.Shape).ToList(); + var obstacles = neighbors.Select(n => n.Shape).ToList(); var travel = Compactor.Push(new List { shape }, obstacles, huge, bar.Spacing, direction); return System.Math.Clamp(travel, 0, room); } @@ -218,7 +218,7 @@ internal sealed class BarLayout /// laid part the new one can reach; falls back to the box-to-box start. /// private double Confirm(BarStock bar, BarType type, BarOrientation orientation, double boxStart, double travel, - List<(BarPart Part, Part Shape)> neighbours) + List<(BarPart Part, Part Shape)> neighbors) { if (type.Geometry == null) return boxStart; @@ -229,7 +229,7 @@ internal sealed class BarLayout break; var start = boxStart - slid; var pose = Placement(bar, type, orientation, start); - var clear = neighbours + var clear = neighbors .Where(n => n.Part.AxisEnd + bar.Spacing + 1e-6 > start) .All(n => n.Part.Type.Geometry != null && NestLayoutCheck.Clears( type.Geometry, pose, n.Part.Type.Geometry, diff --git a/OpenNest.Engine/NestingEngines/FlatBar/BarPacker.cs b/OpenNest.Engine/NestingEngines/FlatBar/BarPacker.cs index 96dd12e2..894809f6 100644 --- a/OpenNest.Engine/NestingEngines/FlatBar/BarPacker.cs +++ b/OpenNest.Engine/NestingEngines/FlatBar/BarPacker.cs @@ -52,7 +52,7 @@ internal sealed record BarPlan(IReadOnlyList Bars, IReadOnlyList /// One-dimensional cut-list packer, ported from CutList.Core (the saw cut-list optimizer). /// Lengths are "inflated": every item carries one part spacing and every segment's capacity -/// gets one spacing back, so a run of items needs spacing between neighbours but none after the +/// gets one spacing back, so a run of items needs spacing between neighbors but none after the /// last, exactly like a saw kerf in CutList's Bin. /// /// Small jobs (at most items, one free run per bar, unlimited diff --git a/OpenNest.Engine/NestingEngines/FlatBar/FlatBarNestingEngine.cs b/OpenNest.Engine/NestingEngines/FlatBar/FlatBarNestingEngine.cs index e5466536..c1ebd333 100644 --- a/OpenNest.Engine/NestingEngines/FlatBar/FlatBarNestingEngine.cs +++ b/OpenNest.Engine/NestingEngines/FlatBar/FlatBarNestingEngine.cs @@ -168,7 +168,7 @@ public sealed class FlatBarNestingEngine : INestingEngine /// /// Prices the demand as one stock's plan, using its packed envelopes: the cheaper of the - /// cut-list plan and repeated best fills, so the estimate does not favour bars that leave + /// cut-list plan and repeated best fills, so the estimate does not favor bars that leave /// first-fit-decreasing an awkward remainder. /// private static Estimate EstimatePlan(NestJob job, BarStock bar, IReadOnlyList types, BarLayout layout, diff --git a/OpenNest.Engine/NestingEngines/Rectangles/SheetPacker.cs b/OpenNest.Engine/NestingEngines/Rectangles/SheetPacker.cs index e29882ed..bea8ccab 100644 --- a/OpenNest.Engine/NestingEngines/Rectangles/SheetPacker.cs +++ b/OpenNest.Engine/NestingEngines/Rectangles/SheetPacker.cs @@ -44,7 +44,7 @@ internal static class SheetPacker /// /// Packing size along one axis: a box that exceeds the sheet by no more than /// packs as exactly the sheet's size. It then spans the whole - /// axis, so it has no neighbour there and the overhang lands only past the work-area edge. + /// axis, so it has no neighbor there and the overhang lands only past the work-area edge. /// public static double PackSize(double size, double sheet) => size > sheet && size <= sheet + OverhangAllowance ? sheet : size; diff --git a/OpenNest.Engine/RectanglePacking/AreaPacker.cs b/OpenNest.Engine/RectanglePacking/AreaPacker.cs index 51b9b93d..cb95ba5b 100644 --- a/OpenNest.Engine/RectanglePacking/AreaPacker.cs +++ b/OpenNest.Engine/RectanglePacking/AreaPacker.cs @@ -31,8 +31,8 @@ internal static class AreaPacker /// /// Returns the packed parts. Items and the area grow by on their - /// right/top sides, so neighbouring parts are one spacing apart and the last may touch the - /// area's edge. A cancelled token stops between candidates and keeps the best layout so far. + /// right/top sides, so neighboring parts are one spacing apart and the last may touch the + /// area's edge. A canceled token stops between candidates and keeps the best layout so far. /// /// Plate work area, when known. Only matching right/top boundaries /// receive the existing work-area overhang allowance; internal areas remain strict. diff --git a/OpenNest.Engine/RectanglePacking/MaxRectsSheet.cs b/OpenNest.Engine/RectanglePacking/MaxRectsSheet.cs index 5b19bff0..29b7ceb8 100644 --- a/OpenNest.Engine/RectanglePacking/MaxRectsSheet.cs +++ b/OpenNest.Engine/RectanglePacking/MaxRectsSheet.cs @@ -73,7 +73,7 @@ internal sealed class MaxRectsSheet foreach (var f in free) { // Clamp only at the bin's allowed plate boundaries. Internal free edges still - // use Eps, and real sizes are retained there to preserve neighbour spacing. + // use Eps, and real sizes are retained there to preserve neighbor spacing. var packW = w > f.W && w <= f.W + rightSlack && System.Math.Abs(f.Right - Width) <= Eps ? f.W : w; var packH = h > f.H && h <= f.H + topSlack && System.Math.Abs(f.Top - Height) <= Eps diff --git a/OpenNest.Engine/Sequencing/DrawnPathSequencing.cs b/OpenNest.Engine/Sequencing/DrawnPathSequencing.cs index 52cd6794..f79a51e8 100644 --- a/OpenNest.Engine/Sequencing/DrawnPathSequencing.cs +++ b/OpenNest.Engine/Sequencing/DrawnPathSequencing.cs @@ -77,7 +77,7 @@ namespace OpenNest.Engine.Sequencing return (0, double.PositiveInfinity); var best = (Along: 0.0, Distance: point.DistanceTo(path[0])); - var travelled = 0.0; + var traveled = 0.0; for (var i = 1; i < path.Count; i++) { var start = path[i - 1]; @@ -94,8 +94,8 @@ namespace OpenNest.Engine.Sequencing var nearest = new Vector(start.X + dx * t, start.Y + dy * t); var distance = point.DistanceTo(nearest); if (distance < best.Distance - Tolerance.Epsilon) - best = (travelled + length * t, distance); - travelled += length; + best = (traveled + length * t, distance); + traveled += length; } return best; } diff --git a/OpenNest.Engine/Strategies/FillContext.cs b/OpenNest.Engine/Strategies/FillContext.cs index 4c46a377..2bac4c55 100644 --- a/OpenNest.Engine/Strategies/FillContext.cs +++ b/OpenNest.Engine/Strategies/FillContext.cs @@ -39,7 +39,7 @@ namespace OpenNest.Engine.Strategies /// /// A cheap layout shown before the slow strategies run, so it can be accepted early. It /// never becomes while strategies run, so they pick the same - /// winner as without it; the pipeline returns it only when cancelled while it still leads. + /// winner as without it; the pipeline returns it only when canceled while it still leads. /// public List Provisional { get; set; } diff --git a/OpenNest.FrontEnd.Tests/McpEngineHarnessProcessTests.cs b/OpenNest.FrontEnd.Tests/McpEngineHarnessProcessTests.cs index bf1cbc74..b8254735 100644 --- a/OpenNest.FrontEnd.Tests/McpEngineHarnessProcessTests.cs +++ b/OpenNest.FrontEnd.Tests/McpEngineHarnessProcessTests.cs @@ -91,7 +91,7 @@ public class McpEngineHarnessProcessTests(McpEngineHarnessChildFixture fixture) descendant = McpEngineHarnessChildFixture.GetProcess(root, "child"); await cancellation.CancelAsync(); var result = await run.WaitAsync(Watchdog); - Assert.Contains("cancelled", result, StringComparison.OrdinalIgnoreCase); + Assert.Contains("canceled", result, StringComparison.OrdinalIgnoreCase); Assert.DoesNotContain("Cleanup failed", result); await parent.WaitForExitAsync().WaitAsync(Watchdog); await descendant.WaitForExitAsync().WaitAsync(Watchdog); @@ -142,12 +142,12 @@ public class McpEngineHarnessProcessTests(McpEngineHarnessChildFixture fixture) } [Fact] - public async Task AlreadyCancelled_DoesNotStartChild() + public async Task AlreadyCanceled_DoesNotStartChild() { var root = fixture.NewRun(); var result = await fixture.Tool().TestEngine(root, cancellationToken: new CancellationToken(true)).WaitAsync(Watchdog); - Assert.Contains("cancelled", result, StringComparison.OrdinalIgnoreCase); + Assert.Contains("canceled", result, StringComparison.OrdinalIgnoreCase); Assert.False(File.Exists(root + ".parent")); } diff --git a/OpenNest.FrontEnd.Tests/NestingPipelineTests.cs b/OpenNest.FrontEnd.Tests/NestingPipelineTests.cs index c8a942ed..b6015588 100644 --- a/OpenNest.FrontEnd.Tests/NestingPipelineTests.cs +++ b/OpenNest.FrontEnd.Tests/NestingPipelineTests.cs @@ -126,7 +126,7 @@ public class NestingPipelineTests : IDisposable } [Fact] - public void Console_CancelledSolveDoesNotSave() + public void Console_CanceledSolveDoesNotSave() { var input = Path.Combine(directory, "input.nest"); var output = Path.Combine(directory, "output.nest"); @@ -412,7 +412,7 @@ public class NestingPipelineTests : IDisposable } [Fact] - public void Console_CancelledOrdinaryFillDoesNotOverwriteOutput() + public void Console_CanceledOrdinaryFillDoesNotOverwriteOutput() { var input = Path.Combine(directory, "input.nest"); var output = Path.Combine(directory, "output.nest"); diff --git a/OpenNest.IO/DrawingPackage.cs b/OpenNest.IO/DrawingPackage.cs index fb7784c0..3255614f 100644 --- a/OpenNest.IO/DrawingPackage.cs +++ b/OpenNest.IO/DrawingPackage.cs @@ -204,7 +204,7 @@ namespace OpenNest.IO return root.ToJsonString(NestFormat.JsonOptions); } - // StreamReader honours the byte-order mark the nest writer emits. + // StreamReader honors the byte-order mark the nest writer emits. private static string ReadText(ZipArchiveEntry entry) { using var stream = entry.Open(); diff --git a/OpenNest.IO/NestSnapshot.cs b/OpenNest.IO/NestSnapshot.cs index 997f3f73..9f8477e4 100644 --- a/OpenNest.IO/NestSnapshot.cs +++ b/OpenNest.IO/NestSnapshot.cs @@ -31,7 +31,7 @@ namespace OpenNest.IO /// /// Reads the copy back as a new nest. Each drawing of whose saved /// content equals a drawing in the copy is used in its place, so caches keyed by the - /// drawing (best fits, fill results), its colour and its id survive; a drawing whose + /// drawing (best fits, fill results), its color and its id survive; a drawing whose /// content changed comes from the copy. Reused drawings' nested counts then follow the /// returned nest, which replaces . /// diff --git a/OpenNest.Mcp/Tools/CuttingTools.cs b/OpenNest.Mcp/Tools/CuttingTools.cs index 93f692fd..0d878e9c 100644 --- a/OpenNest.Mcp/Tools/CuttingTools.cs +++ b/OpenNest.Mcp/Tools/CuttingTools.cs @@ -139,8 +139,8 @@ namespace OpenNest.Mcp.Tools + "acceptWarnings=true to apply it. Nothing changed."; var commit = proposal.Apply(acceptWarnings, cancellationToken); - if (commit.Status == CuttingCommitStatus.Cancelled) - return "Apply cancelled. Nothing changed."; + if (commit.Status == CuttingCommitStatus.Canceled) + return "Apply canceled. Nothing changed."; // Applied or refused, a proposal is used at most once. _session.CuttingProposal = null; diff --git a/OpenNest.Mcp/Tools/NestingTools.cs b/OpenNest.Mcp/Tools/NestingTools.cs index 9d99516b..d2e2ceea 100644 --- a/OpenNest.Mcp/Tools/NestingTools.cs +++ b/OpenNest.Mcp/Tools/NestingTools.cs @@ -480,7 +480,7 @@ namespace OpenNest.Mcp.Tools } // Reserve physical copies separately from display-layout targets. Do this // only after mapping every layout, so a repeat cannot steal a residual's - // target. A rejected/cancelled proposal reserves nothing and deletes nothing. + // target. A rejected/canceled proposal reserves nothing and deletes nothing. var reservations = new List>(); foreach (var proposed in result.Plates) { diff --git a/OpenNest.Mcp/Tools/TestTools.cs b/OpenNest.Mcp/Tools/TestTools.cs index 3c76e026..98e8dd55 100644 --- a/OpenNest.Mcp/Tools/TestTools.cs +++ b/OpenNest.Mcp/Tools/TestTools.cs @@ -123,7 +123,7 @@ namespace OpenNest.Mcp.Tools var error = $"Error running test harness: {ex.Message}"; if (ex is OperationCanceledException) { - var reason = cancellationToken.IsCancellationRequested ? "cancelled" : "timed out"; + var reason = cancellationToken.IsCancellationRequested ? "canceled" : "timed out"; error = $"Error running test harness: {reason}."; } if (started) diff --git a/OpenNest.Tests/Benchmark/BenchmarkScoringTests.cs b/OpenNest.Tests/Benchmark/BenchmarkScoringTests.cs index 8b498d5c..78a98a86 100644 --- a/OpenNest.Tests/Benchmark/BenchmarkScoringTests.cs +++ b/OpenNest.Tests/Benchmark/BenchmarkScoringTests.cs @@ -152,7 +152,7 @@ public class BenchmarkScoringTests } [Fact] - public void Run_OverlappingNeighbours_AreStillCaughtBySweep() + public void Run_OverlappingNeighbors_AreStillCaughtBySweep() { var job = Job(0.5, (Rect(10, 5), 3)); @@ -245,7 +245,7 @@ public class BenchmarkScoringTests return new Drawing("rect", pgm); } - /// 20x20 square with a 10x10 cutout centred in it. + /// 20x20 square with a 10x10 cutout centerd in it. private static Drawing Frame() { var pgm = new OpenNest.CNC.Program(); diff --git a/OpenNest.Tests/Benchmark/LegacyNestValidator.cs b/OpenNest.Tests/Benchmark/LegacyNestValidator.cs index 6870340c..e2349503 100644 --- a/OpenNest.Tests/Benchmark/LegacyNestValidator.cs +++ b/OpenNest.Tests/Benchmark/LegacyNestValidator.cs @@ -238,7 +238,7 @@ namespace OpenNest.Tests.Benchmark /// material, with holes subtracted on both sides - so a small part /// nested inside another part's cutout (part-in-part) is legal as long as /// it clears the cutout's edge by the spacing. Pairs are pruned with an - /// X-sorted sweep over bounding boxes so only neighbours reach the + /// X-sorted sweep over bounding boxes so only neighbors reach the /// polygon clipper. /// private static void ValidateSpacing( diff --git a/OpenNest.Tests/Benchmark/NestLayoutCheckTimingTests.cs b/OpenNest.Tests/Benchmark/NestLayoutCheckTimingTests.cs index b3659f82..faecd824 100644 --- a/OpenNest.Tests/Benchmark/NestLayoutCheckTimingTests.cs +++ b/OpenNest.Tests/Benchmark/NestLayoutCheckTimingTests.cs @@ -27,7 +27,7 @@ public class NestLayoutCheckTimingTests var job = new NestJob(new[] { part }, new[] { stock }); var builder = new NestJobResultBuilder(job); // Dense bounding-box candidates exercise the pair gate; both overlapping and - // disjoint diagonal neighbours occur. Violations are deliberate and compared. + // disjoint diagonal neighbors occur. Violations are deliberate and compared. builder.AddSheet(stock, Enumerable.Range(0, count) .Select(i => (part.Id, 2 + (i % 10) * 1.5, 2 + (i / 10) * 1.5, 0.0))); var result = builder.Build(NestJobStopReason.Completed); diff --git a/OpenNest.Tests/BestFit/BestFitCacheTests.cs b/OpenNest.Tests/BestFit/BestFitCacheTests.cs index 0be733e6..8c8bc585 100644 --- a/OpenNest.Tests/BestFit/BestFitCacheTests.cs +++ b/OpenNest.Tests/BestFit/BestFitCacheTests.cs @@ -54,7 +54,7 @@ public class BestFitCacheTests } [Fact] - public async Task GetOrCompute_Cancelled_StopsWaitingAndCachesBackgroundResult() + public async Task GetOrCompute_Canceled_StopsWaitingAndCachesBackgroundResult() { var drawing = MakeRotatedTShape(); var canonical = CanonicalFrame.AsCanonicalCopy(drawing); diff --git a/OpenNest.Tests/Breakoffs/BreakoffBuilderTests.cs b/OpenNest.Tests/Breakoffs/BreakoffBuilderTests.cs index 86f17b88..098ee4ad 100644 --- a/OpenNest.Tests/Breakoffs/BreakoffBuilderTests.cs +++ b/OpenNest.Tests/Breakoffs/BreakoffBuilderTests.cs @@ -45,7 +45,7 @@ public class BreakoffBuilderTests private static Breakoff On(params Entity[] join) => new() { EdgeIds = join.Select(e => e.Id).ToList() }; [Fact] - public void Layout_CutsTheJoiningLineBetweenTabs_TravellingWithTheScrapOnTheLeft() + public void Layout_CutsTheJoiningLineBetweenTabs_TravelingWithTheScrapOnTheLeft() { var (entities, join) = Chord(); diff --git a/OpenNest.Tests/CNC/ProgramSubProgramTransformTests.cs b/OpenNest.Tests/CNC/ProgramSubProgramTransformTests.cs index 37c4d627..5bd27e67 100644 --- a/OpenNest.Tests/CNC/ProgramSubProgramTransformTests.cs +++ b/OpenNest.Tests/CNC/ProgramSubProgramTransformTests.cs @@ -12,7 +12,7 @@ public class ProgramSubProgramTransformTests { private const double QuarterTurn = System.Math.PI / 2; - /// Incremental hole sub-program: a lead-in from the hole centre to + /// Incremental hole sub-program: a lead-in from the hole center to /// (1, 0), then a full radius-1 circle. private static Program MakeHoleSub() { @@ -58,7 +58,7 @@ public class ProgramSubProgramTransformTests pgm.Rotate(QuarterTurn); // (5, 5) -> (-5, 5) and (15, 5) -> (-5, 15); each lead-in ends one unit along - // the rotated +X axis, i.e. at +Y from its centre. + // the rotated +X axis, i.e. at +Y from its center. var ends = LeadInEnds(pgm); Assert.Equal(2, ends.Count); AssertPoint(-5, 6, ends[0]); diff --git a/OpenNest.Tests/CincinnatiCIFiber/CIFiberPostProcessorTests.cs b/OpenNest.Tests/CincinnatiCIFiber/CIFiberPostProcessorTests.cs index 8c1b8134..c12a3216 100644 --- a/OpenNest.Tests/CincinnatiCIFiber/CIFiberPostProcessorTests.cs +++ b/OpenNest.Tests/CincinnatiCIFiber/CIFiberPostProcessorTests.cs @@ -17,7 +17,7 @@ namespace OpenNest.Tests.CincinnatiCIFiber; /// /// Output-contract tests for the Cincinnati CI Fiber post, checked against the /// structure of a Cincinnati machine sample NC: header block, -/// restart jump, N-labelled contour blocks with /L macro lines, G41 +/// restart jump, N-labeled contour blocks with /L macro lines, G41 /// selection, trimmed coordinate format and the M50/M30/% tail. /// public class CIFiberPostProcessorTests @@ -44,7 +44,7 @@ public class CIFiberPostProcessorTests var pgm = new Program(Mode.Absolute); - // Hole sub-program: CCW full circle r=0.5 centred on the call offset, + // Hole sub-program: CCW full circle r=0.5 centerd on the call offset, // linear lead-in from below, left absolute then flipped to // incremental — exactly what ContourCuttingStrategy emits for a hole. var hole = new Program(Mode.Absolute); @@ -125,7 +125,7 @@ public class CIFiberPostProcessorTests Assert.Equal("G0X6Y6.4", lines[21]); // pierce = part(1,2) + hole(5,5) + (0,-0.6) Assert.Equal("/L \"L2\"", lines[22]); Assert.Equal("G41", lines[23]); - Assert.Equal("G1X6Y6.5", lines[24]); // contour start = hole centre + (0,-0.5) + Assert.Equal("G1X6Y6.5", lines[24]); // contour start = hole center + (0,-0.5) Assert.Equal("/L \"L6\"", lines[25]); Assert.Equal("G3X6Y6.5I0J0.5", lines[26]); // I/J incremental from arc start Assert.Equal("/L \"ZHSOFF\"", lines[27]); @@ -221,7 +221,7 @@ public class CIFiberPostProcessorTests var radial = new Vector( -double.Parse(m.Groups[1].Value, CultureInfo.InvariantCulture), -double.Parse(m.Groups[2].Value, CultureInfo.InvariantCulture) - ); // centre -> start + ); // center -> start travel = cut.StartsWith("G3") ? new Vector(-radial.Y, radial.X) : new Vector(radial.Y, -radial.X); @@ -265,8 +265,8 @@ public class CIFiberPostProcessorTests Assert.Equal("G0X-6.4Y6", lines[21]); // Contour start local (0,-0.5) -> (0.5,0) = (-6.5,6). Assert.Equal("G1X-6.5Y6", lines[24]); - // Full CCW circle, centre local (0,0.5) from the start -> (-0.5,0): - // centre at (-7,6), so I=-0.5 J=0. + // Full CCW circle, center local (0,0.5) from the start -> (-0.5,0): + // center at (-7,6), so I=-0.5 J=0. Assert.Equal("G3X-6.5Y6I-0.5J0", lines[26]); // Perimeter corner local (0,10) -> (-10,0): pierce (-2,1)+(0.5,0)... // pierce local (0,-0.5)->(0.5,0) = (-1.5,1); corner (-10,1)... check diff --git a/OpenNest.Tests/CincinnatiCIFiber/CIFiberSampleRegressionTests.cs b/OpenNest.Tests/CincinnatiCIFiber/CIFiberSampleRegressionTests.cs index 1bb4b6c0..4efb89a4 100644 --- a/OpenNest.Tests/CincinnatiCIFiber/CIFiberSampleRegressionTests.cs +++ b/OpenNest.Tests/CincinnatiCIFiber/CIFiberSampleRegressionTests.cs @@ -57,7 +57,7 @@ public class CIFiberSampleRegressionTests // OpenNest's own short perpendicular linear leads; circles take the // internal lead. TF5200 13.2.4.1 requires a LINEAR // first motion block after G41/G42, so holes must have linear - // leads. (The sample itself pierces holes at their centre and + // leads. (The sample itself pierces holes at their center and // uses 0.125 in perimeter leads; see the saved-lead-in test.) InternalLeadIn = new LineLeadIn { Length = 0.075, ApproachAngle = 90 }, ExternalLeadIn = new LineLeadIn { Length = 0.075, ApproachAngle = 90 }, diff --git a/OpenNest.Tests/ClampRailTests.cs b/OpenNest.Tests/ClampRailTests.cs index 8f7673f6..f9305729 100644 --- a/OpenNest.Tests/ClampRailTests.cs +++ b/OpenNest.Tests/ClampRailTests.cs @@ -485,7 +485,7 @@ public class ClampRailTests } [Fact] - public void RailClampAtHonoursTheToleranceAndNeedsARail() + public void RailClampAtHonorsTheToleranceAndNeedsARail() { var plate = Sheet(48, 120); Assert.Null(plate.RailClampAt(new Vector(36, 0.3))); // no rail diff --git a/OpenNest.Tests/CutOffs/CutOffGapTests.cs b/OpenNest.Tests/CutOffs/CutOffGapTests.cs index 2e17910f..8cb451b3 100644 --- a/OpenNest.Tests/CutOffs/CutOffGapTests.cs +++ b/OpenNest.Tests/CutOffs/CutOffGapTests.cs @@ -9,7 +9,7 @@ using OpenNest.Shapes; namespace OpenNest.Tests.CutOffs; /// -/// Trimming a piece between two crossing lines leaves a gap from one crossing centre to the other, +/// Trimming a piece between two crossing lines leaves a gap from one crossing center to the other, /// and the line splits into segments as it does around a part. Extend closes a gap; every consumer /// of a cut-off's limits treats a gap as uncut. /// @@ -43,7 +43,7 @@ public class CutOffGapTests } [Fact] - public void Trim_MiddlePiece_LeavesAGapBetweenTheCrossingCentres() + public void Trim_MiddlePiece_LeavesAGapBetweenTheCrossingCenters() { var (plate, horizontal) = Gapped(); diff --git a/OpenNest.Tests/CutOffs/CutOffRoundoffTests.cs b/OpenNest.Tests/CutOffs/CutOffRoundoffTests.cs index 0a5a6be4..d27a76a0 100644 --- a/OpenNest.Tests/CutOffs/CutOffRoundoffTests.cs +++ b/OpenNest.Tests/CutOffs/CutOffRoundoffTests.cs @@ -66,8 +66,8 @@ public class CutOffRoundoffTests Assert.Empty(AutomaticCutOffPlanner.Create(loadedPlate, options, settings).Definitions); } - // A pie slice whose arc ends 2d further from its centre than it starts. ConvertProgram - // only refits centres beyond Tolerance.Epsilon, so it rebuilds the start point ~2d past + // A pie slice whose arc ends 2d further from its center than it starts. ConvertProgram + // only refits centers beyond Tolerance.Epsilon, so it rebuilds the start point ~2d past // the cached bounds, as rotated imported arcs do at d = 2.5e-11. private static Plate MakeSlicePlate(double d) { diff --git a/OpenNest.Tests/CutOffs/CutOffSegmentsTests.cs b/OpenNest.Tests/CutOffs/CutOffSegmentsTests.cs index edff5ad3..4eb3d8f5 100644 --- a/OpenNest.Tests/CutOffs/CutOffSegmentsTests.cs +++ b/OpenNest.Tests/CutOffs/CutOffSegmentsTests.cs @@ -5,14 +5,14 @@ namespace OpenNest.Tests.CutOffs; /// /// A cut-off's trimmed segments are materialized as one part each, with its own place in the -/// cut sequence; each stands for the span of the line between its neighbouring segments. +/// cut sequence; each stands for the span of the line between its neighboring segments. /// public class CutOffSegmentsTests { private const double Clearance = 0.02; [Fact] - public void Of_GivesEachSegmentTheSpanBetweenItsNeighbours() + public void Of_GivesEachSegmentTheSpanBetweenItsNeighbors() { var (plate, cutOff, _, _) = ThreeSegments(); diff --git a/OpenNest.Tests/CutOffs/CutOffTrimTests.cs b/OpenNest.Tests/CutOffs/CutOffTrimTests.cs index 224390b2..2daafcf7 100644 --- a/OpenNest.Tests/CutOffs/CutOffTrimTests.cs +++ b/OpenNest.Tests/CutOffs/CutOffTrimTests.cs @@ -7,7 +7,7 @@ namespace OpenNest.Tests.CutOffs; /// /// Trim, Extend and Swap Through-Cut at a line's ends change only its start and end limits (gaps /// are in ): a trim stops on -/// the crossing line's centre, an extend runs to the next crossing line or the sheet edge, and a +/// the crossing line's center, an extend runs to the next crossing line or the sheet edge, and a /// swap makes the stopped line run through while the through line loses its far side. /// public class CutOffTrimTests diff --git a/OpenNest.Tests/CuttingPlanning/BestEffortCuttingPlanTests.cs b/OpenNest.Tests/CuttingPlanning/BestEffortCuttingPlanTests.cs index bb8d9f76..0479ebfa 100644 --- a/OpenNest.Tests/CuttingPlanning/BestEffortCuttingPlanTests.cs +++ b/OpenNest.Tests/CuttingPlanning/BestEffortCuttingPlanTests.cs @@ -110,7 +110,7 @@ public class BestEffortCuttingPlanTests } [Fact] - public void MixedBatch_StaleOrCancelledChangesNothing() + public void MixedBatch_StaleOrCanceledChangesNothing() { var imperfect = TouchingContours(); var clean = new Part(new Drawing("clean", ExplicitContourTests.Square(false)), new Vector(1, 1)); @@ -119,10 +119,10 @@ public class BestEffortCuttingPlanTests var batch = CuttingPlanBatch.Capture(plates, ExplicitContourTests.Parameters(), false); var proposal = batch.Plan(); Assert.True(proposal.RequiresWarningAcceptance); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); - Assert.Equal(CuttingCommitStatus.Cancelled, proposal.Apply(true, cancelled.Token).Status); - Assert.False(batch.Plan(token: cancelled.Token).CanApplyWithWarnings); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + Assert.Equal(CuttingCommitStatus.Canceled, proposal.Apply(true, canceled.Token).Status); + Assert.False(batch.Plan(token: canceled.Token).CanApplyWithWarnings); imperfect.Offset(1, 0); Assert.Null(proposal.BuildPreview(1)); Assert.Equal(CuttingCommitStatus.Stale, proposal.Apply(acceptWarnings: true).Status); @@ -202,7 +202,7 @@ public class BestEffortCuttingPlanTests } [Fact] - public void ProvenNestedPart_PrecedesItsHostEvenWithAnImperfectNeighbour() + public void ProvenNestedPart_PrecedesItsHostEvenWithAnImperfectNeighbor() { var hostProgram = ExplicitContourTests.Square(false); hostProgram.MoveTo(2, 2); hostProgram.LineTo(8, 2); hostProgram.LineTo(8, 8); diff --git a/OpenNest.Tests/CuttingPlanning/CircleNextCutTests.cs b/OpenNest.Tests/CuttingPlanning/CircleNextCutTests.cs index 980a6290..dee06cfc 100644 --- a/OpenNest.Tests/CuttingPlanning/CircleNextCutTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CircleNextCutTests.cs @@ -10,10 +10,10 @@ public class CircleNextCutTests private static Program WithHoles() { var program = LeadPathValidationTests.Rectangle(0, 0, 16, 12); - foreach (var centre in new[] { new Vector(3, 3), new Vector(9, 4), new Vector(11, 8) }) + foreach (var center in new[] { new Vector(3, 3), new Vector(9, 4), new Vector(11, 8) }) { - program.MoveTo(centre.X + 1, centre.Y); - program.ArcTo(centre.X + 1, centre.Y, centre.X, centre.Y, RotationType.CCW); + program.MoveTo(center.X + 1, center.Y); + program.ArcTo(center.X + 1, center.Y, center.X, center.Y, RotationType.CCW); } return program; } @@ -27,14 +27,14 @@ public class CircleNextCutTests { var prepared = PreparedContours.Capture(WithHoles(), HoleLookAheadTests.Parameters()); var target = new Vector(x, y); - var catalogue = prepared.AutomaticEntryCandidatesWithFallbacks(0, target); - var ranked = catalogue.RankTowardNextCut(target, new Vector(-4, -3)); + var catalog = prepared.AutomaticEntryCandidatesWithFallbacks(0, target); + var ranked = catalog.RankTowardNextCut(target, new Vector(-4, -3)); var expected = prepared.ClosestEntry(0, target).Point; Assert.True(ranked[0].Choice.Point.DistanceTo(expected) < 1e-8, $"Expected next-facing {expected}, got {ranked[0].Choice.Point}"); - Assert.Equal(catalogue.Count, ranked.Count); - Assert.All(catalogue, candidate => Assert.Contains(candidate, ranked)); + Assert.Equal(catalog.Count, ranked.Count); + Assert.All(catalog, candidate => Assert.Contains(candidate, ranked)); for (var angle = 0; angle < 8; angle++) { var point = new Vector(3, 3) + new Vector(System.Math.Cos(angle * System.Math.PI / 4), @@ -48,8 +48,8 @@ public class CircleNextCutTests { var prepared = PreparedContours.Capture(WithHoles(), HoleLookAheadTests.Parameters()); var target = new Vector(13, 4); - var catalogue = prepared.AutomaticEntryCandidatesWithFallbacks(0, target); - var ranked = catalogue.RankTowardNextCut(target, new Vector(-4, -3)); + var catalog = prepared.AutomaticEntryCandidatesWithFallbacks(0, target); + var ranked = catalog.RankTowardNextCut(target, new Vector(-4, -3)); var exact = prepared.ClosestEntry(0, target).Point; var material = LeadMaterialSnapshot.Capture(WithHoles(), Vector.Zero); var feasibility = new ContourEntryFeasibility(prepared, Vector.Zero, material, []); @@ -88,10 +88,10 @@ public class CircleNextCutTests Assert.True(result.IndependentlyReplayed); var proposed = result.ProposedOrder[0]; var runs = HoleLookAheadTests.CutRuns(proposed.Execution); - var centres = new[] { new Vector(3, 3), new Vector(9, 4), new Vector(11, 8) }; + var centers = new[] { new Vector(3, 3), new Vector(9, 4), new Vector(11, 8) }; for (var i = 0; i < 3; i++) { - var radial = runs[i].End - centres[proposed.ContourChoices[i].ContourOrdinal]; + var radial = runs[i].End - centers[proposed.ContourChoices[i].ContourOrdinal]; var steps = System.Math.Atan2(radial.Y, radial.X) * 180 / System.Math.PI / increment; Assert.True(System.Math.Abs(steps - System.Math.Round(steps)) < 1e-8); } diff --git a/OpenNest.Tests/CuttingPlanning/ContinuedContourCheckTests.cs b/OpenNest.Tests/CuttingPlanning/ContinuedContourCheckTests.cs index de509e4a..d665b37b 100644 --- a/OpenNest.Tests/CuttingPlanning/ContinuedContourCheckTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContinuedContourCheckTests.cs @@ -31,7 +31,7 @@ public class ContinuedContourCheckTests { var choice = prepared.ClosestEntry(hole, position); choices.Add(choice); - position = prepared.HoleCentres()[hole]!.Value; + position = prepared.HoleCenters()[hole]!.Value; } ReleasedContourState continued = null; diff --git a/OpenNest.Tests/CuttingPlanning/ContourCandidateEmissionTests.cs b/OpenNest.Tests/CuttingPlanning/ContourCandidateEmissionTests.cs index e8f7ce42..d0e9c151 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourCandidateEmissionTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourCandidateEmissionTests.cs @@ -253,7 +253,7 @@ public class ContourCandidateEmissionTests /// One hash per emitted contour block: cut/lead motion runs in emission order, split at /// each first lead-in that follows cut motion (every lead style in Parameters() emits /// lead-in motions; scribe motions precede all blocks and are excluded). Each block is - /// normalised to its own first motion's start and quantised to 1e-9 because the emitted + /// normalized to its own first motion's start and quantized to 1e-9 because the emitted /// programs are incremental — the reader resolves absolute positions by accumulating /// from the program head, so the same code chain differs from a fresh head by ulps. /// diff --git a/OpenNest.Tests/CuttingPlanning/ContourEntryCandidateTests.cs b/OpenNest.Tests/CuttingPlanning/ContourEntryCandidateTests.cs index ea3eb3de..b05e126a 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourEntryCandidateTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourEntryCandidateTests.cs @@ -5,7 +5,7 @@ using OpenNest.Geometry; namespace OpenNest.Tests.CuttingPlanning; /// -/// The uncapped preferred automatic start catalogue: convex corners first, then straight +/// The uncapped preferred automatic start catalog: convex corners first, then straight /// midpoints, then line/arc tangent joints — from the contour's own winding, geometrically /// deduplicated, never reflex/cusp vertices or collinear splits, and owned immutably. /// @@ -35,7 +35,7 @@ public class ContourEntryCandidateTests return p; } - // --- positive catalogue ------------------------------------------------------- + // --- positive catalog ------------------------------------------------------- [Fact] public void Square_ExposesFourCornersThenFourMidpoints() @@ -57,13 +57,13 @@ public class ContourEntryCandidateTests [InlineData(true)] public void ReversedWinding_SameCornersAndMidpoints(bool reversed) { - static List<(AutomaticEntryKind Kind, double X, double Y)> Catalogue(Program program) => + static List<(AutomaticEntryKind Kind, double X, double Y)> Catalog(Program program) => Capture(program).AutomaticEntryCandidates(0) .Select(c => (Kind: c.Kind, X: System.Math.Round(c.Choice.Point.X, 6), Y: System.Math.Round(c.Choice.Point.Y, 6))) .OrderBy(x => x.Kind).ThenBy(x => x.X).ThenBy(x => x.Y).ToList(); - var forward = Catalogue(ExplicitContourTests.Square(false)); - Assert.Equal(forward, Catalogue(ExplicitContourTests.Square(reversed))); + var forward = Catalog(ExplicitContourTests.Square(false)); + Assert.Equal(forward, Catalog(ExplicitContourTests.Square(reversed))); Assert.Equal(8, forward.Count); } @@ -239,7 +239,7 @@ public class ContourEntryCandidateTests } [Fact] - public void Circle_HasNoPreferredCatalogue() + public void Circle_HasNoPreferredCatalog() { var p = new Program(); p.MoveTo(5, 3); @@ -270,7 +270,7 @@ public class ContourEntryCandidateTests } [Fact] - public void MutatingSourceProgramAfterCapture_CannotChangeTheCatalogue() + public void MutatingSourceProgramAfterCapture_CannotChangeTheCatalog() { var source = ExplicitContourTests.Square(false); var prepared = Capture(source); @@ -285,18 +285,18 @@ public class ContourEntryCandidateTests } [Fact] - public void CancelledToken_Throws() + public void CanceledToken_Throws() { var prepared = Capture(ExplicitContourTests.Square(false)); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); Assert.Throws(() => - prepared.AutomaticEntryCandidates(prepared.PerimeterOrdinal, cancelled.Token)); + prepared.AutomaticEntryCandidates(prepared.PerimeterOrdinal, canceled.Token)); } [Fact] - public void CatalogueCandidates_BelongToThisPreparation_AndEmit() + public void CatalogCandidates_BelongToThisPreparation_AndEmit() { var prepared = Capture(ExplicitContourTests.Square(false)); var corner = prepared.AutomaticEntryCandidates(prepared.PerimeterOrdinal) @@ -336,10 +336,10 @@ public class ContourEntryCandidateTests p.MoveTo(5, 3); p.ArcTo(5, 3, 3, 3, RotationType.CCW); // end (5,3), center (3,3), radius 2 - // The preferred catalogue still refuses a whole circle... + // The preferred catalog still refuses a whole circle... Assert.Throws(() => Capture(p).AutomaticEntryCandidates(0)); - // ...but the fallback catalogue makes it usable: the eight native compass points. + // ...but the fallback catalog makes it usable: the eight native compass points. var plain = WithFallbacks(p); Assert.Equal(8, plain.Count); Assert.All(plain, c => Assert.Equal(AutomaticEntryKind.CircleCompass, c.Kind)); @@ -380,7 +380,7 @@ public class ContourEntryCandidateTests var mid = Assert.Single(withFallbacks, c => c.Kind == AutomaticEntryKind.ArcMidpoint); Assert.Equal(5, mid.Choice.Point.X, 9); Assert.Equal(15, mid.Choice.Point.Y, 9); - // Tier 3: strictly after every preferred kind in catalogue order. + // Tier 3: strictly after every preferred kind in catalog order. var lastPreferred = withFallbacks.Select(c => c.Kind).ToList() .FindLastIndex(k => k <= AutomaticEntryKind.TangentJoint); var midpointIndex = withFallbacks.ToList().IndexOf(mid); @@ -463,7 +463,7 @@ public class ContourEntryCandidateTests { // Boundary notch 0.6 deep — exactly 2 x lead-in. The inset from each convex // opening corner lands exactly on the reflex inner corner, so neither inner - // corner may appear in the automatic catalogue at all. + // corner may appear in the automatic catalog at all. var p = ClosedContour(new[] { new Vector(0, 0), new Vector(10, 0), new Vector(10, 10), new Vector(0, 10), @@ -492,7 +492,7 @@ public class ContourEntryCandidateTests // The forbidden closest point is dropped entirely... Assert.DoesNotContain(candidates, c => Distance(c.Choice.Point, reflex) < 1e-9); Assert.DoesNotContain(candidates, c => c.Kind == AutomaticEntryKind.TargetFacing); - // ...and the catalogue stays usable through the other fallbacks. + // ...and the catalog stays usable through the other fallbacks. Assert.Contains(candidates, c => c.Kind == AutomaticEntryKind.NearCorner); } @@ -509,9 +509,9 @@ public class ContourEntryCandidateTests } [Fact] - public void FallbackCatalogue_IsNonEmptyForEveryShape_AndHonoursCancellation() + public void FallbackCatalog_IsNonEmptyForEveryShape_AndHonorsCancellation() { - // All-rounded contour (bump square) stays usable; cancellation is honoured. + // All-rounded contour (bump square) stays usable; cancellation is honored. var bump = new Program(); bump.MoveTo(0, 0); bump.LineTo(10, 0); @@ -521,10 +521,10 @@ public class ContourEntryCandidateTests Assert.NotEmpty(WithFallbacks(bump)); var prepared = PreparedContours.Capture(ExplicitContourTests.Square(false), ExplicitContourTests.Parameters()); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); Assert.Throws(() => - prepared.AutomaticEntryCandidatesWithFallbacks(0, new Vector(1, 1), cancelled.Token)); + prepared.AutomaticEntryCandidatesWithFallbacks(0, new Vector(1, 1), canceled.Token)); } [Theory] diff --git a/OpenNest.Tests/CuttingPlanning/ContourEntryFeasibilityTests.cs b/OpenNest.Tests/CuttingPlanning/ContourEntryFeasibilityTests.cs index 7590d50a..ae08a14b 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourEntryFeasibilityTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourEntryFeasibilityTests.cs @@ -57,12 +57,12 @@ public class ContourEntryFeasibilityTests } [Fact] - public void NeighbourContactRejectsKeepingReason() + public void NeighborContactRejectsKeepingReason() { var (prepared, choice, own) = PreparedSquare(); - // A neighbouring sheet covering the lead-in approach region. - var neighbour = Box(-1.5, 4.4, -0.05, 5.6); - var feasibility = new ContourEntryFeasibility(prepared, At, own, [neighbour]); + // A neighboring sheet covering the lead-in approach region. + var neighbor = Box(-1.5, 4.4, -0.05, 5.6); + var feasibility = new ContourEntryFeasibility(prepared, At, own, [neighbor]); var verdict = feasibility.Check(choice); @@ -161,9 +161,9 @@ public class ContourEntryFeasibilityTests Assert.True(adapter.Check(choice).IsClear); Assert.True(adapter.Check(choice with { }).IsClear); Assert.Equal(1, adapter.EvaluationCount); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); - Assert.ThrowsAny(() => adapter.Check(foreign, token: cancelled.Token)); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + Assert.ThrowsAny(() => adapter.Check(foreign, token: canceled.Token)); Assert.True(adapter.Check(choice).IsClear); Assert.Equal(1, adapter.EvaluationCount); } @@ -190,10 +190,10 @@ public class ContourEntryFeasibilityTests { var (prepared, choice, own) = PreparedSquare(); var feasibility = new ContourEntryFeasibility(prepared, At, own, []); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); - Assert.ThrowsAny(() => feasibility.Check(choice, token: cancelled.Token)); + Assert.ThrowsAny(() => feasibility.Check(choice, token: canceled.Token)); Assert.Equal(0, feasibility.EvaluationCount); Assert.True(feasibility.Check(choice).IsClear); } diff --git a/OpenNest.Tests/CuttingPlanning/ContourEntryRankingTests.cs b/OpenNest.Tests/CuttingPlanning/ContourEntryRankingTests.cs index 739fc740..3a54af6c 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourEntryRankingTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourEntryRankingTests.cs @@ -5,13 +5,13 @@ using OpenNest.Geometry; namespace OpenNest.Tests.CuttingPlanning; /// -/// The pure facing/tier/travel ranking of the entry catalogue: deterministic lexicographic +/// The pure facing/tier/travel ranking of the entry catalog: deterministic lexicographic /// order toward a look-ahead target (or toward arrival alone for the last part), with the -/// catalogue itself untouched and entity order never meaningful. +/// catalog itself untouched and entity order never meaningful. /// public class ContourEntryRankingTests { - private static IReadOnlyList Catalogue(Program program) => + private static IReadOnlyList Catalog(Program program) => PreparedContours.Capture(program, ExplicitContourTests.Parameters()) .AutomaticEntryCandidatesWithFallbacks(0); @@ -55,7 +55,7 @@ public class ContourEntryRankingTests [Fact] public void LowerRightTarget_PrefersTheBottomRightCorner() { - var ranked = Catalogue(Square(SquareVertices)).RankTowardNextCut(new Vector(14, -2)); + var ranked = Catalog(Square(SquareVertices)).RankTowardNextCut(new Vector(14, -2)); // Facing sides right and bottom; the shared corner is the ideal start. var first = Assert.Single(ranked.Take(1)); @@ -70,7 +70,7 @@ public class ContourEntryRankingTests public void FacingMidpoint_BeatsANonFacingCorner() { // Target due right: only the right side faces it; the left corners face away. - var ranked = Catalogue(Square(SquareVertices)).RankTowardNextCut(new Vector(14, 5)); + var ranked = Catalog(Square(SquareVertices)).RankTowardNextCut(new Vector(14, 5)); var order = ranked.ToList(); var rightMid = order.FindIndex(c => c.Kind == AutomaticEntryKind.StraightMidpoint && At(c, 10, 5)); @@ -81,7 +81,7 @@ public class ContourEntryRankingTests [Fact] public void SameFacingClass_CornerBeatsMidpoint() { - var ranked = Catalogue(Square(SquareVertices)).RankTowardNextCut(new Vector(14, -2)); + var ranked = Catalog(Square(SquareVertices)).RankTowardNextCut(new Vector(14, -2)); var order = ranked.ToList(); var corner = order.FindIndex(c => c.Kind == AutomaticEntryKind.ConvexCorner && At(c, 10, 0)); @@ -98,9 +98,9 @@ public class ContourEntryRankingTests [InlineData(true)] public void FilletedCorner_BeatsAFacingMidpointNearerTheRoute(bool clockwise) { - // Travel favours the right edge's midpoint, but a long edge's middle is a last resort: + // Travel favors the right edge's midpoint, but a long edge's middle is a last resort: // the joints of the facing rounded corner count on both of its sides and lead. - var ranked = Catalogue(ContourEntryCandidateTests.RoundedSquare(clockwise)) + var ranked = Catalog(ContourEntryCandidateTests.RoundedSquare(clockwise)) .RankTowardNextCut(new Vector(14, 6), new Vector(12, 5)).ToList(); Assert.Equal(AutomaticEntryKind.ConvexCorner, ranked[0].Kind); @@ -119,7 +119,7 @@ public class ContourEntryRankingTests Assert.Equal(AutomaticEntryKind.NearCorner.RankTier(), AutomaticEntryKind.CircleCompass.RankTier()); // Facing still dominates tier: a joint on both facing sides outranks a non-facing corner. - var ranked = Catalogue(BumpSquare()).RankTowardNextCut(new Vector(14, 14)); + var ranked = Catalog(BumpSquare()).RankTowardNextCut(new Vector(14, 14)); var joint = Assert.Single(ranked.Where(c => c.Kind == AutomaticEntryKind.TangentJoint && At(c, 10, 10))); Assert.True(ranked.ToList().IndexOf(joint) < ranked.ToList().FindIndex(c => c.Kind == AutomaticEntryKind.ConvexCorner && At(c, 0, 0))); @@ -140,28 +140,28 @@ public class ContourEntryRankingTests var target = new Vector(14, -2); Assert.Equal( - Shape(Catalogue(Square(SquareVertices)).RankTowardNextCut(target, new Vector(-1, -1))), - Shape(Catalogue(Square(vertices)).RankTowardNextCut(target, new Vector(-1, -1)))); + Shape(Catalog(Square(SquareVertices)).RankTowardNextCut(target, new Vector(-1, -1))), + Shape(Catalog(Square(vertices)).RankTowardNextCut(target, new Vector(-1, -1)))); } [Fact] - public void InputCatalogue_IsNotMutated_AndNothingIsIntroduced() + public void InputCatalog_IsNotMutated_AndNothingIsIntroduced() { - var catalogue = Catalogue(BumpSquare()); - var before = Shape(catalogue); - var snapshot = catalogue.ToList(); + var catalog = Catalog(BumpSquare()); + var before = Shape(catalog); + var snapshot = catalog.ToList(); - var ranked = catalogue.RankTowardNextCut(new Vector(14, -2), new Vector(-1, -1)); + var ranked = catalog.RankTowardNextCut(new Vector(14, -2), new Vector(-1, -1)); Assert.Equal(before, Shape(snapshot)); // input untouched - Assert.Equal(catalogue.Count, ranked.Count); // permutation only - Assert.True(ranked.All(catalogue.Contains)); + Assert.Equal(catalog.Count, ranked.Count); // permutation only + Assert.True(ranked.All(catalog.Contains)); } [Fact] public void Ranking_NeverIntroducesReflexCandidates() { - // L-outline: (5,5) is reflex for its own travel and absent from the catalogue. + // L-outline: (5,5) is reflex for its own travel and absent from the catalog. var p = Square(new[] { new Vector(0, 0), new Vector(10, 0), new Vector(10, 10), new Vector(5, 10), @@ -170,7 +170,7 @@ public class ContourEntryRankingTests foreach (var target in new[] { new Vector(14, -2), new Vector(-4, 14), new Vector(14, 14) }) { - var ranked = Catalogue(p).RankTowardNextCut(target); + var ranked = Catalog(p).RankTowardNextCut(target); Assert.DoesNotContain(ranked, c => At(c, 5, 5)); } } @@ -178,9 +178,9 @@ public class ContourEntryRankingTests [Fact] public void NonFiniteTarget_IsRejected() { - var catalogue = Catalogue(Square(SquareVertices)); + var catalog = Catalog(Square(SquareVertices)); Assert.Throws(() => - catalogue.RankTowardNextCut(new Vector(double.NaN, 5))); + catalog.RankTowardNextCut(new Vector(double.NaN, 5))); } // --- no target (last part) -------------------------------------------------------- @@ -188,7 +188,7 @@ public class ContourEntryRankingTests [Fact] public void NoTarget_TierFirstThenDistanceToArrival() { - var ranked = Catalogue(Square(SquareVertices)).RankTowardNextCut(arrival: new Vector(5, 10)); + var ranked = Catalog(Square(SquareVertices)).RankTowardNextCut(arrival: new Vector(5, 10)); var order = ranked.ToList(); // Tier first: an outside corner outranks the midpoint the arrival sits on. @@ -208,14 +208,14 @@ public class ContourEntryRankingTests { // The last part faces where the head already is; the ranking must not drag it to // the plate origin when the arrival is elsewhere. - var ranked = Catalogue(Square(SquareVertices)) + var ranked = Catalog(Square(SquareVertices)) .RankTowardNextCut(arrival: new Vector(arrivalX, arrivalY)); Assert.True(At(ranked[0], expectedX, expectedY)); } [Fact] - public void EmptyCatalogue_RanksToEmpty() + public void EmptyCatalog_RanksToEmpty() { var empty = new List(); Assert.Empty(empty.RankTowardNextCut(new Vector(3, 4), new Vector(-1, -1))); diff --git a/OpenNest.Tests/CuttingPlanning/ContourEntrySelectionTests.cs b/OpenNest.Tests/CuttingPlanning/ContourEntrySelectionTests.cs index 68f066d5..b7998b47 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourEntrySelectionTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourEntrySelectionTests.cs @@ -203,7 +203,7 @@ public class ContourEntrySelectionTests } [Fact] - public void EmptyCatalogueIsExhaustedWithoutEvaluation() + public void EmptyCatalogIsExhaustedWithoutEvaluation() { var result = ContourEntrySelection.Select(Array.Empty(), _ => null!); @@ -215,13 +215,13 @@ public class ContourEntrySelectionTests [Fact] public void CancellationStopsBeforeAnyEvaluation() { - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); var candidates = new[] { Cand(0, 0) }; Assert.ThrowsAny(() => ContourEntrySelection.Select(candidates, _ => new(ContourFeasibilityStatus.Clear, null), - token: cancelled.Token)); + token: canceled.Token)); } [Fact] diff --git a/OpenNest.Tests/CuttingPlanning/ContourRecoveryFileTests.cs b/OpenNest.Tests/CuttingPlanning/ContourRecoveryFileTests.cs index 37f0b8c8..0543b2cc 100644 --- a/OpenNest.Tests/CuttingPlanning/ContourRecoveryFileTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ContourRecoveryFileTests.cs @@ -62,9 +62,9 @@ public class ContourRecoveryFileTests } using var cancellation = new CancellationTokenSource(); cancellation.Cancel(); - var cancelled = CuttingPlanBatch.Capture(plates, parameters, false).Plan(token: cancellation.Token); - Assert.True(cancelled.IsCancelled); - Assert.False(cancelled.CanApplyWithWarnings); + var canceled = CuttingPlanBatch.Capture(plates, parameters, false).Plan(token: cancellation.Token); + Assert.True(canceled.IsCanceled); + Assert.False(canceled.CanApplyWithWarnings); Assert.Equal(parts, plates.SelectMany(p => p.Parts)); Assert.Equal(programs, parts.Select(p => ExplicitContourTests.Fingerprint(p.Program))); Assert.Equal(poses, parts.Select(p => (p.Location, p.Rotation, p.LeadInsLocked))); diff --git a/OpenNest.Tests/CuttingPlanning/CutOffSegmentPlanningTests.cs b/OpenNest.Tests/CuttingPlanning/CutOffSegmentPlanningTests.cs index f9144293..0b3aeb42 100644 --- a/OpenNest.Tests/CuttingPlanning/CutOffSegmentPlanningTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CutOffSegmentPlanningTests.cs @@ -65,7 +65,7 @@ public class CutOffSegmentPlanningTests Assert.Equal(expected, string.Join(" ", result.ProposedOrder.Select(o => Name(o.SourcePart)))); } - // Two rows of interlocking parts (each column's neck sits beside its neighbours' bodies) + // Two rows of interlocking parts (each column's neck sits beside its neighbors' bodies) // with lines through two columns and a tail separator. The parts keep the route they get // without the lines; each segment precedes the parts beside it and nothing else. [Fact] diff --git a/OpenNest.Tests/CuttingPlanning/CutPinFrameLifecycleTests.cs b/OpenNest.Tests/CuttingPlanning/CutPinFrameLifecycleTests.cs index f6e87fba..d65c5462 100644 --- a/OpenNest.Tests/CuttingPlanning/CutPinFrameLifecycleTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CutPinFrameLifecycleTests.cs @@ -182,14 +182,14 @@ public class CutPinFrameLifecycleTests { var shapes = ShapeBuilder.GetShapes( ConvertProgram.ToGeometry(part.Program).Where(e => SpecialLayers.IsMaterial(e.Layer))); - var big = HoleCentre(shapes, BigRadius) + part.Location; - var small = HoleCentre(shapes, SmallRadius) + part.Location; + var big = HoleCenter(shapes, BigRadius) + part.Location; + var small = HoleCenter(shapes, SmallRadius) + part.Location; var turn = Direction(small - big) - Direction(SmallHole - BigHole); return source => (source - BigHole).Rotate(turn) + big; } - // A circle's bounding box is centred on it at any rotation. - private static Vector HoleCentre(List shapes, double radius) + // A circle's bounding box is centerd on it at any rotation. + private static Vector HoleCenter(List shapes, double radius) { var box = Assert.Single(shapes.Select(s => s.Entities.GetBoundingBox()), b => System.Math.Abs(b.Width - 2 * radius) < 1e-6 && System.Math.Abs(b.Length - 2 * radius) < 1e-6); diff --git a/OpenNest.Tests/CuttingPlanning/CutPinResolverTests.cs b/OpenNest.Tests/CuttingPlanning/CutPinResolverTests.cs index 25f8bb51..e22a2151 100644 --- a/OpenNest.Tests/CuttingPlanning/CutPinResolverTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CutPinResolverTests.cs @@ -185,7 +185,7 @@ public class CutPinResolverTests [Fact] public void CanonicalCopy_CarriesNoPins() { - // A canonical copy's program is rotated about its centre, so source-frame pins would + // A canonical copy's program is rotated about its center, so source-frame pins would // not map onto it; its parts are rebound to the original drawing, which keeps them. var drawing = Bracket(Source(10, 6)); diff --git a/OpenNest.Tests/CuttingPlanning/CuttingGridOrderTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingGridOrderTests.cs index 3fb7e505..b6343e83 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingGridOrderTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingGridOrderTests.cs @@ -63,7 +63,7 @@ public class CuttingGridOrderTests public void DriftingRows_AreNotAGrid() { // The rows slope upward by 0.1 per unit of X: no gap separates one row from the next. - var extents = Interleaved(12, 20).Select(centre => Extent(centre + new Vector(0, centre.X * 0.1))).ToArray(); + var extents = Interleaved(12, 20).Select(center => Extent(center + new Vector(0, center.X * 0.1))).ToArray(); Assert.Null(CuttingGridOrder.Plan(extents, Vector.Zero, default)); } @@ -71,10 +71,10 @@ public class CuttingGridOrderTests [Fact] public void TwoPartsInOneCell_AreNotAGrid() { - var centres = Interleaved(12, 20).ToList(); - centres[5] = centres[4] + new Vector(0.1, 0.1); + var centers = Interleaved(12, 20).ToList(); + centers[5] = centers[4] + new Vector(0.1, 0.1); - Assert.Null(CuttingGridOrder.Plan(centres.Select(Extent).ToArray(), Vector.Zero, default)); + Assert.Null(CuttingGridOrder.Plan(centers.Select(Extent).ToArray(), Vector.Zero, default)); } [Fact] @@ -84,8 +84,8 @@ public class CuttingGridOrderTests var plate = nest.CreatePlate(); plate.Size = new Size(30, 30); var drawing = new Drawing("washer", Washer()); - foreach (var centre in Interleaved(12, 20)) - plate.Parts.Add(new Part(drawing, centre - new Vector(Diameter / 2, Diameter / 2))); + foreach (var center in Interleaved(12, 20)) + plate.Parts.Add(new Part(drawing, center - new Vector(Diameter / 2, Diameter / 2))); var parameters = new CuttingParameters { ExternalLeadIn = new LineLeadIn { Length = 0.15, ApproachAngle = 90 }, @@ -108,8 +108,8 @@ public class CuttingGridOrderTests Enumerable.Range(0, rows).SelectMany(row => Enumerable.Range(0, perRow) .Select(column => new Vector(1 + (2 * column + row % 2) * 1.03, 1 + row * 0.6))); - private static Box Extent(Vector centre) => - new(centre.X - Diameter / 2, centre.Y - Diameter / 2, Diameter, Diameter); + private static Box Extent(Vector center) => + new(center.X - Diameter / 2, center.Y - Diameter / 2, Diameter, Diameter); private static Program Washer() { diff --git a/OpenNest.Tests/CuttingPlanning/CuttingHoleOrderTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingHoleOrderTests.cs index 692a975a..51324698 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingHoleOrderTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingHoleOrderTests.cs @@ -24,20 +24,20 @@ public class CuttingHoleOrderTests private static readonly Vector C = new(3, 10); private static readonly Vector Entry = new(6, 0); - private static double Cost(IReadOnlyList route, IReadOnlyList centres, + private static double Cost(IReadOnlyList route, IReadOnlyList centers, Vector arrival, Vector? endpoint) { var total = 0.0; var position = arrival; foreach (var hole in route) { - total += position.DistanceTo(centres[hole]); - position = centres[hole]; + total += position.DistanceTo(centers[hole]); + position = centers[hole]; } return endpoint is { } e ? total + position.DistanceTo(e) : total; } - private static double Minimum(IReadOnlyList holes, IReadOnlyList centres, + private static double Minimum(IReadOnlyList holes, IReadOnlyList centers, Vector arrival, Vector? endpoint) { double Best(IEnumerable remaining, Vector from, double soFar) @@ -45,7 +45,7 @@ public class CuttingHoleOrderTests if (!remaining.Any()) return soFar + (endpoint is { } e ? from.DistanceTo(e) : 0); return remaining.Min(next => Best(remaining.Where(h => h != next), - centres[next], soFar + from.DistanceTo(centres[next]))); + centers[next], soFar + from.DistanceTo(centers[next]))); } return Best(holes, arrival, 0); } @@ -59,20 +59,20 @@ public class CuttingHoleOrderTests [Fact] public void SingleHoleIsTheOnlyOrder() { - var centres = new[] { A }; - var order = CuttingHoleOrder.Plan(new[] { 0 }, centres, Arrival, Entry); + var centers = new[] { A }; + var order = CuttingHoleOrder.Plan(new[] { 0 }, centers, Arrival, Entry); Assert.Equal(new[] { 0 }, order); } [Fact] public void PerimeterEntryChangesTheRouteWhereBruteForceSaysItShould() { - var centres = new[] { A, B, C }; + var centers = new[] { A, B, C }; var holes = new[] { 0, 1, 2 }; - var open = CuttingPartOrder.Plan(centres, Arrival, + var open = CuttingPartOrder.Plan(centers, Arrival, holes.Select(_ => (IReadOnlyCollection)Array.Empty()).ToList(), default); - var faced = CuttingHoleOrder.Plan(holes, centres, Arrival, Entry); + var faced = CuttingHoleOrder.Plan(holes, centers, Arrival, Entry); // The endpoint genuinely changes the proposal: the open path ends at C (away from // the entry), the faced path ends at B (next to the entry). @@ -80,19 +80,19 @@ public class CuttingHoleOrderTests Assert.Equal(1, faced[^1]); // Each is the brute-force optimum for its own cost function (computed here). - Assert.Equal(Minimum(holes, centres, Arrival, null), Cost(open, centres, Arrival, null), 9); - Assert.Equal(Minimum(holes, centres, Arrival, Entry), Cost(faced, centres, Arrival, Entry), 9); + Assert.Equal(Minimum(holes, centers, Arrival, null), Cost(open, centers, Arrival, null), 9); + Assert.Equal(Minimum(holes, centers, Arrival, Entry), Cost(faced, centers, Arrival, Entry), 9); } [Fact] public void EveryRemainingHoleAppearsExactlyOnceAndNeverThePerimeter() { // Ordinals are the part's holes; the perimeter (say 7) is not among them. - var centres = new[] { A, B, C, new Vector(-4, 2), new Vector(2, -3), new Vector(8, 8), + var centers = new[] { A, B, C, new Vector(-4, 2), new Vector(2, -3), new Vector(8, 8), new Vector(0, 6), new Vector(6, -6) }; var holes = new[] { 0, 1, 2, 3, 4, 5, 6 }; - var order = CuttingHoleOrder.Plan(holes, centres, Arrival, Entry); + var order = CuttingHoleOrder.Plan(holes, centers, Arrival, Entry); Assert.Equal(holes.Length, order.Count); Assert.Equal(holes.OrderBy(h => h), order.OrderBy(h => h)); @@ -103,31 +103,31 @@ public class CuttingHoleOrderTests public void OptimalForRandomSetAgainstBruteForce() { var random = new Random(20261006); - var centres = Enumerable.Range(0, 7) + var centers = Enumerable.Range(0, 7) .Select(_ => new Vector(random.NextDouble() * 20 - 10, random.NextDouble() * 20 - 10)) .ToList(); var entry = new Vector(12.5, -11.25); var holes = Enumerable.Range(0, 7).ToArray(); - var order = CuttingHoleOrder.Plan(holes, centres, Arrival, entry); + var order = CuttingHoleOrder.Plan(holes, centers, Arrival, entry); // The bounded heuristic may not always equal the true optimum, so assert it is no - // worse than the nearest-neighbour baseline and within 1.05x brute force. - var brute = Minimum(holes, centres, Arrival, entry); - Assert.True(Cost(order, centres, Arrival, entry) <= brute * 1.05 + 1e-9, - $"proposed {Cost(order, centres, Arrival, entry):F4} > 1.05 x brute {brute:F4}"); + // worse than the nearest-neighbor baseline and within 1.05x brute force. + var brute = Minimum(holes, centers, Arrival, entry); + Assert.True(Cost(order, centers, Arrival, entry) <= brute * 1.05 + 1e-9, + $"proposed {Cost(order, centers, Arrival, entry):F4} > 1.05 x brute {brute:F4}"); } [Fact] public void TiesBreakByStableOrdinal() { - // Exact-distance pair from the arrival: nearest-neighbour takes the lower ordinal, + // Exact-distance pair from the arrival: nearest-neighbor takes the lower ordinal, // and strict-improvement-only passes never swap an equal-cost order arbitrarily. - var centres = new[] { new Vector(5, 0), new Vector(-5, 0) }; + var centers = new[] { new Vector(5, 0), new Vector(-5, 0) }; var noEndpoint = Array.Empty(); - var first = CuttingHoleOrder.Plan(new[] { 0, 1 }, centres, Arrival, new Vector(0, 100)); - var second = CuttingHoleOrder.Plan(new[] { 0, 1 }, centres, Arrival, new Vector(0, 100)); + var first = CuttingHoleOrder.Plan(new[] { 0, 1 }, centers, Arrival, new Vector(0, 100)); + var second = CuttingHoleOrder.Plan(new[] { 0, 1 }, centers, Arrival, new Vector(0, 100)); Assert.Equal(new[] { 0, 1 }, first); Assert.Equal(first, second); @@ -136,12 +136,12 @@ public class CuttingHoleOrderTests [Fact] public void CancellationPropagates() { - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); - var centres = new[] { A, B, C }; + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + var centers = new[] { A, B, C }; Assert.ThrowsAny(() => - CuttingHoleOrder.Plan(new[] { 0, 1, 2 }, centres, Arrival, Entry, cancelled.Token)); + CuttingHoleOrder.Plan(new[] { 0, 1, 2 }, centers, Arrival, Entry, canceled.Token)); } [Fact] @@ -149,14 +149,14 @@ public class CuttingHoleOrderTests { // The whole-part overload without an endpoint must be untouched by the extension. var random = new Random(7); - var centres = Enumerable.Range(0, 8) + var centers = Enumerable.Range(0, 8) .Select(_ => new Vector(random.NextDouble() * 30, random.NextDouble() * 30)) .ToList(); var none = Array.Empty(); - var prerequisites = centres.Select(_ => (IReadOnlyCollection)none).ToList(); + var prerequisites = centers.Select(_ => (IReadOnlyCollection)none).ToList(); - var legacy = CuttingPartOrder.Plan(centres, Arrival, prerequisites, default); - var extended = CuttingPartOrder.Plan(centres, Arrival, prerequisites, default, endpoint: null); + var legacy = CuttingPartOrder.Plan(centers, Arrival, prerequisites, default); + var extended = CuttingPartOrder.Plan(centers, Arrival, prerequisites, default, endpoint: null); Assert.Equal(legacy, extended); } diff --git a/OpenNest.Tests/CuttingPlanning/CuttingNestedOrderTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingNestedOrderTests.cs index cf9e283e..cb2609a6 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingNestedOrderTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingNestedOrderTests.cs @@ -7,7 +7,7 @@ namespace OpenNest.Tests.CuttingPlanning; public class CuttingNestedOrderTests { // Host 0 with a cutout holding parts 1-4 in a row, and loose parts 5 and 6 beside the host. - private static readonly Vector[] Centres = + private static readonly Vector[] Centers = [ new(50, 50), new(20, 50), new(40, 50), new(60, 50), new(80, 50), new(120, 10), new(120, 90), ]; @@ -15,18 +15,18 @@ public class CuttingNestedOrderTests [Fact] public void WithoutNestedParts_TheOrderIsThePlainTour() { - var parts = Enumerable.Range(0, Centres.Length).ToArray(); - var none = Centres.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); + var parts = Enumerable.Range(0, Centers.Length).ToArray(); + var none = Centers.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); var order = CuttingNestedOrder.Plan(parts, Vector.Zero, Context(none, none)); - Assert.Equal(CuttingPartOrder.Plan(parts, Centres, Vector.Zero, none, default), order); + Assert.Equal(CuttingPartOrder.Plan(parts, Centers, Vector.Zero, none, default), order); } [Fact] public void InnerParts_AreCutAsOneRunEndingBesideTheHost_AfterThePartsAroundIt() { - var parts = Enumerable.Range(0, Centres.Length).ToArray(); + var parts = Enumerable.Range(0, Centers.Length).ToArray(); var (prerequisites, inside) = Nested(); var order = CuttingNestedOrder.Plan(parts, Vector.Zero, Context(prerequisites, inside)); @@ -43,7 +43,7 @@ public class CuttingNestedOrderTests [Fact] public void LearnedRule_AcrossTheGroupStillHolds() { - var parts = Enumerable.Range(0, Centres.Length).ToArray(); + var parts = Enumerable.Range(0, Centers.Length).ToArray(); var (prerequisites, inside) = Nested(); // "Cut inner part 2 before loose part 5": the host group can no longer simply go last. prerequisites[5] = [2]; @@ -102,8 +102,8 @@ public class CuttingNestedOrderTests private static (IReadOnlyCollection[] Prerequisites, IReadOnlyCollection[] Inside) Nested() { - var prerequisites = Centres.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); - var inside = Centres.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); + var prerequisites = Centers.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); + var inside = Centers.Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); prerequisites[0] = [1, 2, 3, 4]; inside[0] = [1, 2, 3, 4]; return (prerequisites, inside); @@ -112,6 +112,6 @@ public class CuttingNestedOrderTests // The host's cutout spans x 5..95 at y 50; its nearest point to a position is that position's x clamped. private static CuttingNestedOrder.Context Context(IReadOnlyCollection[] prerequisites, IReadOnlyCollection[] inside) => - new(Centres, prerequisites, inside, + new(Centers, prerequisites, inside, (_, position) => new Vector(System.Math.Clamp(position.X, 5, 95), 50), default); } diff --git a/OpenNest.Tests/CuttingPlanning/CuttingPartOrderTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingPartOrderTests.cs index e726f8ff..a068dd5d 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingPartOrderTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingPartOrderTests.cs @@ -8,7 +8,7 @@ public class CuttingPartOrderTests private static readonly Vector[] Line = [new(1, 0), new(-2, 0), new(3, 0)]; [Fact] - public void Plan_ShortensTheNearestNeighbourTour() + public void Plan_ShortensTheNearestNeighborTour() { // Nearest first gives 0, 2, 1 (1 + 2 + 5 = 8); going left first is 2 + 3 + 2 = 7. var order = Plan(Line, NoPrerequisites(3)); @@ -52,21 +52,21 @@ public class CuttingPartOrderTests [Fact] public void Plan_ReversalsShortenTheTour() { - // Nearest neighbour gives 4, 1, 0, 2, 3. With reversals the tour ends at 4, 3, 1, 0, 2 + // Nearest neighbor gives 4, 1, 0, 2, 3. With reversals the tour ends at 4, 3, 1, 0, 2 // (14.14); moving short runs alone stops at 2, 0, 4, 1, 3 (15.30). - Vector[] centres = [new(-2, -1), new(0, -2), new(-4, 3), new(2, -4), new(0, -1)]; + Vector[] centers = [new(-2, -1), new(0, -2), new(-4, 3), new(2, -4), new(0, -1)]; - Assert.Equal(new[] { 4, 3, 1, 0, 2 }, Plan(centres, NoPrerequisites(5))); + Assert.Equal(new[] { 4, 3, 1, 0, 2 }, Plan(centers, NoPrerequisites(5))); } [Fact] public void Plan_MovesARunOfPartsWhereReversalsCannotHelp() { - // Nearest neighbour and 2-opt stop at 1, 3, 2, 0 (13.78); moving part 0 to the front + // Nearest neighbor and 2-opt stop at 1, 3, 2, 0 (13.78); moving part 0 to the front // gives 0, 1, 3, 2 (12.16). - Vector[] centres = [new(-3, 0), new(1, 0), new(4, -3), new(3, 0)]; + Vector[] centers = [new(-3, 0), new(1, 0), new(4, -3), new(3, 0)]; - Assert.Equal(new[] { 0, 1, 3, 2 }, Plan(centres, NoPrerequisites(4))); + Assert.Equal(new[] { 0, 1, 3, 2 }, Plan(centers, NoPrerequisites(4))); } [Fact] @@ -86,8 +86,8 @@ public class CuttingPartOrderTests Assert.Throws(() => Plan([new(0, 0), new(1, 0)], prerequisites)); } - private static int[] Plan(Vector[] centres, IReadOnlyCollection[] prerequisites) => - CuttingPartOrder.Plan(centres, Vector.Zero, prerequisites, CancellationToken.None); + private static int[] Plan(Vector[] centers, IReadOnlyCollection[] prerequisites) => + CuttingPartOrder.Plan(centers, Vector.Zero, prerequisites, CancellationToken.None); private static IReadOnlyCollection[] NoPrerequisites(int count) => Enumerable.Range(0, count).Select(_ => (IReadOnlyCollection)Array.Empty()).ToArray(); diff --git a/OpenNest.Tests/CuttingPlanning/CuttingPlanBatchTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingPlanBatchTests.cs index 6a7447d1..c02f088e 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingPlanBatchTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingPlanBatchTests.cs @@ -188,7 +188,7 @@ public class CuttingPlanBatchTests } [Fact] - public void PlanReorder_CancelledDuringShortPass_DoesNotRetryOrMutate() + public void PlanReorder_CanceledDuringShortPass_DoesNotRetryOrMutate() { var plate = Plate(new Nest(), Clean("first", 1, 1), Clean("second", 12, 1)); using var cancellation = new CancellationTokenSource(); @@ -199,7 +199,7 @@ public class CuttingPlanBatchTests var result = CuttingPlanBatch.PlanReorder(snapshot, cancellation.Token); - Assert.Equal(CuttingPlanStatus.Cancelled, result.Status); + Assert.Equal(CuttingPlanStatus.Canceled, result.Status); Assert.Equal(1, observations); Assert.Empty(result.ProposedOrder); Assert.All(plate.Parts, part => Assert.False(part.HasManualLeadIns)); @@ -304,7 +304,7 @@ public class CuttingPlanBatchTests } [Fact] - public void Plan_Cancelled_OffersNothingToApply() + public void Plan_Canceled_OffersNothingToApply() { var nest = new Nest(); var plate = Plate(nest, Clean("a", 1, 1)); @@ -314,9 +314,9 @@ public class CuttingPlanBatchTests var proposal = batch.Plan(token: cancellation.Token); - Assert.True(proposal.IsCancelled); + Assert.True(proposal.IsCanceled); Assert.False(proposal.CanApply); - Assert.Equal("Planning was cancelled. Nothing has changed.", proposal.Describe("in")[0]); + Assert.Equal("Planning was canceled. Nothing has changed.", proposal.Describe("in")[0]); Assert.Equal(CuttingCommitStatus.InvalidInput, proposal.Apply().Status); Assert.False(plate.Parts[0].HasManualLeadIns); Assert.Null(plate.CuttingParameters); diff --git a/OpenNest.Tests/CuttingPlanning/CuttingPlanCommitTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingPlanCommitTests.cs index 7560e56a..95f8b503 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingPlanCommitTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingPlanCommitTests.cs @@ -284,7 +284,7 @@ public class CuttingPlanCommitTests } [Fact] - public void Apply_CancelledBeforeCommit_ChangesNothing() + public void Apply_CanceledBeforeCommit_ChangesNothing() { var (_, plate, parts) = FixedPlate(); var result = CuttingPlanService.Plan(CuttingPlanRequest.ForPlate(plate)); @@ -295,7 +295,7 @@ public class CuttingPlanCommitTests var commit = CuttingPlanService.Apply([result], cancel.Token); - Assert.Equal(CuttingCommitStatus.Cancelled, commit.Status); + Assert.Equal(CuttingCommitStatus.Canceled, commit.Status); Assert.Equal(parts, plate.Parts); Assert.True(state.IsCurrent(), state.Difference()); Assert.Equal((0, 0, 0), events()); diff --git a/OpenNest.Tests/CuttingPlanning/CuttingPlanMessageTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingPlanMessageTests.cs index 36d55818..62dad1fd 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingPlanMessageTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingPlanMessageTests.cs @@ -94,14 +94,14 @@ public class CuttingPlanMessageTests Assert.Same(program, part.Program); } [Fact] - public void Describe_LockedLeadHitsNeighbour_WarnsWithAdviceAndNeedsAcceptance() + public void Describe_LockedLeadHitsNeighbor_WarnsWithAdviceAndNeedsAcceptance() { var settings = ExplicitContourTests.Parameters(); var clean = LeadPathValidationTests.Rectangle(0, 0, 10, 10); var prepared = PreparedContours.Capture(clean, settings); var part = new Part(new Drawing("lead blocked", clean)); Assert.True(part.RestoreLeadInProgram(prepared.Emit([prepared.ClosestEntry(0, new Vector(-1, 5))]), true)); - var obstacle = new Part(new Drawing("neighbour", LeadPathValidationTests.Rectangle(-0.3, 4.5, -0.1, 5.5))); + var obstacle = new Part(new Drawing("neighbor", LeadPathValidationTests.Rectangle(-0.3, 4.5, -0.1, 5.5))); var plate = new Nest().CreatePlate(); plate.Parts.Add(part); plate.Parts.Add(obstacle); @@ -117,7 +117,7 @@ public class CuttingPlanMessageTests Assert.Contains("Plate 1: unverified: fixed lead-ins need review.", text); Assert.Contains("- Part 1 (lead blocked): Locked lead on cutting contour 1 contacts or enters another " + "part's material. The locked program is kept as given. Increase spacing, or edit or unlock " - + "this part's lead-ins and replan. (with part 2 (neighbour))", text); + + "this part's lead-ins and replan. (with part 2 (neighbor))", text); Assert.DoesNotContain("other than None", text); Assert.Equal(CuttingCommitStatus.InvalidInput, proposal.Apply().Status); Assert.True(ProgramContent.Equal(original, part.Program)); @@ -171,7 +171,7 @@ public class CuttingPlanMessageTests [Theory] [InlineData(CuttingPlanStatus.UnsupportedGeometry)] - [InlineData(CuttingPlanStatus.Cancelled)] + [InlineData(CuttingPlanStatus.Canceled)] public void Describe_KeptOrderRefusalAMoreEffortCannotFix_OmitsTheSearchLimitHint(CuttingPlanStatus status) { var attempt = new CuttingPlanResult(CuttingPlanStatus.NoSolutionWithinBudget); diff --git a/OpenNest.Tests/CuttingPlanning/CuttingPlanServiceTests.cs b/OpenNest.Tests/CuttingPlanning/CuttingPlanServiceTests.cs index 3afaa09e..58fb992c 100644 --- a/OpenNest.Tests/CuttingPlanning/CuttingPlanServiceTests.cs +++ b/OpenNest.Tests/CuttingPlanning/CuttingPlanServiceTests.cs @@ -178,16 +178,16 @@ public class CuttingPlanServiceTests } [Fact] - public void Plan_CancelledCaptureAndWorkerHaveNoMutation() + public void Plan_CanceledCaptureAndWorkerHaveNoMutation() { var parts = Fixture(); var snapshot = CuttingPlanService.Capture(new CuttingPlanRequest(parts)); var unchanged = Unchanged(parts); using var cancellation = new CancellationTokenSource(); cancellation.Cancel(); - Assert.Equal(CuttingPlanStatus.Cancelled, + Assert.Equal(CuttingPlanStatus.Canceled, CuttingPlanService.Plan(new CuttingPlanRequest(parts), cancellation.Token).Status); - Assert.Equal(CuttingPlanStatus.Cancelled, CuttingPlanService.Plan(snapshot, cancellation.Token).Status); + Assert.Equal(CuttingPlanStatus.Canceled, CuttingPlanService.Plan(snapshot, cancellation.Token).Status); unchanged(); } diff --git a/OpenNest.Tests/CuttingPlanning/DrawingPinReviewTests.cs b/OpenNest.Tests/CuttingPlanning/DrawingPinReviewTests.cs index d6a66973..c806aafc 100644 --- a/OpenNest.Tests/CuttingPlanning/DrawingPinReviewTests.cs +++ b/OpenNest.Tests/CuttingPlanning/DrawingPinReviewTests.cs @@ -74,7 +74,7 @@ public class DrawingPinReviewTests } [Fact] - public void PrePost_PinnedLeadIntoNeighbour_IsReportedAgainAfterAcceptance() + public void PrePost_PinnedLeadIntoNeighbor_IsReportedAgainAfterAcceptance() { var nest = new Nest(); var plate = nest.CreatePlate(); @@ -82,18 +82,18 @@ public class DrawingPinReviewTests drawing.CutPins.Add(new ContourCutPin(new Vector(10, 5), new LineLeadIn { Length = 1.0, ApproachAngle = 90 }, new NoLeadOut())); plate.Parts.Add(new Part(drawing, Vector.Zero)); - plate.Parts.Add(new Part(new Drawing("neighbour", LeadPathValidationTests.Rectangle(0, 0, 2, 2)), new Vector(10.3, 4))); + plate.Parts.Add(new Part(new Drawing("neighbor", LeadPathValidationTests.Rectangle(0, 0, 2, 2)), new Vector(10.3, 4))); var proposal = CuttingPlanBatch.Capture([plate], PinnedContourTests.NestSettings(), false).Plan(); Assert.Equal(CuttingCommitStatus.Applied, proposal.Apply(acceptWarnings: true).Status); var pinned = plate.Parts.Single(p => p.BaseDrawing == drawing); - var neighbour = plate.Parts.Single(p => p.BaseDrawing != drawing); + var neighbor = plate.Parts.Single(p => p.BaseDrawing != drawing); var finding = Assert.Single(PostVerificationAnalyzer.Analyze(nest).Findings, f => f.Kind == PostVerificationKind.FixedLead); - Assert.Equal((plate.Parts.IndexOf(pinned) + 1, plate.Parts.IndexOf(neighbour) + 1), + Assert.Equal((plate.Parts.IndexOf(pinned) + 1, plate.Parts.IndexOf(neighbor) + 1), (finding.PartNumber!.Value, finding.OtherPartNumber!.Value)); Assert.Equal($"Drawing pin 1 lead on cutting contour 1 contacts or enters the material of part " - + $"{plate.Parts.IndexOf(neighbour) + 1}. Planning kept it as given; review it before posting.", finding.Message); + + $"{plate.Parts.IndexOf(neighbor) + 1}. Planning kept it as given; review it before posting.", finding.Message); } [Fact] diff --git a/OpenNest.Tests/CuttingPlanning/ErodedPierceTests.cs b/OpenNest.Tests/CuttingPlanning/ErodedPierceTests.cs index 3d021fac..262e4f7c 100644 --- a/OpenNest.Tests/CuttingPlanning/ErodedPierceTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ErodedPierceTests.cs @@ -11,7 +11,7 @@ public class ErodedPierceTests private static readonly Vector Start = new(-2, 1.5); [Fact] - public void Find_SlotIsPiercedOnItsCentreLineNearEachTarget() + public void Find_SlotIsPiercedOnItsCenterLineNearEachTarget() { var slot = Shape(Rectangle(2, 1, 2.4, 1.05)); @@ -58,7 +58,7 @@ public class ErodedPierceTests var holes = proposal.ContourChoices.Where(c => c.ContourOrdinal != snapshot.Placements[0].Prepared.PerimeterOrdinal).ToArray(); Assert.Equal(2, holes.Length); Assert.All(holes, c => Assert.NotNull(c.Pierce)); - // Each lead runs from near the centre line of its cutout to its entry: short, and no + // Each lead runs from near the center line of its cutout to its entry: short, and no // lead-out follows. var leads = proposal.Execution.Motions.Where(m => m.Layer == LayerType.Leadin).ToArray(); Assert.Equal(2, leads.Count(m => m.Length < 0.05)); @@ -86,7 +86,7 @@ public class ErodedPierceTests [Theory] [InlineData(90)] [InlineData(60)] - public void Planner_RoundHoleSmallerThanItsLeadIsPiercedAtItsCentre(double approach) + public void Planner_RoundHoleSmallerThanItsLeadIsPiercedAtItsCenter(double approach) { var program = new Program(); program.Merge(Circle(2, 1.5, 0.09)); @@ -110,7 +110,7 @@ public class ErodedPierceTests [Theory] [InlineData(0)] [InlineData(0.03)] - public void Planner_LeadStopsAtTheCentreLineOfANarrowStroke(double pierceDiameter) + public void Planner_LeadStopsAtTheCenterLineOfANarrowStroke(double pierceDiameter) { // A slot 0.06 wide: the 0.15 lead would fit along it at a shallow angle. var program = new Program(); @@ -143,22 +143,22 @@ public class ErodedPierceTests } [Fact] - public void StopAtCentreLine_LeadThatStaysOnItsOwnSideKeepsItsShape() + public void StopAtCenterLine_LeadThatStaysOnItsOwnSideKeepsItsShape() { var hole = Shape(Rectangle(0, 0, 2, 2)); var lead = new LineLeadIn { Length = 0.15, ApproachAngle = 60 }; - Assert.Same(lead, ContourCuttingStrategy.StopAtCentreLine(hole, new Vector(1, 0), lead, + Assert.Same(lead, ContourCuttingStrategy.StopAtCenterLine(hole, new Vector(1, 0), lead, System.Math.PI / 2, RotationType.CW)); } [Fact] - public void StopAtCentreLine_LeadLeavingACutoutIsLeftForTheLeadCheck() + public void StopAtCenterLine_LeadLeavingACutoutIsLeftForTheLeadCheck() { var hole = Shape(Rectangle(0, 0, 1, 0.06)); var lead = new LineLeadIn { Length = 0.5, ApproachAngle = 90 }; - Assert.Same(lead, ContourCuttingStrategy.StopAtCentreLine(hole, new Vector(0.5, 0), lead, + Assert.Same(lead, ContourCuttingStrategy.StopAtCenterLine(hole, new Vector(0.5, 0), lead, System.Math.PI / 2, RotationType.CW)); } diff --git a/OpenNest.Tests/CuttingPlanning/HoleDepartureTests.cs b/OpenNest.Tests/CuttingPlanning/HoleDepartureTests.cs index 8b88c80b..48847854 100644 --- a/OpenNest.Tests/CuttingPlanning/HoleDepartureTests.cs +++ b/OpenNest.Tests/CuttingPlanning/HoleDepartureTests.cs @@ -30,10 +30,10 @@ public class HoleDepartureTests return clean; } - private static void Circle(Program program, Vector centre, double radius) + private static void Circle(Program program, Vector center, double radius) { - program.MoveTo(centre.X + radius, centre.Y); - program.ArcTo(centre.X + radius, centre.Y, centre.X, centre.Y, RotationType.CCW); + program.MoveTo(center.X + radius, center.Y); + program.ArcTo(center.X + radius, center.Y, center.X, center.Y, RotationType.CCW); } // The saved settings this regression came from: 0.15 line lead-ins at 90 degrees, no lead-outs. @@ -61,9 +61,9 @@ public class HoleDepartureTests var adapter = new ContourEntryFeasibility(prepared, source.Location, source.Material, []); var outside = ContourEntrySelection.Select(prepared.AutomaticEntryCandidatesWithFallbacks(prepared.PerimeterOrdinal) .RankTowardNextCut(null, Start), c => adapter.Check(c.Choice)).Choices[0]; - var centres = prepared.HoleCentres().Select(c => c ?? Vector.Zero).ToArray(); + var centers = prepared.HoleCenters().Select(c => c ?? Vector.Zero).ToArray(); var route = new[] { 0, 1, 2, 3 }; - var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centres, Start, + var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centers, Start, c => adapter.Check(c.Choice)); Assert.True(preferred.IsPreferred, preferred.Reason); diff --git a/OpenNest.Tests/CuttingPlanning/HoleEndpointBudgetTests.cs b/OpenNest.Tests/CuttingPlanning/HoleEndpointBudgetTests.cs index 53d842ba..f78e460f 100644 --- a/OpenNest.Tests/CuttingPlanning/HoleEndpointBudgetTests.cs +++ b/OpenNest.Tests/CuttingPlanning/HoleEndpointBudgetTests.cs @@ -16,10 +16,10 @@ public class HoleEndpointBudgetTests { var parameters = HoleLookAheadTests.Parameters(); var clean = HoleLookAheadTests.MixedHoles(); - foreach (var centre in new[] { new Vector(4, 8), new Vector(8, 8) }) + foreach (var center in new[] { new Vector(4, 8), new Vector(8, 8) }) { - clean.MoveTo(centre.X + 0.75, centre.Y); - clean.ArcTo(centre.X + 0.75, centre.Y, centre.X, centre.Y, RotationType.CCW); + clean.MoveTo(center.X + 0.75, center.Y); + clean.ArcTo(center.X + 0.75, center.Y, center.X, center.Y, RotationType.CCW); } var first = new Part(new Drawing("four holes", clean)); var nextClean = LeadPathValidationTests.Rectangle(0, 0, 2, 2); @@ -42,10 +42,10 @@ public class HoleEndpointBudgetTests var target = new Vector(21, 3); var outside = ContourEntrySelection.Select(prepared.AutomaticEntryCandidatesWithFallbacks(4, target) .RankTowardNextCut(target, start), c => adapter.Check(c.Choice)).Choices[0]; - var centres = prepared.HoleCentres().Select(c => c ?? Vector.Zero).ToArray(); - var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2, 3 }, centres, start, + var centers = prepared.HoleCenters().Select(c => c ?? Vector.Zero).ToArray(); + var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2, 3 }, centers, start, PreferredContourEntries.Pierce(prepared, outside, default)); - var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centres, start, + var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centers, start, c => adapter.Check(c.Choice)); Assert.True(preferred.IsPreferred, preferred.Reason); var execution = ExecutionMotionReader.Read(prepared.Emit(preferred.HoleChoices.Append(outside).ToArray()), @@ -83,9 +83,9 @@ public class HoleEndpointBudgetTests Assert.Equal(1, bounded.Expansions); Assert.Empty(bounded.ProposedOrder); Assert.False(bounded.IndependentlyReplayed); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); - Assert.Equal(CuttingPlanStatus.Cancelled, CuttingPlanService.Plan(snapshot, cancelled.Token).Status); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + Assert.Equal(CuttingPlanStatus.Canceled, CuttingPlanService.Plan(snapshot, canceled.Token).Status); Assert.Equal(before, new[] { first, next }.Select(p => ExplicitContourTests.Fingerprint(p.Program))); } } diff --git a/OpenNest.Tests/CuttingPlanning/HoleLookAheadTests.cs b/OpenNest.Tests/CuttingPlanning/HoleLookAheadTests.cs index 92049f80..56ba7539 100644 --- a/OpenNest.Tests/CuttingPlanning/HoleLookAheadTests.cs +++ b/OpenNest.Tests/CuttingPlanning/HoleLookAheadTests.cs @@ -61,9 +61,9 @@ public class HoleLookAheadTests { // Calibrated for next-facing circle entries: the preferred rapid from hole 1 // to hole 2 touches already-cut hole 3; retain checked entry backtracking. - var centres = new[] { new Vector(3, 3), new Vector(6, 15), new Vector(3, 7), new Vector(3, 11) }; + var centers = new[] { new Vector(3, 3), new Vector(6, 15), new Vector(3, 7), new Vector(3, 11) }; var clean = LeadPathValidationTests.Rectangle(0, 0, 18, 18); - foreach (var c in centres) + foreach (var c in centers) { clean.MoveTo(c.X + 1.75, c.Y); clean.ArcTo(c.X + 1.75, c.Y, c.X, c.Y, RotationType.CCW); @@ -78,9 +78,9 @@ public class HoleLookAheadTests var adapter = new ContourEntryFeasibility(prepared, source.Location, source.Material, []); var outside = ContourEntrySelection.Select(prepared.AutomaticEntryCandidatesWithFallbacks(4) .RankTowardNextCut(null, start), c => adapter.Check(c.Choice)).Choices[0]; - var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2, 3 }, centres, start, + var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2, 3 }, centers, start, PreferredContourEntries.Pierce(prepared, outside, default)); - var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centres, start, + var preferred = PreferredContourEntries.TryPlan(prepared, outside, route, centers, start, c => adapter.Check(c.Choice)); Assert.True(preferred.IsPreferred, preferred.Reason); var unsafeChoices = preferred.HoleChoices.Append(outside).ToArray(); @@ -112,7 +112,7 @@ public class HoleLookAheadTests var first = new Part(new Drawing("holes", MixedHoles())); var nextClean = LeadPathValidationTests.Rectangle(0, 0, 2, 2); // The fixed next program starts above-left, then moves above the first part before - // cutting on the right. Its material centre alone cannot predict that approach. + // cutting on the right. Its material center alone cannot predict that approach. nextClean.MoveTo(-22, 10); nextClean.Codes.Add(new LinearMove(-21, 10) { Layer = LayerType.Scribe }); nextClean.MoveTo(0, 10); @@ -130,10 +130,10 @@ public class HoleLookAheadTests snapshot.Placements.Select(p => p.Material).ToArray()); var preferredOutside = ContourEntrySelection.Select(prepared.AutomaticEntryCandidatesWithFallbacks(2, new Vector(21, 3)) .RankTowardNextCut(new Vector(21, 3), Start), c => adapter.Check(c.Choice)).Choices[0]; - var centres = prepared.HoleCentres().Select(c => c ?? Vector.Zero).ToArray(); - var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centres, Start, + var centers = prepared.HoleCenters().Select(c => c ?? Vector.Zero).ToArray(); + var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centers, Start, PreferredContourEntries.Pierce(prepared, preferredOutside, default)); - var preferred = PreferredContourEntries.TryPlan(prepared, preferredOutside, route, centres, Start, + var preferred = PreferredContourEntries.TryPlan(prepared, preferredOutside, route, centers, Start, c => adapter.Check(c.Choice)); Assert.True(preferred.IsPreferred, preferred.Reason); var firstExecution = ExecutionMotionReader.Read(prepared.Emit( diff --git a/OpenNest.Tests/CuttingPlanning/ImportedArcHoleTests.cs b/OpenNest.Tests/CuttingPlanning/ImportedArcHoleTests.cs index ee6605d9..c64a0c70 100644 --- a/OpenNest.Tests/CuttingPlanning/ImportedArcHoleTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ImportedArcHoleTests.cs @@ -7,7 +7,7 @@ using OpenNest.Geometry; namespace OpenNest.Tests.CuttingPlanning; // A 0.277 in mounting hole imported from PEP (a panel door): two half circles whose stored -// centre sits 5e-8 beside the chord's midpoint. The closest entry to an approach from straight +// center sits 5e-8 beside the chord's midpoint. The closest entry to an approach from straight // below lands on the hole's lowest point, 5e-8 along the first arc from its start. Emission // splits the contour there with the 1e-5 endpoint tolerance, so the contour starts at the vertex; // the entry must start there too, or the 5e-8 between them is never cut and the plan's own @@ -42,10 +42,10 @@ public class ImportedArcHoleTests p.ArcTo(new Vector(1 + offset, 0.3), new Vector(1 + offset, 0.2), RotationType.CCW); p.ArcTo(new Vector(1 + offset, 0.1), new Vector(1 + offset, 0.2), RotationType.CCW); } - var centre = new Vector(1 + offset, (Bottom.Y + Top.Y) / 2); + var center = new Vector(1 + offset, (Bottom.Y + Top.Y) / 2); p.MoveTo(Bottom.X, Bottom.Y); - p.ArcTo(Top, centre, RotationType.CCW); - p.ArcTo(Bottom, centre, RotationType.CCW); + p.ArcTo(Top, center, RotationType.CCW); + p.ArcTo(Bottom, center, RotationType.CCW); return p; } diff --git a/OpenNest.Tests/CuttingPlanning/IncrementalClosureDriftTests.cs b/OpenNest.Tests/CuttingPlanning/IncrementalClosureDriftTests.cs index 6bc145bd..528461e8 100644 --- a/OpenNest.Tests/CuttingPlanning/IncrementalClosureDriftTests.cs +++ b/OpenNest.Tests/CuttingPlanning/IncrementalClosureDriftTests.cs @@ -49,10 +49,10 @@ public class IncrementalClosureDriftTests var arc = Assert.IsType(program.Codes[^1]); var start = new Vector(14, 7); - var centre = start + arc.CenterPoint; + var center = start + arc.CenterPoint; var end = start + arc.EndPoint; Assert.True(end.DistanceTo(new Vector(14, 3)) <= 1e-12); - Assert.True(System.Math.Abs(centre.DistanceTo(start) - centre.DistanceTo(end)) <= 1e-12); + Assert.True(System.Math.Abs(center.DistanceTo(start) - center.DistanceTo(end)) <= 1e-12); var material = LeadMaterialSnapshot.Capture(program, Vector.Zero); Assert.True(material.IsComplete, material.Reason); } diff --git a/OpenNest.Tests/CuttingPlanning/InterlockingHoleRouteTests.cs b/OpenNest.Tests/CuttingPlanning/InterlockingHoleRouteTests.cs index d9b6741f..dc1a5356 100644 --- a/OpenNest.Tests/CuttingPlanning/InterlockingHoleRouteTests.cs +++ b/OpenNest.Tests/CuttingPlanning/InterlockingHoleRouteTests.cs @@ -57,15 +57,15 @@ public class InterlockingHoleRouteTests Assert.Empty(bounded.ProposedOrder); using var cancellation = new CancellationTokenSource(); var cancelAt = result.Expansions - 1; - var cancelled = CuttingPlanService.Plan(new CuttingPlanRequest(parts, + var canceled = CuttingPlanService.Plan(new CuttingPlanRequest(parts, confirmedParameters: parameters, preservePartOrder: keep) { ExpansionObserver = n => { if (n == cancelAt) cancellation.Cancel(); } }, cancellation.Token); - Assert.Equal(CuttingPlanStatus.Cancelled, cancelled.Status); - Assert.Equal(cancelAt, cancelled.Expansions); - Assert.Empty(cancelled.ProposedOrder); - Assert.False(cancelled.IndependentlyReplayed); + Assert.Equal(CuttingPlanStatus.Canceled, canceled.Status); + Assert.Equal(cancelAt, canceled.Expansions); + Assert.Empty(canceled.ProposedOrder); + Assert.False(canceled.IndependentlyReplayed); Assert.Equal(before, parts.Select(p => ExplicitContourTests.Fingerprint(p.Program))); } diff --git a/OpenNest.Tests/CuttingPlanning/JointCuttingPlanTests.cs b/OpenNest.Tests/CuttingPlanning/JointCuttingPlanTests.cs index a85d92cd..f8bafd01 100644 --- a/OpenNest.Tests/CuttingPlanning/JointCuttingPlanTests.cs +++ b/OpenNest.Tests/CuttingPlanning/JointCuttingPlanTests.cs @@ -189,12 +189,12 @@ public class JointCuttingPlanTests Assert.Equal(CuttingPlanStatus.NoSolutionWithinBudget, budget.Status); Assert.Equal(1, budget.Expansions); Assert.Equal(1, observed); Assert.Empty(budget.ProposedOrder); using var cancellation = new CancellationTokenSource(); - var cancelled = CuttingPlanService.Plan(new CuttingPlanRequest([part], confirmedParameters: parameters) + var canceled = CuttingPlanService.Plan(new CuttingPlanRequest([part], confirmedParameters: parameters) { ExpansionObserver = n => { if (n == 3) cancellation.Cancel(); } }, cancellation.Token); - Assert.Equal(CuttingPlanStatus.Cancelled, cancelled.Status); - Assert.Equal(3, cancelled.Expansions); Assert.Empty(cancelled.ProposedOrder); + Assert.Equal(CuttingPlanStatus.Canceled, canceled.Status); + Assert.Equal(3, canceled.Expansions); Assert.Empty(canceled.ProposedOrder); unchanged(); } @@ -344,7 +344,7 @@ public class JointCuttingPlanTests snapshot.Placements.Select(p => p.Material).ToArray()); Assert.True(direct.IsComplete); Assert.False(direct.IsClear); Assert.Contains("another placed material", direct.Reason); - // The not-yet-cut neighbour is still material: replay names it as the obstacle. + // The not-yet-cut neighbor is still material: replay names it as the obstacle. var result = CuttingPlanService.Plan(snapshot); Assert.Equal(CuttingPlanStatus.BestEffort, result.Status); Assert.True(result.IndependentlyReplayed); diff --git a/OpenNest.Tests/CuttingPlanning/LazyCuttingSearchTests.cs b/OpenNest.Tests/CuttingPlanning/LazyCuttingSearchTests.cs index 10c97b9f..b4212962 100644 --- a/OpenNest.Tests/CuttingPlanning/LazyCuttingSearchTests.cs +++ b/OpenNest.Tests/CuttingPlanning/LazyCuttingSearchTests.cs @@ -42,13 +42,13 @@ public class LazyCuttingSearchTests Assert.Empty(bounded.ProposedOrder); Assert.False(bounded.IndependentlyReplayed); using var cancellation = new CancellationTokenSource(); - var cancelled = CuttingPlanService.Plan(new CuttingPlanRequest(parts, new Vector(-2, -2), + var canceled = CuttingPlanService.Plan(new CuttingPlanRequest(parts, new Vector(-2, -2), confirmedParameters: parameters, preservePartOrder: preserveOrder) { ExpansionObserver = n => { if (n == 10) cancellation.Cancel(); } }, cancellation.Token); - Assert.Equal(CuttingPlanStatus.Cancelled, cancelled.Status); - Assert.Equal(10, cancelled.Expansions); - Assert.Empty(cancelled.ProposedOrder); - Assert.False(cancelled.IndependentlyReplayed); + Assert.Equal(CuttingPlanStatus.Canceled, canceled.Status); + Assert.Equal(10, canceled.Expansions); + Assert.Empty(canceled.ProposedOrder); + Assert.False(canceled.IndependentlyReplayed); Assert.Equal(programs, parts.Select(p => p.Program)); } diff --git a/OpenNest.Tests/CuttingPlanning/LeadPathValidationTests.cs b/OpenNest.Tests/CuttingPlanning/LeadPathValidationTests.cs index 8e140d61..0b30a481 100644 --- a/OpenNest.Tests/CuttingPlanning/LeadPathValidationTests.cs +++ b/OpenNest.Tests/CuttingPlanning/LeadPathValidationTests.cs @@ -188,7 +188,7 @@ public class LeadPathValidationTests public void LegacyTabbedArcFromNominalClosure_IsRefusedNotRefit() { // Former emitter output: the cut stops at the tab (0,4.8), but the arc lead-out was - // generated about the nominal entry (0,5). Never recentre the arc or bridge the gap. + // generated about the nominal entry (0,5). Never recenter the arc or bridge the gap. var p = new Program(); p.MoveTo(-1, 5); p.Codes.Add(new LinearMove(0, 5) { Layer = LayerType.Leadin }); diff --git a/OpenNest.Tests/CuttingPlanning/MaterialContainmentTests.cs b/OpenNest.Tests/CuttingPlanning/MaterialContainmentTests.cs index 35ed8cc5..af0e609e 100644 --- a/OpenNest.Tests/CuttingPlanning/MaterialContainmentTests.cs +++ b/OpenNest.Tests/CuttingPlanning/MaterialContainmentTests.cs @@ -80,7 +80,7 @@ public class MaterialContainmentTests public void SeamJogBetweenLineAndArc_KeepsDistantExteriorPointExterior() { // Rounded-left-edge material whose semicircular edge meets the bottom line 1e-7 apart: - // an admitted closure seam sitting exactly on a datum Y shared with neighbours. + // an admitted closure seam sitting exactly on a datum Y shared with neighbors. var center = new Vector(1, 23.38000005); var rings = Ring( Line((1, 0.6), (41.2, 0.6)), diff --git a/OpenNest.Tests/CuttingPlanning/NearbyMaterialCheckTests.cs b/OpenNest.Tests/CuttingPlanning/NearbyMaterialCheckTests.cs index b26c5369..8d7fc306 100644 --- a/OpenNest.Tests/CuttingPlanning/NearbyMaterialCheckTests.cs +++ b/OpenNest.Tests/CuttingPlanning/NearbyMaterialCheckTests.cs @@ -169,10 +169,10 @@ public class NearbyMaterialCheckTests var span = length + 2 * size; var gap = (PostVerificationGeometry.Extent.ClearMargin + PostVerificationGeometry.Extent.SpanRounding * span) * (1 + random.NextDouble()) + size; - var centre = start + direction * along + normal * (random.Next(4) == 0 ? 0 : gap); + var center = start + direction * along + normal * (random.Next(4) == 0 ? 0 : gap); var program = random.Next(2) == 0 - ? Circle(centre, size) - : LeadPathValidationTests.Rectangle(centre.X - size, centre.Y - size, centre.X + size, centre.Y + size); + ? Circle(center, size) + : LeadPathValidationTests.Rectangle(center.X - size, center.Y - size, center.X + size, center.Y + size); var material = LeadMaterialSnapshot.Capture(program, Vector.Zero); if (!material.IsComplete || !lead.Extent.IsClearOfQueriesFrom(material.Extent)) continue; @@ -182,11 +182,11 @@ public class NearbyMaterialCheckTests } Assert.True(skipped > 1000, $"Only {skipped} cases were skipped."); - static Program Circle(Vector centre, double radius) + static Program Circle(Vector center, double radius) { var p = new Program(); - p.MoveTo(centre.X + radius, centre.Y); - p.Codes.Add(new ArcMove(new Vector(centre.X + radius, centre.Y), centre, RotationType.CCW)); + p.MoveTo(center.X + radius, center.Y); + p.Codes.Add(new ArcMove(new Vector(center.X + radius, center.Y), center, RotationType.CCW)); return p; } } @@ -194,7 +194,7 @@ public class NearbyMaterialCheckTests [Fact] public void RapidJustOutsideASmallCompletedCircle_IsStillACrossing() { - // A circle of radius 0.001 counts as touched up to sqrt(r^2 + 1e-8) from its centre, beyond + // A circle of radius 0.001 counts as touched up to sqrt(r^2 + 1e-8) from its center, beyond // its radius; the rapid passes 0.000002 outside the radius, inside that band. var state = new ReleasedContourState(); Assert.Empty(state.Check(Read(Circle(0.001)), Vector.Zero, 1) diff --git a/OpenNest.Tests/CuttingPlanning/PerimeterLookAheadTests.cs b/OpenNest.Tests/CuttingPlanning/PerimeterLookAheadTests.cs index df4b768f..a2588b28 100644 --- a/OpenNest.Tests/CuttingPlanning/PerimeterLookAheadTests.cs +++ b/OpenNest.Tests/CuttingPlanning/PerimeterLookAheadTests.cs @@ -81,7 +81,7 @@ public class PerimeterLookAheadTests var first = result.ProposedOrder[0]; var entry = Assert.Single(first.ContourChoices).Point + first.Location; - // Facing the next part (centre 15.5, 5) means the +X side of the first sheet, + // Facing the next part (center 15.5, 5) means the +X side of the first sheet, // not the legacy arrival-nearest lower-left corner. Assert.True(entry.X >= 10.0 - 1e-9, $"first entry {entry} faces away from the next part"); } @@ -90,7 +90,7 @@ public class PerimeterLookAheadTests public void ManyVertices_FacingCornerSurvivesBeyondTheDrawingOrderEntryCap() { // Start at the leftmost vertex and travel clockwise. The initial sixteen - // drawing-order catalogue entries only cover the upper-left part of the ring; + // drawing-order catalog entries only cover the upper-left part of the ring; // the useful lower-right corner appears later and must survive until ranking. var source = new Program(); var vertices = Enumerable.Range(0, 32).Select(i => @@ -142,7 +142,7 @@ public class PerimeterLookAheadTests Assert.True(result.Status == CuttingPlanStatus.Ready, Describe(result)); var ordered = result.ProposedOrder.OrderBy(p => p.SourceOrdinal).ToArray(); var secondEntry = Assert.Single(ordered[1].ContourChoices).Point + ordered[1].Location; - // Facing the third part (centre 26.0, 5): +X side of the middle sheet. + // Facing the third part (center 26.0, 5): +X side of the middle sheet. Assert.True(secondEntry.X >= 10.5 + 10.0 - 1e-9, $"second entry {secondEntry} faces away from the third part"); // Last part: no target — its entry is chosen near the arrival point, never pulled // toward the plate origin. @@ -238,7 +238,7 @@ public class PerimeterLookAheadTests public void NoCandidateFits_SurfacesContourFindingNotBudget() { // Shrink-wrap material 0.05 around part 1: every external lead enters it, so the - // finite candidate catalogue PROVES no lead-in fits; the search must say that, not + // finite candidate catalog PROVES no lead-in fits; the search must say that, not // hide behind the expansion budget. var parameters = Parameters(); var wrap = new Part(new Drawing("wrap", LeadPathValidationTests.Rectangle(-0.05, -0.05, 10.05, 10.05)), @@ -272,7 +272,7 @@ public class PerimeterLookAheadTests } [Fact] - public void CancellationIsHonouredMidSearch() + public void CancellationIsHonoredMidSearch() { var parameters = Parameters(); var parts = Enumerable.Range(0, 6).Select(i => Square(i * 10.5, parameters)).ToArray(); @@ -281,7 +281,7 @@ public class PerimeterLookAheadTests var result = CuttingPlanService.Plan(Request(parts, parameters), cancel.Token); - Assert.Equal(CuttingPlanStatus.Cancelled, result.Status); + Assert.Equal(CuttingPlanStatus.Canceled, result.Status); } [Fact] @@ -318,7 +318,7 @@ public class PerimeterLookAheadTests var first = result.ProposedOrder[0]; Assert.Equal(0, first.SourceOrdinal); var entry = first.ContourChoices.Single().Point + first.Location; - // Facing the next part (centre 15.5, 5) means the -X side of the x=21 sheet. + // Facing the next part (center 15.5, 5) means the -X side of the x=21 sheet. Assert.True(entry.X <= 21.0 + 1e-9, $"first entry {entry} faces away from the next part"); // Last part (x=0..10): no target — arrival-nearest means its +X side (the tool @@ -348,19 +348,19 @@ public class PerimeterLookAheadTests for (var i = 0; i < sequence.Length - 1; i++) { var entry = result.ProposedOrder[i].ContourChoices.Single().Point + result.ProposedOrder[i].Location; - var nextCentre = Centre(result.ProposedOrder[i + 1]); + var nextCenter = Center(result.ProposedOrder[i + 1]); var here = result.ProposedOrder[i].Location; // The opposite side of the current sheet from the next part: the facing check - // is "entry is closer to the next centre than the wrong-side point is". - var wrongSide = nextCentre.X >= here.X + 5 + // is "entry is closer to the next center than the wrong-side point is". + var wrongSide = nextCenter.X >= here.X + 5 ? new Vector(here.X - 5, here.Y + 5) : new Vector(here.X + 15, here.Y + 5); - Assert.True(entry.DistanceTo(nextCentre) < wrongSide.DistanceTo(nextCentre), - $"order slot {i} entry {entry} faces away from next centre {nextCentre}"); + Assert.True(entry.DistanceTo(nextCenter) < wrongSide.DistanceTo(nextCenter), + $"order slot {i} entry {entry} faces away from next center {nextCenter}"); } } - private static Vector Centre(FixedProgramPlacement placement) + private static Vector Center(FixedProgramPlacement placement) { var cuts = placement.Execution.Motions .Where(m => !m.Rapid && m.Layer is LayerType.Cut or LayerType.Display && m.Curve != null) diff --git a/OpenNest.Tests/CuttingPlanning/PierceZoneTests.cs b/OpenNest.Tests/CuttingPlanning/PierceZoneTests.cs index e1477ebb..4bae670d 100644 --- a/OpenNest.Tests/CuttingPlanning/PierceZoneTests.cs +++ b/OpenNest.Tests/CuttingPlanning/PierceZoneTests.cs @@ -15,12 +15,12 @@ public class PierceZoneTests public void Validator_RadiusZeroChecksPathsOnly_PositiveRadiusRejectsNearbyMaterial() { var target = Snapshot(Rectangle(0, 0, 10, 10)); - var neighbour = Snapshot(Rectangle(-6, 0, -4, 10)); // 1 from the pierce at (-3, 5) + var neighbor = Snapshot(Rectangle(-6, 0, -4, 10)); // 1 from the pierce at (-3, 5) var lead = Read(ExternalLead()); - Assert.True(LeadPathValidator.Check(lead, target, [target, neighbour]).IsClear); - AssertClear(LeadPathValidator.Check(lead, target, [target, neighbour], 0.9)); - var near = LeadPathValidator.Check(lead, target, [target, neighbour], 1.2); + Assert.True(LeadPathValidator.Check(lead, target, [target, neighbor]).IsClear); + AssertClear(LeadPathValidator.Check(lead, target, [target, neighbor], 0.9)); + var near = LeadPathValidator.Check(lead, target, [target, neighbor], 1.2); Assert.True(near.IsComplete, near.Reason); Assert.False(near.IsClear); Assert.Contains("another placed part", near.Reason); @@ -47,10 +47,10 @@ public class PierceZoneTests public void Validator_FixedPierceFailureIsCollectedNotReturned() { var target = Snapshot(Rectangle(0, 0, 10, 10)); - var neighbour = Snapshot(Rectangle(-6, 0, -4, 10)); + var neighbor = Snapshot(Rectangle(-6, 0, -4, 10)); var failures = new List(); - var result = LeadPathValidator.Check(Read(ExternalLead()), target, [target, neighbour], _ => true, + var result = LeadPathValidator.Check(Read(ExternalLead()), target, [target, neighbor], _ => true, failures, default, pierceRadius: 1.2); AssertClear(result); @@ -104,7 +104,7 @@ public class PierceZoneTests } [Fact] - public void RoundHole_ShortLeadPiercesAtTheZoneEdge_TooSmallHolePiercesAtItsCentre() + public void RoundHole_ShortLeadPiercesAtTheZoneEdge_TooSmallHolePiercesAtItsCenter() { var clean = Rectangle(0, 0, 10, 10); clean.Codes.AddRange(Circle(3, 5, 2).Codes); @@ -127,10 +127,10 @@ public class PierceZoneTests var host = Rectangle(0, 0, 10, 10); host.Codes.AddRange(Rectangle(3, 3, 7, 7).Codes); var part = new Part(new Drawing("host", host)); - var neighbour = new Part(new Drawing("neighbour", Rectangle(0, 0, 2, 2)), new Vector(10.6, 4)); + var neighbor = new Part(new Drawing("neighbor", Rectangle(0, 0, 2, 2)), new Vector(10.6, 4)); var parameters = Parameters(1); - var snapshot = CuttingPlanService.Capture(new CuttingPlanRequest([part, neighbour], Start, + var snapshot = CuttingPlanService.Capture(new CuttingPlanRequest([part, neighbor], Start, confirmedParameters: parameters, preservePartOrder: true)); var result = CuttingPlanService.Plan(snapshot); @@ -253,7 +253,7 @@ public class PierceZoneTests var nest = new Nest(); var plate = nest.CreatePlate(); plate.Parts.Add(LeadPart(new Vector(0, 0), leadStart: new Vector(-0.5, 5))); - plate.Parts.Add(new Part(new Drawing("neighbour", Rectangle(0, 0, 2, 10)), new Vector(-2.7, 0))); + plate.Parts.Add(new Part(new Drawing("neighbor", Rectangle(0, 0, 2, 10)), new Vector(-2.7, 0))); Assert.DoesNotContain(PostVerificationAnalyzer.Analyze(nest).Findings, f => f.Kind == PostVerificationKind.PierceZone); diff --git a/OpenNest.Tests/CuttingPlanning/PinnedContourTests.cs b/OpenNest.Tests/CuttingPlanning/PinnedContourTests.cs index 352e547c..c50a8d21 100644 --- a/OpenNest.Tests/CuttingPlanning/PinnedContourTests.cs +++ b/OpenNest.Tests/CuttingPlanning/PinnedContourTests.cs @@ -121,7 +121,7 @@ public class PinnedContourTests } [Fact] - public void PinnedTabOnAHole_IsNotHonouredAndWarns() + public void PinnedTabOnAHole_IsNotHonoredAndWarns() { var drawing = new Drawing("holes", PreparedContourTests.Holes()); drawing.CutPins.Add(new ContourCutPin(new Vector(4, 3), new LineLeadIn { Length = 0.2, ApproachAngle = 90 }, diff --git a/OpenNest.Tests/CuttingPlanning/PinnedLeadWarningTests.cs b/OpenNest.Tests/CuttingPlanning/PinnedLeadWarningTests.cs index 65643da8..7abf5c18 100644 --- a/OpenNest.Tests/CuttingPlanning/PinnedLeadWarningTests.cs +++ b/OpenNest.Tests/CuttingPlanning/PinnedLeadWarningTests.cs @@ -14,9 +14,9 @@ namespace OpenNest.Tests.CuttingPlanning; public class PinnedLeadWarningTests { [Fact] - public void PinnedLeadIntoNeighbour_IsUnverifiedWithTheRestPlannedAndTheEntryKept() + public void PinnedLeadIntoNeighbor_IsUnverifiedWithTheRestPlannedAndTheEntryKept() { - var (plate, pinned, neighbour) = NeighbourFixture(pins: true); + var (plate, pinned, neighbor) = NeighborFixture(pins: true); var proposal = CuttingPlanBatch.Capture([plate], PinnedContourTests.NestSettings(), false).Plan(); @@ -25,19 +25,19 @@ public class PinnedLeadWarningTests var warning = Assert.Single(planned.Result.Findings); Assert.Equal(PostVerificationKind.FixedLead, warning.Kind); Assert.Same(pinned, warning.SourcePart); - Assert.Same(neighbour, warning.OtherSourcePart); + Assert.Same(neighbor, warning.OtherSourcePart); Assert.Equal(new FixedLeadWarning(1, 1, 1), warning.FixedLead); Assert.Equal("Drawing pin 1 lead on cutting contour 1 contacts or enters another part's material. " + "The pinned contour is cut exactly as its drawing says. Increase spacing or move this part away " + "from the part it meets, then replan.", warning.Message); - // The search never relocates the pinned entry, and the neighbour is planned normally. + // The search never relocates the pinned entry, and the neighbor is planned normally. var proposed = planned.Result.ProposedOrder; var placement = Assert.Single(proposed, p => ReferenceEquals(p.SourcePart, pinned)); Assert.Equal(new Vector(10, 5), Assert.Single(placement.ContourChoices).Point); var lead = ExecutionMotionReader.Read(placement.CopyProgram(), pinned.Location, null, default).Motions .Single(m => m.Layer == LayerType.Leadin); Assert.Equal(1.0, lead.Length, 9); // Not shortened to fit. - Assert.True(Assert.Single(proposed, p => ReferenceEquals(p.SourcePart, neighbour)).IsRegenerated); + Assert.True(Assert.Single(proposed, p => ReferenceEquals(p.SourcePart, neighbor)).IsRegenerated); Assert.Equal(CuttingCommitStatus.InvalidInput, proposal.Apply().Status); Assert.Equal(CuttingCommitStatus.Applied, proposal.Apply(acceptWarnings: true).Status); } @@ -45,7 +45,7 @@ public class PinnedLeadWarningTests [Fact] public void UnpinnedControl_IsReady() { - var (plate, _, _) = NeighbourFixture(pins: false); + var (plate, _, _) = NeighborFixture(pins: false); var proposal = CuttingPlanBatch.Capture([plate], PinnedContourTests.NestSettings(), false).Plan(); @@ -55,7 +55,7 @@ public class PinnedLeadWarningTests [Fact] public void PinsOffOnThePinnedPart_IsReady() { - var (plate, pinned, _) = NeighbourFixture(pins: true); + var (plate, pinned, _) = NeighborFixture(pins: true); pinned.DrawingPinsOff = true; var proposal = CuttingPlanBatch.Capture([plate], PinnedContourTests.NestSettings(), false).Plan(); @@ -118,7 +118,7 @@ public class PinnedLeadWarningTests [Fact] public void FeasibilityProbe_AcceptsAPinnedEntryAsGiven() { - var (plate, pinned, _) = NeighbourFixture(pins: true); + var (plate, pinned, _) = NeighborFixture(pins: true); var snapshot = CuttingPlanService.Capture(CuttingPlanRequest.ForPlate(plate, confirmedParameters: PinnedContourTests.NestSettings())); var source = snapshot.Placements.Single(p => ReferenceEquals(p.SourcePart, pinned)); @@ -133,20 +133,20 @@ public class PinnedLeadWarningTests /// /// A 10 x 10 square pinned at its right edge midpoint with a 1.0 straight lead, and a - /// 2 x 2 neighbour 0.3 to its right that the lead runs through. + /// 2 x 2 neighbor 0.3 to its right that the lead runs through. /// - private static (Plate Plate, Part Pinned, Part Neighbour) NeighbourFixture(bool pins) + private static (Plate Plate, Part Pinned, Part Neighbor) NeighborFixture(bool pins) { var drawing = new Drawing("pinned", ExplicitContourTests.Square(false)); if (pins) drawing.CutPins.Add(new ContourCutPin(new Vector(10, 5), new LineLeadIn { Length = 1.0, ApproachAngle = 90 }, new NoLeadOut())); var pinned = new Part(drawing, Vector.Zero); - var neighbour = new Part(new Drawing("neighbour", LeadPathValidationTests.Rectangle(0, 0, 2, 2)), + var neighbor = new Part(new Drawing("neighbor", LeadPathValidationTests.Rectangle(0, 0, 2, 2)), new Vector(10.3, 4)); var plate = new Nest().CreatePlate(); plate.Parts.Add(pinned); - plate.Parts.Add(neighbour); - return (plate, pinned, neighbour); + plate.Parts.Add(neighbor); + return (plate, pinned, neighbor); } } diff --git a/OpenNest.Tests/CuttingPlanning/PreferredContourEntriesTests.cs b/OpenNest.Tests/CuttingPlanning/PreferredContourEntriesTests.cs index f8476ae5..39a64087 100644 --- a/OpenNest.Tests/CuttingPlanning/PreferredContourEntriesTests.cs +++ b/OpenNest.Tests/CuttingPlanning/PreferredContourEntriesTests.cs @@ -20,12 +20,12 @@ public class PreferredContourEntriesTests { private static readonly Vector Arrival = new(0, 5); - private static Program CirclesProgram(params (double X, double Y)[] centres) + private static Program CirclesProgram(params (double X, double Y)[] centers) { var p = ExplicitContourTests.Square(false); - foreach (var (x, y) in centres) + foreach (var (x, y) in centers) { - // Unit circle centred at (x, y): two half-arcs, CCW. + // Unit circle centerd at (x, y): two half-arcs, CCW. p.MoveTo(x + 1, y); p.ArcTo(new Vector(x - 1, y), new Vector(x, y), RotationType.CCW); p.ArcTo(new Vector(x + 1, y), new Vector(x, y), RotationType.CCW); @@ -83,11 +83,11 @@ public class PreferredContourEntriesTests Assert.True(At(perimeterEntry.Point, 10, 5)); // Route: arrival (0,5) -> left circle -> right circle -> the outside entry. - var centres = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; - var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centres, Arrival, + var centers = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; + var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centers, Arrival, Pierce(prepared, perimeterEntry)); var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, route, - centres, Arrival, c => feasibility.Check(c.Choice)); + centers, Arrival, c => feasibility.Check(c.Choice)); Assert.True(proposal.IsPreferred, proposal.Reason); Assert.Equal(new[] { 0, 1 }, proposal.HoleChoices.Select(c => c.ContourOrdinal)); @@ -115,12 +115,12 @@ public class PreferredContourEntriesTests var clean = RectHolesProgram((3, 3, 5, 5), (7, 3, 9, 5)); var (prepared, _) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 4)); - var centres = new[] { new Vector(4, 4), new Vector(8, 4), new Vector(5, 5) }; + var centers = new[] { new Vector(4, 4), new Vector(8, 4), new Vector(5, 5) }; // All-clear evaluation isolates pure ranking: a corner on a facing side wins over // any midpoint, walking backward from the perimeter entry. var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, new[] { 0, 1 }, - centres, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); + centers, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); Assert.True(proposal.IsPreferred, proposal.Reason); // Right hole faces the perimeter: a RIGHT-edge corner of the (7,3)-(9,5) hole, @@ -141,7 +141,7 @@ public class PreferredContourEntriesTests var clean = CirclesProgram((3, 3), (7, 3)); var (prepared, feasibility) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 5)); - var centres = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; + var centers = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; // The ideal east compass point of the right circle is refused: fall back to its // next-ranked candidate rather than fail or skip the hole. @@ -149,8 +149,8 @@ public class PreferredContourEntriesTests c.Choice.ContourOrdinal == 1 && At(c.Choice.Point, 8, 3) ? new(ContourFeasibilityStatus.Blocked, "test block") : feasibility.Check(c.Choice); - var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centres, Arrival, Pierce(prepared, perimeterEntry)); - var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, route, centres, Arrival, Evaluate); + var route = CuttingHoleOrder.Plan(new[] { 0, 1 }, centers, Arrival, Pierce(prepared, perimeterEntry)); + var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, route, centers, Arrival, Evaluate); Assert.True(proposal.IsPreferred, proposal.Reason); Assert.Equal(1, proposal.HoleChoices[1].ContourOrdinal); // never skipped or swapped @@ -165,14 +165,14 @@ public class PreferredContourEntriesTests var clean = CirclesProgram((3, 3), (7, 3)); var (prepared, _) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 5)); - var centres = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; + var centers = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; ContourFeasibilityVerdict Evaluate(ContourEntryCandidate c) => c.Choice.ContourOrdinal == 0 ? new(ContourFeasibilityStatus.Blocked, "nothing fits") : new(ContourFeasibilityStatus.Clear, null); var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, new[] { 0, 1 }, - centres, Arrival, Evaluate); + centers, Arrival, Evaluate); Assert.False(proposal.IsPreferred); Assert.Empty(proposal.HoleChoices); @@ -186,13 +186,13 @@ public class PreferredContourEntriesTests var clean = CirclesProgram((2.5, 3), (5, 3), (7.5, 3)); var (prepared, feasibility) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(3, 2, new Vector(10, 5)); // perimeter is last - var centres = new[] + var centers = new[] { new Vector(2.5, 3), new Vector(5, 3), new Vector(7.5, 3), new Vector(5, 5), }; - var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2 }, centres, Arrival, Pierce(prepared, perimeterEntry)); + var route = CuttingHoleOrder.Plan(new[] { 0, 1, 2 }, centers, Arrival, Pierce(prepared, perimeterEntry)); - var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, route, centres, Arrival, + var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, route, centers, Arrival, c => feasibility.Check(c.Choice)); Assert.True(proposal.IsPreferred, proposal.Reason); @@ -205,16 +205,16 @@ public class PreferredContourEntriesTests public void ScribesDoNotBecomeTheDownstreamPierceTarget() { var clean = RectHolesProgram((3, 3, 5, 5), (7, 3, 9, 5)); - var centres = new[] { new Vector(4, 4), new Vector(8, 4), new Vector(5, 5) }; + var centers = new[] { new Vector(4, 4), new Vector(8, 4), new Vector(5, 5) }; var prepared = PreparedContours.Capture(clean, ExplicitContourTests.Parameters()); var entry = prepared.Entry(2, 2, new Vector(10, 4)); var baseline = PreferredContourEntries.TryPlan(prepared, entry, new[] { 0, 1 }, - centres, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); + centers, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); clean.MoveTo(-20, -20); clean.Codes.Add(new LinearMove(-19, -19) { Layer = LayerType.Scribe }); var marked = PreparedContours.Capture(clean, ExplicitContourTests.Parameters()); var actual = PreferredContourEntries.TryPlan(marked, marked.Entry(2, 2, new Vector(10, 4)), - new[] { 0, 1 }, centres, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); + new[] { 0, 1 }, centers, Arrival, _ => new(ContourFeasibilityStatus.Clear, null)); Assert.True(actual.IsPreferred, actual.Reason); Assert.Equal(baseline.HoleChoices.Select(c => c.Point), actual.HoleChoices.Select(c => c.Point)); } @@ -228,12 +228,12 @@ public class PreferredContourEntriesTests var clean = CirclesProgram((3, 3), (7.4, 4.6)); var (prepared, feasibility) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 5)); - var centres = new[] { new Vector(3, 3), new Vector(7.4, 4.6), new Vector(5, 5) }; + var centers = new[] { new Vector(3, 3), new Vector(7.4, 4.6), new Vector(5, 5) }; var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, new[] { 0, 1 }, - centres, Arrival, c => feasibility.Check(c.Choice)); + centers, Arrival, c => feasibility.Check(c.Choice)); var again = PreferredContourEntries.TryPlan(prepared, perimeterEntry, new[] { 0, 1 }, - centres, Arrival, c => feasibility.Check(c.Choice)); + centers, Arrival, c => feasibility.Check(c.Choice)); Assert.True(proposal.IsPreferred, proposal.Reason); Assert.Equal(proposal.HoleChoices.Select(c => c.Point), again.HoleChoices.Select(c => c.Point)); @@ -256,13 +256,13 @@ public class PreferredContourEntriesTests { var (prepared, feasibility) = Capture(CirclesProgram((3, 3), (7, 3)), Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 5)); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); Assert.ThrowsAny(() => PreferredContourEntries.TryPlan( prepared, perimeterEntry, new[] { 0, 1 }, new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }, Arrival, - c => feasibility.Check(c.Choice), cancelled.Token)); + c => feasibility.Check(c.Choice), canceled.Token)); } [Fact] @@ -272,10 +272,10 @@ public class PreferredContourEntriesTests var before = ExplicitContourTests.Fingerprint(clean); var (prepared, feasibility) = Capture(clean, Vector.Zero); var perimeterEntry = prepared.Entry(2, 2, new Vector(10, 5)); - var centres = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; + var centers = new[] { new Vector(3, 3), new Vector(7, 3), new Vector(5, 5) }; var proposal = PreferredContourEntries.TryPlan(prepared, perimeterEntry, new[] { 0, 1 }, - centres, Arrival, c => feasibility.Check(c.Choice)); + centers, Arrival, c => feasibility.Check(c.Choice)); Assert.True(proposal.IsPreferred, proposal.Reason); Assert.Equal(before, ExplicitContourTests.Fingerprint(clean)); // caller program untouched diff --git a/OpenNest.Tests/CuttingPlanning/ProblemNestRegressionTests.cs b/OpenNest.Tests/CuttingPlanning/ProblemNestRegressionTests.cs index 2b4538d6..bf080b0e 100644 --- a/OpenNest.Tests/CuttingPlanning/ProblemNestRegressionTests.cs +++ b/OpenNest.Tests/CuttingPlanning/ProblemNestRegressionTests.cs @@ -169,7 +169,7 @@ public partial class ProblemNestRegressionTests(ITestOutputHelper output) { var planned = CuttingPlanBatch.Capture([plate], plate.CuttingParameters ?? DefaultParameters(), preservePartOrder: false, [number], cancellation.Token).Plan(token: cancellation.Token).Plates[0]; - return (planned.Result.Status == CuttingPlanStatus.Cancelled ? Timeout : Outcome(planned), planned); + return (planned.Result.Status == CuttingPlanStatus.Canceled ? Timeout : Outcome(planned), planned); } catch (OperationCanceledException) { diff --git a/OpenNest.Tests/CuttingPlanning/SeamClosureReplayTests.cs b/OpenNest.Tests/CuttingPlanning/SeamClosureReplayTests.cs index cdc93d4c..552456b1 100644 --- a/OpenNest.Tests/CuttingPlanning/SeamClosureReplayTests.cs +++ b/OpenNest.Tests/CuttingPlanning/SeamClosureReplayTests.cs @@ -58,7 +58,7 @@ public class SeamClosureReplayTests private static OwnedExecution Read(Program program) => ExecutionMotionReader.Read(program, Vector.Zero, null, default); [Theory] - [InlineData(0.0)] // exactly closed: unchanged behaviour + [InlineData(0.0)] // exactly closed: unchanged behavior [InlineData(5e-7)] // admitted closure seam [InlineData(1e-6)] // inclusive closure boundary that capture already accepts public void AdmittedClosureSeam_StillReplays(double seam) diff --git a/OpenNest.Tests/CuttingPlanning/SettingsFreshnessTests.cs b/OpenNest.Tests/CuttingPlanning/SettingsFreshnessTests.cs index c425ada1..cf80912c 100644 --- a/OpenNest.Tests/CuttingPlanning/SettingsFreshnessTests.cs +++ b/OpenNest.Tests/CuttingPlanning/SettingsFreshnessTests.cs @@ -185,7 +185,7 @@ public class SettingsFreshnessTests } [Fact] - public void Fingerprint_TextFieldsCannotShiftIntoNeighbours() + public void Fingerprint_TextFieldsCannotShiftIntoNeighbors() { var a = new CuttingParameters { MachineName = "a;", MaterialName = "b" }; var b = new CuttingParameters { MachineName = "a", MaterialName = ";b" }; diff --git a/OpenNest.Tests/CuttingPlanning/SideCoverageRegressionTests.cs b/OpenNest.Tests/CuttingPlanning/SideCoverageRegressionTests.cs index 2fdc3e36..2e82f20a 100644 --- a/OpenNest.Tests/CuttingPlanning/SideCoverageRegressionTests.cs +++ b/OpenNest.Tests/CuttingPlanning/SideCoverageRegressionTests.cs @@ -161,7 +161,7 @@ public class SideCoverageRegressionTests } [Fact] - public void CorrectiveRescan_HonoursCancellationBeforeReusingCachedVerdict() + public void CorrectiveRescan_HonorsCancellationBeforeReusingCachedVerdict() { var candidates = CorrectiveCandidates(); using var cancellation = new CancellationTokenSource(); diff --git a/OpenNest.Tests/CuttingPlanning/SupportTabPlanningTests.cs b/OpenNest.Tests/CuttingPlanning/SupportTabPlanningTests.cs index aa02ae61..e7e2a9f0 100644 --- a/OpenNest.Tests/CuttingPlanning/SupportTabPlanningTests.cs +++ b/OpenNest.Tests/CuttingPlanning/SupportTabPlanningTests.cs @@ -142,7 +142,7 @@ public class SupportTabPlanningTests } [Fact] - public void FallbackCatalogue_KeepsClearOfInsideCornersBeforeOfferingEveryEntry() + public void FallbackCatalog_KeepsClearOfInsideCornersBeforeOfferingEveryEntry() { var bed = new SupportGrid(2, 4, 0, 0.25, stabilityMargin: 0.1); var program = BumpedStrip(); diff --git a/OpenNest.Tests/CuttingStrategy/TabbedLeadOutTests.cs b/OpenNest.Tests/CuttingStrategy/TabbedLeadOutTests.cs index 36fb043a..ea308127 100644 --- a/OpenNest.Tests/CuttingStrategy/TabbedLeadOutTests.cs +++ b/OpenNest.Tests/CuttingStrategy/TabbedLeadOutTests.cs @@ -31,7 +31,7 @@ public class TabbedLeadOutTests Assert.Equal(end, leadout.Start!.Value); var arc = Assert.IsType(leadout.Curve.ToEntity()); Assert.Equal(LeadRadius, arc.Radius, 9); - // Centred on the actual end's outward normal, so it touches the edge only where it starts. + // Centerd on the actual end's outward normal, so it touches the edge only where it starts. Assert.Equal(-LeadRadius, arc.Center.X, 9); Assert.Equal(end.Y, arc.Center.Y, 9); } @@ -45,16 +45,16 @@ public class TabbedLeadOutTests var execution = Emit(clean, new Vector(5, -2), new ArcLeadOut { Radius = LeadRadius }, tabs: true); var (cuts, leadout) = Split(execution); - var centre = new Vector(5, 5); + var center = new Vector(5, 5); var end = cuts[^1].End; - Assert.Equal(5, end.DistanceTo(centre), 9); + Assert.Equal(5, end.DistanceTo(center), 9); Assert.Equal(TabSize, end.DistanceTo(new Vector(5, 0)), 9); Assert.Equal(end, leadout.Start!.Value); var arc = Assert.IsType(leadout.Curve.ToEntity()); Assert.Equal(LeadRadius, arc.Radius, 9); - // Externally tangent to the perimeter at the actual end: centre on its radial line. - Assert.Equal(5 + LeadRadius, arc.Center.DistanceTo(centre), 9); - var radial = end - centre; + // Externally tangent to the perimeter at the actual end: center on its radial line. + Assert.Equal(5 + LeadRadius, arc.Center.DistanceTo(center), 9); + var radial = end - center; var offset = arc.Center - end; Assert.Equal(0, radial.X * offset.Y - radial.Y * offset.X, 9); } diff --git a/OpenNest.Tests/Data/LedgerCodeCheckTests.cs b/OpenNest.Tests/Data/LedgerCodeCheckTests.cs index 78d55770..0e17bfe2 100644 --- a/OpenNest.Tests/Data/LedgerCodeCheckTests.cs +++ b/OpenNest.Tests/Data/LedgerCodeCheckTests.cs @@ -55,7 +55,7 @@ public class LedgerCodeCheckTests [ Hold("S-1", LedgerHoldStatuses.Approved), Hold("B-1", LedgerHoldStatuses.Proposed), - Hold("B-1", LedgerHoldStatuses.Cancelled), + Hold("B-1", LedgerHoldStatuses.Canceled), ]; var conflicts = LedgerCodeCheck.Find(plates, [Item("B-1", 1)], holds, LedgerCodesInUse.Known([])); diff --git a/OpenNest.Tests/Data/NestDetailsSessionTests.cs b/OpenNest.Tests/Data/NestDetailsSessionTests.cs index 935edb78..bde95eab 100644 --- a/OpenNest.Tests/Data/NestDetailsSessionTests.cs +++ b/OpenNest.Tests/Data/NestDetailsSessionTests.cs @@ -81,9 +81,9 @@ public class NestDetailsSessionTests if (++calls > 1) return Task.FromResult(latestDetails); - var cancelled = new TaskCompletionSource(); - token.Register(() => cancelled.SetCanceled(token)); - return cancelled.Task; + var canceled = new TaskCompletionSource(); + token.Register(() => canceled.SetCanceled(token)); + return canceled.Task; }); var superseded = session.LoadAsync(Guid.NewGuid()); @@ -205,7 +205,7 @@ public class NestDetailsSessionTests Assert.True(loads.Tokens[0].IsCancellationRequested); loads.Results[0].SetResult(new NestDetails()); - // Whether or not the cancelled prefetch's continuation has run yet, it must not have + // Whether or not the canceled prefetch's continuation has run yet, it must not have // populated the cache, so loading the same nest issues a fresh request. var fresh = new NestDetails(); var load = session.LoadAsync(nestId); diff --git a/OpenNest.Tests/Data/NestNameConflictsTests.cs b/OpenNest.Tests/Data/NestNameConflictsTests.cs index f2b53ce2..1d1d0222 100644 --- a/OpenNest.Tests/Data/NestNameConflictsTests.cs +++ b/OpenNest.Tests/Data/NestNameConflictsTests.cs @@ -94,10 +94,10 @@ public class NestNameConflictsTests public async Task Timeout_KeepsTheCurrentName() { var repository = new NamedRepository("Job"); - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); - Assert.Null(await NestNameConflicts.FindReplacementAsync(repository, "Job", 2026, cancelled.Token)); + Assert.Null(await NestNameConflicts.FindReplacementAsync(repository, "Job", 2026, canceled.Token)); } private sealed class NamedRepository : INestRepository diff --git a/OpenNest.Tests/Data/RemoteNestHistoryTests.cs b/OpenNest.Tests/Data/RemoteNestHistoryTests.cs index d868fd4c..ae576459 100644 --- a/OpenNest.Tests/Data/RemoteNestHistoryTests.cs +++ b/OpenNest.Tests/Data/RemoteNestHistoryTests.cs @@ -126,9 +126,9 @@ public class RemoteNestHistoryTests } [Fact] - public async Task CancelledHistoryAndDownload_PropagateCancellation() + public async Task CanceledHistoryAndDownload_PropagateCancellation() { - using var http = new HttpClient(new Handler(_ => throw new InvalidOperationException("Cancelled HTTP must not run"))); + using var http = new HttpClient(new Handler(_ => throw new InvalidOperationException("Canceled HTTP must not run"))); using var repository = new RemoteNestRepository(http, "http://shop/"); using var source = new CancellationTokenSource(); source.Cancel(); diff --git a/OpenNest.Tests/Diagnostics/NestedPartReviewTests.cs b/OpenNest.Tests/Diagnostics/NestedPartReviewTests.cs index bd4611de..ff41a0af 100644 --- a/OpenNest.Tests/Diagnostics/NestedPartReviewTests.cs +++ b/OpenNest.Tests/Diagnostics/NestedPartReviewTests.cs @@ -48,7 +48,7 @@ public class NestedPartReviewTests [InlineData(Mode.Incremental)] public void HoleLeadCrossingTheInsert_WarnsAtItsSubprogramPose(Mode mode) { - // The hole is a subprogram call; its lead-in starts at the hole centre, inside the insert. + // The hole is a subprogram call; its lead-in starts at the hole center, inside the insert. var report = Analyze(Inner(), Host(new Vector(10, 10), mode)); var finding = Assert.Single(Find(report, PostVerificationKind.NestedLead)); @@ -128,7 +128,7 @@ public class NestedPartReviewTests return nest; } - // A 20x20 square host with a radius-5 cutout centred at (10, 10). Its placed program cuts the + // A 20x20 square host with a radius-5 cutout centerd at (10, 10). Its placed program cuts the // hole first through a subprogram call (lead-in from holeLead to (15, 10)), then the perimeter. private static Part Host(Vector holeLead, Mode mode = Mode.Absolute) { diff --git a/OpenNest.Tests/Diagnostics/OverlapMarkerTests.cs b/OpenNest.Tests/Diagnostics/OverlapMarkerTests.cs index 2b11dbb6..83ee0108 100644 --- a/OpenNest.Tests/Diagnostics/OverlapMarkerTests.cs +++ b/OpenNest.Tests/Diagnostics/OverlapMarkerTests.cs @@ -15,7 +15,7 @@ public class OverlapMarkerTests { var marker = OverlapMarker.Find(Frame, FrameHole, 12, new Vector(2, 2)); - // The frame's bars are 1 wide: the pole sits on a bar's centre line. + // The frame's bars are 1 wide: the pole sits on a bar's center line. Assert.True(Inside(marker), $"{marker.X:R}, {marker.Y:R}"); var depth = new[] { marker.X, 4 - marker.X, marker.Y, 4 - marker.Y }.Min(); Assert.InRange(depth, 0.4, 0.6); @@ -24,7 +24,7 @@ public class OverlapMarkerTests [Fact] public void ExhaustedSearchFallsBackToAnInteriorScanLinePoint() { - // One cell of budget: the search cannot leave the hole-centred bounding-box cell. + // One cell of budget: the search cannot leave the hole-centerd bounding-box cell. var marker = OverlapMarker.Find(Frame, FrameHole, 12, new Vector(2, 2), maxCells: 1); Assert.True(Inside(marker), $"{marker.X:R}, {marker.Y:R}"); diff --git a/OpenNest.Tests/Diagnostics/PlateOverlapAnalyzerClampZoneTests.cs b/OpenNest.Tests/Diagnostics/PlateOverlapAnalyzerClampZoneTests.cs index 7223b6e9..3f1093c5 100644 --- a/OpenNest.Tests/Diagnostics/PlateOverlapAnalyzerClampZoneTests.cs +++ b/OpenNest.Tests/Diagnostics/PlateOverlapAnalyzerClampZoneTests.cs @@ -229,10 +229,10 @@ public class PlateOverlapAnalyzerClampZoneTests Assert.Equal(5, region.Vertices.Count); Assert.Equal(region.Vertices[0], region.Vertices[^1]); Assert.Equal(4, region.Vertices.Take(4).Distinct().Count()); - // Documented exception: a tiny clamp keeps its whole-clamp region and marks its centre. - var centre = new Vector(8 + 0.5e-5, 0.5e-5); - Assert.Equal(centre, finding.Marker); - Assert.Equal(centre, finding.Centroid); + // Documented exception: a tiny clamp keeps its whole-clamp region and marks its center. + var center = new Vector(8 + 0.5e-5, 0.5e-5); + Assert.Equal(center, finding.Marker); + Assert.Equal(center, finding.Centroid); } // PM 407f5eb7: real material, not the 0.001 arc flattening, decides a tiny clamp. @@ -292,8 +292,8 @@ public class PlateOverlapAnalyzerClampZoneTests var arc = new ShapeProfile(OpenNest.Converters.ConvertProgram.ToGeometry(program)) .Perimeter.Entities.OfType().Single(); var native = arc.ToPoints(arc.SegmentsForTolerance(1e-5 / 4)).First(v => v.X > 11.9 && v.Y < 19.5); - var centre = new Vector(10, 20); - var outward = centre + (native - centre) / 2 * (2 + 6e-7); + var center = new Vector(10, 20); + var outward = center + (native - center) / 2 * (2 + 6e-7); var zone = new ClampZone("tiny", new Box(outward.X - 1e-5, outward.Y, 1e-5, 1e-5)); var report = PlateOverlapAnalyzer.Analyze(PlateOverlapAnalyzer.Capture( diff --git a/OpenNest.Tests/DrawingProgramSnapshotTests.cs b/OpenNest.Tests/DrawingProgramSnapshotTests.cs index cbae0e7a..8c8456c6 100644 --- a/OpenNest.Tests/DrawingProgramSnapshotTests.cs +++ b/OpenNest.Tests/DrawingProgramSnapshotTests.cs @@ -100,7 +100,7 @@ public class DrawingProgramSnapshotTests var snapshot = DrawingProgramSnapshot.Capture(new[] { drawing }, Fingerprint); var hole = drawing.Program.SubPrograms[7]; - // The incremental circle's centre changes without replacing either program. + // The incremental circle's center changes without replacing either program. var arc = Assert.IsType(hole.Codes[1]); arc.CenterPoint = new Vector(-1.5, 0); var updated = snapshot.UpdateChangedParts(new[] { MakePlate(part) }); diff --git a/OpenNest.Tests/Engine/PartClassifierTests.cs b/OpenNest.Tests/Engine/PartClassifierTests.cs index 3e6d09c3..ac5c206d 100644 --- a/OpenNest.Tests/Engine/PartClassifierTests.cs +++ b/OpenNest.Tests/Engine/PartClassifierTests.cs @@ -60,7 +60,7 @@ public class PartClassifierTests [Fact] public void Classify_RectWithSmallNotches_ReturnsRectangle() { - // 100x50 rectangle with a 5x2 notch cut into the bottom edge near the centre. + // 100x50 rectangle with a 5x2 notch cut into the bottom edge near the center. // The notch is small relative to the overall perimeter so both metrics still pass. var pgm = new OpenNest.CNC.Program(); pgm.Codes.Add(new RapidMove(new Vector(0, 0))); diff --git a/OpenNest.Tests/Fill/FillExtentsTests.cs b/OpenNest.Tests/Fill/FillExtentsTests.cs index 95b36f17..8df16577 100644 --- a/OpenNest.Tests/Fill/FillExtentsTests.cs +++ b/OpenNest.Tests/Fill/FillExtentsTests.cs @@ -234,7 +234,7 @@ public class FillExtentsTests } [Fact] - public void Fill_PreCancelled_MatchesFrozenLegacyRatherThanThrowing() + public void Fill_PreCanceled_MatchesFrozenLegacyRatherThanThrowing() { var drawing = MakeFixture("triangle"); var before = Snapshot(drawing); diff --git a/OpenNest.Tests/Fill/OverlapCheckPerformanceTests.cs b/OpenNest.Tests/Fill/OverlapCheckPerformanceTests.cs index 78663f84..2572c7f0 100644 --- a/OpenNest.Tests/Fill/OverlapCheckPerformanceTests.cs +++ b/OpenNest.Tests/Fill/OverlapCheckPerformanceTests.cs @@ -68,7 +68,7 @@ public class OverlapCheckPerformanceTests output.WriteLine( $"overlap-check: area=(3.1,5.3,96,48), spacing=0.5, Horizontal. grid-single = FillLinear.Fill(arc fixture, 0.37) " + $"({arcGrid.Count} parts, one shared Program); grid-pair = FillLinear.Fill(BuildRotatedPattern(concave 0/PI pair, 0.37)) " - + $"({pairGrid.Count} parts); polygon-pairs = Collision.HasOverlap over the {pairs.Length} box-overlapping neighbour " + + $"({pairGrid.Count} parts); polygon-pairs = Collision.HasOverlap over the {pairs.Length} box-overlapping neighbor " + "pairs of both grids (timed per full sweep), each polygon prepared once up front with Part.Intersects' recipe " + "(material entities, chord 0.001, world offset); Part.Intersects itself prepares per call. All verdicts clear. " + $"warmup=2 x {warmupCalls} calls/mode; measured={repetitions} x {callsPerBatch}; mode order rotates per batch. " diff --git a/OpenNest.Tests/Fill/PartOverlapCheckerTests.cs b/OpenNest.Tests/Fill/PartOverlapCheckerTests.cs index d9278691..fe0065f6 100644 --- a/OpenNest.Tests/Fill/PartOverlapCheckerTests.cs +++ b/OpenNest.Tests/Fill/PartOverlapCheckerTests.cs @@ -44,7 +44,7 @@ public class PartOverlapCheckerTests var grid = filler.Fill(drawing, angle, direction); Assert.NotEmpty(grid); AssertMatchesLegacy(grid); - // Nudge copies onto their neighbours so overlapping verdicts are exercised too. + // Nudge copies onto their neighbors so overlapping verdicts are exercised too. foreach (var shift in new[] { 0.05, 1e-9, -1e-9 }) AssertMatchesLegacy(Shifted(grid, shift)); } @@ -286,7 +286,7 @@ public class PartOverlapCheckerTests private static List WorkGrid(string kind) { - // Rotated grids: neighbouring boxes overlap but parts do not, so every box-overlapping + // Rotated grids: neighboring boxes overlap but parts do not, so every box-overlapping // pair reaches an exact test and there is no early exit. var filler = new FillLinear(new Box(3.1, 5.3, 96, 48), 0.5); if (kind == "single") diff --git a/OpenNest.Tests/Geometry/CollisionOverlapOnlyTests.cs b/OpenNest.Tests/Geometry/CollisionOverlapOnlyTests.cs index d597b88b..22fc4d9b 100644 --- a/OpenNest.Tests/Geometry/CollisionOverlapOnlyTests.cs +++ b/OpenNest.Tests/Geometry/CollisionOverlapOnlyTests.cs @@ -80,7 +80,7 @@ public class CollisionOverlapOnlyTests { // Offsets gives contact/containment placements within each (A, B) pair. Pulling // every pair into one ~8-unit window makes most cross-pair tests reach clipping - // too, so each cached triangulation is reused against many near neighbours. + // too, so each cached triangulation is reused against many near neighbors. var (ax, ay, bx, by) = Offsets(random, shapeA, shapeB, sample); var dx = random.NextDouble() * 4 - ax; var dy = random.NextDouble() * 4 - ay; diff --git a/OpenNest.Tests/Geometry/DrawingAlignerTests.cs b/OpenNest.Tests/Geometry/DrawingAlignerTests.cs index 4c4cd3ff..8b2ce4ea 100644 --- a/OpenNest.Tests/Geometry/DrawingAlignerTests.cs +++ b/OpenNest.Tests/Geometry/DrawingAlignerTests.cs @@ -441,7 +441,7 @@ public class DrawingAlignerTests // ---------- cancellation fails closed ---------- [Fact] - public void Align_CancelledUpFront_FailsClosed() + public void Align_CanceledUpFront_FailsClosed() { var oldPgm = BuildProgram(AsymmetricOuter(), HoleAt(3, 3, 1)); using var cts = new CancellationTokenSource(); @@ -451,7 +451,7 @@ public class DrawingAlignerTests Assert.True( result.FailureMessage != null || !result.Converged, - $"a cancelled run must not report a confident success; reasons={result.Reasons}" + $"a canceled run must not report a confident success; reasons={result.Reasons}" ); } diff --git a/OpenNest.Tests/Geometry/PolyLabelDifferentialTests.cs b/OpenNest.Tests/Geometry/PolyLabelDifferentialTests.cs index aca78883..4d95c569 100644 --- a/OpenNest.Tests/Geometry/PolyLabelDifferentialTests.cs +++ b/OpenNest.Tests/Geometry/PolyLabelDifferentialTests.cs @@ -83,7 +83,7 @@ public class PolyLabelDifferentialTests Assert.InRange(unbounded.Y, 0, 1); } - // Delta review: past the grid, refining a cell whose half-step no longer moves its centre + // Delta review: past the grid, refining a cell whose half-step no longer moves its center // made four identical children per level, so a fine unbounded search exhausted memory. [Fact] public async Task Find_UnboundedRefinementFinishesWhenSplitsStopAdvancing() diff --git a/OpenNest.Tests/Geometry/PolyLabelTests.cs b/OpenNest.Tests/Geometry/PolyLabelTests.cs index 55c3ea32..e2f45def 100644 --- a/OpenNest.Tests/Geometry/PolyLabelTests.cs +++ b/OpenNest.Tests/Geometry/PolyLabelTests.cs @@ -132,7 +132,7 @@ public class PolyLabelTests var result = PolyLabel.Find(p, null, PolyLabel.ThicknessPrecision(p)); - // Any height along the bar is equally clear; its centreline is not. + // Any height along the bar is equally clear; its centerline is not. Assert.Equal(0.3, result.X, 0.02); Assert.InRange(result.Y, 0.3, 1.2); } diff --git a/OpenNest.Tests/Geometry/PolygonAreaMomentsTests.cs b/OpenNest.Tests/Geometry/PolygonAreaMomentsTests.cs index 16b62623..45d147ce 100644 --- a/OpenNest.Tests/Geometry/PolygonAreaMomentsTests.cs +++ b/OpenNest.Tests/Geometry/PolygonAreaMomentsTests.cs @@ -139,9 +139,9 @@ public class PolygonAreaMomentsTests [InlineData(0)] [InlineData(1000000000)] [InlineData(-1000000000)] - public void TrySubtract_OffCentreHoleShiftsCentroidAway(double offset) + public void TrySubtract_OffCenterHoleShiftsCentroidAway(double offset) { - // 4x4 square minus a 1x1 hole centred at (1, 1): area 15, centroid (16*2 - 1)/15 = 2 + 1/15. + // 4x4 square minus a 1x1 hole centerd at (1, 1): area 15, centroid (16*2 - 1)/15 = 2 + 1/15. Assert.True(PolygonAreaMoments.TryCompute(Rectangle(offset, offset, 4, 4), out var outline)); Assert.True(PolygonAreaMoments.TryCompute(Rectangle(offset + 0.5, offset + 0.5, 1, 1), out var hole)); diff --git a/OpenNest.Tests/IO/ConvertedEtchMarkTests.cs b/OpenNest.Tests/IO/ConvertedEtchMarkTests.cs index 0db56751..ffd8c20d 100644 --- a/OpenNest.Tests/IO/ConvertedEtchMarkTests.cs +++ b/OpenNest.Tests/IO/ConvertedEtchMarkTests.cs @@ -203,7 +203,7 @@ public class ConvertedEtchMarkTests } } - // Turn-independent samples: line ends, and each circle's centre and radius. + // Turn-independent samples: line ends, and each circle's center and radius. private static List MarkSamples(Program program, Vector location) => ConvertProgram.ToGeometry(program) .Where(entity => entity.Layer == SpecialLayers.Scribe) diff --git a/OpenNest.Tests/ML/FeatureExtractorTests.cs b/OpenNest.Tests/ML/FeatureExtractorTests.cs index 4a27efcd..8b1ae6da 100644 --- a/OpenNest.Tests/ML/FeatureExtractorTests.cs +++ b/OpenNest.Tests/ML/FeatureExtractorTests.cs @@ -159,7 +159,7 @@ public class FeatureExtractorTests [Fact] public void RectangleBitmap_CoversEveryCell() { - // The material fills the bounding box, so all 32x32 sample centres are interior points. + // The material fills the bounding box, so all 32x32 sample centers are interior points. var features = FeatureExtractor.Extract(new RectangleShape { Length = 10, Width = 20 }.GetDrawing()); Assert.NotNull(features?.Bitmask); diff --git a/OpenNest.Tests/PlateCenterPartsTests.cs b/OpenNest.Tests/PlateCenterPartsTests.cs index 51d76ad4..58365a4f 100644 --- a/OpenNest.Tests/PlateCenterPartsTests.cs +++ b/OpenNest.Tests/PlateCenterPartsTests.cs @@ -30,7 +30,7 @@ public class PlateCenterPartsTests part.Offset(plate.OffsetToCenterPartsInWorkArea()); var box = part.BoundingBox; - // Work area is X 0.25..99.75, Y 0.75..99.75, so the centre sits 0.25 above the plate's. + // Work area is X 0.25..99.75, Y 0.75..99.75, so the center sits 0.25 above the plate's. Assert.Equal(50, box.Center.X, 6); Assert.Equal(50.25, box.Center.Y, 6); Assert.Equal(box.Left - 0.25, 99.75 - box.Right, 6); diff --git a/OpenNest.Tests/Strategies/FillPipelineTests.cs b/OpenNest.Tests/Strategies/FillPipelineTests.cs index 66a43e31..0e633220 100644 --- a/OpenNest.Tests/Strategies/FillPipelineTests.cs +++ b/OpenNest.Tests/Strategies/FillPipelineTests.cs @@ -70,7 +70,7 @@ public class FillPipelineTests var cts = new System.Threading.CancellationTokenSource(); cts.Cancel(); - // Pre-cancelled token should return empty or partial results without throwing + // Pre-canceled token should return empty or partial results without throwing var parts = filler.Fill(item, plate.WorkArea(), null, cts.Token); // Should not throw — graceful degradation diff --git a/OpenNest.Tests/TabbedCutouts/TabbedCutoutBuilderTests.cs b/OpenNest.Tests/TabbedCutouts/TabbedCutoutBuilderTests.cs index ce7ae5a1..adba1fa0 100644 --- a/OpenNest.Tests/TabbedCutouts/TabbedCutoutBuilderTests.cs +++ b/OpenNest.Tests/TabbedCutouts/TabbedCutoutBuilderTests.cs @@ -55,7 +55,7 @@ public class TabbedCutoutBuilderTests Assert.All(layout.Tabs, tab => Assert.Equal(W, tab.Sum(e => e.Length), 9)); Assert.All(layout.Tabs.SelectMany(t => t), e => Assert.Same(SpecialLayers.Tab, e.Layer)); Assert.All(layout.Pieces.SelectMany(p => p), e => Assert.NotSame(SpecialLayers.Tab, e.Layer)); - // The first tab is centred on the bottom edge's midpoint, the second on the top edge's. + // The first tab is centerd on the bottom edge's midpoint, the second on the top edge's. Assert.Equal(new Vector(5 + W / 2, 3), Start(layout.Pieces[0][0])); Assert.Equal(new Vector(5 + W / 2, 7), End(layout.Pieces[0][^1])); // Each tab follows its piece, so pieces and tabs close the hole exactly. diff --git a/OpenNest.Training/sketch-search/README.md b/OpenNest.Training/sketch-search/README.md index 7a0a55e9..a423c6b9 100644 --- a/OpenNest.Training/sketch-search/README.md +++ b/OpenNest.Training/sketch-search/README.md @@ -40,7 +40,7 @@ python search.py --index C:\SketchIndex photo.jpg --photo --size 10x4.5 - **Photos and scans:** pass `--photo` to use local thresholding, which handles uneven lighting. Crop to the sketch and take the photo square-on. - **`--size WxL`:** keeps only drawings of that overall size (either - orientation, inches or millimetres, default ±15%). The size is a hard filter, + orientation, inches or millimeters, default ±15%). The size is a hard filter, so use it only when the sketch's dimensions are reliable. - **Leave out text and small details:** draw the outline and the holes. Rotation and mirroring do not matter. @@ -71,7 +71,7 @@ sketches are the result that decides whether the approach works. 1. Each drawing's cut geometry is rasterized: G-code from the server, or DXF entities. Scribe, etch and break motions are skipped. 2. Drawings and sketches share one `normalize()` step. It reduces the ink to - 1px centre lines (a filled silhouette becomes its boundary), crops and scales + 1px center lines (a filled silhouette becomes its boundary), crops and scales the result into a 224×224 canvas, and redraws it at a fixed stroke width. 3. DINOv2 embeds the image: the CLS token joined with the mean patch token. 4. The query is embedded in all 8 rotations and mirrors, and each drawing scores @@ -81,7 +81,7 @@ sketches are the result that decides whether the approach works. ## Fine-tune The pretrained model alone is weak on a 40k-drawing library. Training it on -synthetic sketches of the library itself needs no labelling: +synthetic sketches of the library itself needs no labeling: ```sh python train.py --index C:\SketchIndex --out C:\SketchIndex\model diff --git a/OpenNest.Training/sketch-search/search.py b/OpenNest.Training/sketch-search/search.py index ff441f32..0481bdb0 100644 --- a/OpenNest.Training/sketch-search/search.py +++ b/OpenNest.Training/sketch-search/search.py @@ -39,7 +39,7 @@ class SketchIndex: self._aspects = None def size_mask(self, size, tolerance): - """Drawings whose extents match size (either orientation, inches or millimetres).""" + """Drawings whose extents match size (either orientation, inches or millimeters).""" want = np.sort(np.array(size, dtype=np.float64)) have = np.sort(np.array([[it["width"], it["height"]] for it in self.items]), axis=1) ok = np.zeros(len(self.items), bool) diff --git a/OpenNest.Training/sketch-search/sketch_common.py b/OpenNest.Training/sketch-search/sketch_common.py index e2d1eb0a..9e1b3f71 100644 --- a/OpenNest.Training/sketch-search/sketch_common.py +++ b/OpenNest.Training/sketch-search/sketch_common.py @@ -1,7 +1,7 @@ """Shared geometry reading, image normalization and embedding for sketch search. Drawings and sketches go through the same normalize() so the model compares like -with like: ink is reduced to 1px centre lines, cropped, scaled to fit a square +with like: ink is reduced to 1px center lines, cropped, scaled to fit a square canvas and re-stroked at a fixed width. """ import math @@ -191,7 +191,7 @@ def aspect(mask): def normalize(mask): - """Crops, centre-lines, scales and re-strokes an ink mask; returns a CANVAS x CANVAS RGB image.""" + """Crops, center-lines, scales and re-strokes an ink mask; returns a CANVAS x CANVAS RGB image.""" ys, xs = np.nonzero(mask) if len(xs) == 0: raise ValueError("No ink found.") diff --git a/OpenNest.Training/sketch-search/train.py b/OpenNest.Training/sketch-search/train.py index 0874a97f..34073a0e 100644 --- a/OpenNest.Training/sketch-search/train.py +++ b/OpenNest.Training/sketch-search/train.py @@ -3,7 +3,7 @@ Each step pairs fresh synthetic sketches with their drawings' renderings and trains the model to pick each sketch's own drawing out of the batch (symmetric InfoNCE). Held-out drawings (sketch_common.is_holdout) and near-duplicate renderings, which -would be false negatives within a batch, are left out. No hand labelling is needed. +would be false negatives within a batch, are left out. No hand labeling is needed. python train.py --index C:\\SketchIndex --out C:\\SketchIndex\\model python build_index.py --index C:\\SketchIndex --server http://barge.lan:8091 --model C:\\SketchIndex\\model diff --git a/OpenNest.WinForms.Tests/Controls/CutOffSegmentLabelTests.cs b/OpenNest.WinForms.Tests/Controls/CutOffSegmentLabelTests.cs index d64b6b66..d197181e 100644 --- a/OpenNest.WinForms.Tests/Controls/CutOffSegmentLabelTests.cs +++ b/OpenNest.WinForms.Tests/Controls/CutOffSegmentLabelTests.cs @@ -7,13 +7,13 @@ namespace OpenNest.WinForms.Tests.Controls; /// /// Each segment of a cut-off is its own part of the one cut-off drawing. Its sequence label must -/// sit on its own cut: labelled from the whole drawing, every segment stacked its number on one +/// sit on its own cut: labeled from the whole drawing, every segment stacked its number on one /// point, and the view's culling decided which one showed as the user zoomed. /// public class CutOffSegmentLabelTests { [Fact] - public void EachSegmentIsLabelledAtTheMiddleOfItsOwnCut() => StaTestThread.Run(() => + public void EachSegmentIsLabeledAtTheMiddleOfItsOwnCut() => StaTestThread.Run(() => { using var view = new PlateView(ColorSchemeRegistry.Get("Workshop")); view.Matrix = new Matrix(); diff --git a/OpenNest.WinForms.Tests/Controls/CutSimulationOverlayTests.cs b/OpenNest.WinForms.Tests/Controls/CutSimulationOverlayTests.cs index 823ee04e..5c8c8451 100644 --- a/OpenNest.WinForms.Tests/Controls/CutSimulationOverlayTests.cs +++ b/OpenNest.WinForms.Tests/Controls/CutSimulationOverlayTests.cs @@ -42,7 +42,7 @@ public class CutSimulationOverlayTests var sim = CutSimulation.Build(view.Plate, Parameters); overlay.Load(sim); - Assert.True(overlay.IsPartPending(0)); // still travelling to the first part + Assert.True(overlay.IsPartPending(0)); // still traveling to the first part var firstCut = sim.Steps.First(s => s.Kind == CutSimulationStepKind.Cut); overlay.Time = firstCut.StartTime + firstCut.Duration / 2; Assert.False(overlay.IsPartPending(0)); diff --git a/OpenNest.WinForms.Tests/Forms/AutoNestFormLedgerStockTests.cs b/OpenNest.WinForms.Tests/Forms/AutoNestFormLedgerStockTests.cs index 1386d96f..f99c9b46 100644 --- a/OpenNest.WinForms.Tests/Forms/AutoNestFormLedgerStockTests.cs +++ b/OpenNest.WinForms.Tests/Forms/AutoNestFormLedgerStockTests.cs @@ -387,7 +387,7 @@ public class AutoNestFormLedgerStockTests private static object GetValue(object row, string property) => TypeDescriptor.GetProperties(row)[property]!.GetValue(row)!; - /// The fore colour the grid's CellFormatting handlers give a cell. + /// The fore color the grid's CellFormatting handlers give a cell. private static System.Drawing.Color FormattedForeColor(DataGridView grid, int column, int row) { var args = new DataGridViewCellFormattingEventArgs(column, row, grid[column, row].Value, typeof(string), diff --git a/OpenNest.WinForms.Tests/Forms/AutoNestFormStockOptionsTests.cs b/OpenNest.WinForms.Tests/Forms/AutoNestFormStockOptionsTests.cs index f9dc1c37..50c8938f 100644 --- a/OpenNest.WinForms.Tests/Forms/AutoNestFormStockOptionsTests.cs +++ b/OpenNest.WinForms.Tests/Forms/AutoNestFormStockOptionsTests.cs @@ -134,7 +134,7 @@ public class AutoNestFormStockOptionsTests } [Fact] - public void BlankAndCancelledRowsDoNotBecomeStockOptions() + public void BlankAndCanceledRowsDoNotBecomeStockOptions() { RunSta(() => { diff --git a/OpenNest.WinForms.Tests/Forms/DrawingLibraryFormTests.cs b/OpenNest.WinForms.Tests/Forms/DrawingLibraryFormTests.cs index 414aefa8..ec3ea3e8 100644 --- a/OpenNest.WinForms.Tests/Forms/DrawingLibraryFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/DrawingLibraryFormTests.cs @@ -342,7 +342,7 @@ public class DrawingLibraryFormTests Field(editor, "gradeBox").Text = "Grade A"; Field(editor, "thicknessBox").Value = 6.35; - // The new details duplicate SYN-707: cancelling the warning saves nothing. + // The new details duplicate SYN-707: canceling the warning saves nothing. Run(editor.SaveAsync()); Assert.Contains("'SYN-707'", Assert.Single(warnings)); Assert.Empty(library.MetadataUpdates); diff --git a/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs b/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs index 22aa2b62..ed664686 100644 --- a/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs +++ b/OpenNest.WinForms.Tests/Forms/DrawingSetFormsTests.cs @@ -130,7 +130,7 @@ public class DrawingSetFormsTests } [Fact] - public void EditorLibraryPane_ListsEveryDrawing_AddsTheSelectionInListOrder_AndGreysMembers() + public void EditorLibraryPane_ListsEveryDrawing_AddsTheSelectionInListOrder_AndGraysMembers() { StaTestThread.Run( () => diff --git a/OpenNest.WinForms.Tests/Forms/ImportBomToSetFormTests.cs b/OpenNest.WinForms.Tests/Forms/ImportBomToSetFormTests.cs index 59d4cd31..b02b8bfa 100644 --- a/OpenNest.WinForms.Tests/Forms/ImportBomToSetFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/ImportBomToSetFormTests.cs @@ -33,7 +33,7 @@ public sealed class ImportBomToSetFormTests : IDisposable } [Fact] - public void ImportBom_OpensTheEditorPrefilled_AndCancellingItStoresNoSet() + public void ImportBom_OpensTheEditorPrefilled_AndCancelingItStoresNoSet() { StaTestThread.Run( () => @@ -104,7 +104,7 @@ public sealed class ImportBomToSetFormTests : IDisposable } [Fact] - public void DecliningTheLibraryWrites_OrCancelling_StoresNothing() + public void DecliningTheLibraryWrites_OrCanceling_StoresNothing() { StaTestThread.Run( () => diff --git a/OpenNest.WinForms.Tests/Forms/LedgerCodeRecheckTests.cs b/OpenNest.WinForms.Tests/Forms/LedgerCodeRecheckTests.cs index 9a11ddb8..2910b2fe 100644 --- a/OpenNest.WinForms.Tests/Forms/LedgerCodeRecheckTests.cs +++ b/OpenNest.WinForms.Tests/Forms/LedgerCodeRecheckTests.cs @@ -53,7 +53,7 @@ public class LedgerCodeRecheckTests Assert.False(Confirm(fake, env, "Save")); Assert.Equal(before, UndoTestEnv.Describe(env.Nest)); - Assert.Equal("Save cancelled", fake.Status); + Assert.Equal("Save canceled", fake.Status); }, CodedNest); [Fact] diff --git a/OpenNest.WinForms.Tests/Forms/MainFormCharacterizationTests.cs b/OpenNest.WinForms.Tests/Forms/MainFormCharacterizationTests.cs index 71f20eca..28b03ce0 100644 --- a/OpenNest.WinForms.Tests/Forms/MainFormCharacterizationTests.cs +++ b/OpenNest.WinForms.Tests/Forms/MainFormCharacterizationTests.cs @@ -5,7 +5,7 @@ using OpenNest.Geometry; namespace OpenNest.WinForms.Tests.Forms; -// Pins MainForm behaviour that its refactor must preserve: the deliberately different +// Pins MainForm behavior that its refactor must preserve: the deliberately different // busy guards. Reads Application.OpenForms, so it must not overlap fill-lifetime tests. [Collection("Fill operation lifetime")] public class MainFormCharacterizationTests diff --git a/OpenNest.WinForms.Tests/Forms/NestValidationFormTests.cs b/OpenNest.WinForms.Tests/Forms/NestValidationFormTests.cs index 1545d680..c5246455 100644 --- a/OpenNest.WinForms.Tests/Forms/NestValidationFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/NestValidationFormTests.cs @@ -49,7 +49,7 @@ public class NestValidationFormTests } [Fact] - public void CompletionClosesWithoutCancellingSuccessfulJob() + public void CompletionClosesWithoutCancelingSuccessfulJob() { RunSta(() => { diff --git a/OpenNest.WinForms.Tests/Forms/OperationProgressFormTests.cs b/OpenNest.WinForms.Tests/Forms/OperationProgressFormTests.cs index c7529eb1..67b6cdb6 100644 --- a/OpenNest.WinForms.Tests/Forms/OperationProgressFormTests.cs +++ b/OpenNest.WinForms.Tests/Forms/OperationProgressFormTests.cs @@ -26,7 +26,7 @@ public class OperationProgressFormTests Assert.True(form.CancelRequested); Assert.False(form.CancelEnabled); - Assert.StartsWith("Cancelling", form.StatusText); + Assert.StartsWith("Canceling", form.StatusText); PumpFor(TimeSpan.FromMilliseconds(200)); Assert.False(form.IsDisposed, "Cancel closed the window while the worker was still running."); Assert.True(form.Visible); @@ -87,21 +87,21 @@ public class OperationProgressFormTests }, TimeSpan.FromMinutes(1), "The STA test did not complete."); [Fact] - public void CancelledExpandMovesNoPartAndReportsIt() => StaTestThread.Run(() => + public void CanceledExpandMovesNoPartAndReportsIt() => StaTestThread.Run(() => { using var view = TwoPartView(); var before = view.Plate.Parts.Select(p => p.Location).ToArray(); var handled = view.ExpandSelected(work => { - using var cancelled = new CancellationTokenSource(); - cancelled.Cancel(); - return work(cancelled.Token); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + return work(canceled.Token); }); Assert.True(handled); Assert.Equal(before, view.Plate.Parts.Select(p => p.Location).ToArray()); - Assert.Contains("cancelled", view.Status); + Assert.Contains("canceled", view.Status); }, TimeSpan.FromMinutes(1), "The STA test did not complete."); [Fact] diff --git a/OpenNest.WinForms.Tests/Forms/UndoRecordingTests.cs b/OpenNest.WinForms.Tests/Forms/UndoRecordingTests.cs index f528729a..2f095d4e 100644 --- a/OpenNest.WinForms.Tests/Forms/UndoRecordingTests.cs +++ b/OpenNest.WinForms.Tests/Forms/UndoRecordingTests.cs @@ -8,7 +8,7 @@ using OpenNest.Geometry; namespace OpenNest.WinForms.Tests.Forms; -// Each desktop edit records one labelled undo entry and Undo puts the nest back. Reads +// Each desktop edit records one labeled undo entry and Undo puts the nest back. Reads // Application.OpenForms through the busy guards, so it must not overlap fill-lifetime tests. [Collection("Fill operation lifetime")] public class UndoRecordingTests @@ -119,7 +119,7 @@ public class UndoRecordingTests }); [Fact] - public void CancellingEditPlateRecordsNothing() => UndoTestEnv.Run(env => + public void CancelingEditPlateRecordsNothing() => UndoTestEnv.Run(env => { env.Editor.PlateManager.LoadAt(2); UndoTestEnv.WhenShown(form => form.DialogResult = DialogResult.Cancel); @@ -430,7 +430,7 @@ public class UndoRecordingTests }, NestWithRequiredQuantity); [Fact] - public void CancellingTheConverterRecordsNothing() => UndoTestEnv.Run(env => + public void CancelingTheConverterRecordsNothing() => UndoTestEnv.Run(env => { var before = UndoTestEnv.Describe(env.Nest); UndoTestEnv.WhenShown(form => form.DialogResult = DialogResult.Cancel); diff --git a/OpenNest/Actions/ActionSequenceByPath.cs b/OpenNest/Actions/ActionSequenceByPath.cs index 0182e573..db841611 100644 --- a/OpenNest/Actions/ActionSequenceByPath.cs +++ b/OpenNest/Actions/ActionSequenceByPath.cs @@ -45,7 +45,7 @@ namespace OpenNest.Actions // step, while Backspace or Ctrl+Z inside it still take back one line at a time. private ChangeScope change; - // Starting the tool again builds the new one before this one is cancelled and + // Starting the tool again builds the new one before this one is canceled and // disconnected, so this one must leave the view's muting to its successor. private bool OwnsView => ReferenceEquals(plateView.MutedParts, muted); diff --git a/OpenNest/Controls/DrawingLibraryView.cs b/OpenNest/Controls/DrawingLibraryView.cs index bd48741d..be22de44 100644 --- a/OpenNest/Controls/DrawingLibraryView.cs +++ b/OpenNest/Controls/DrawingLibraryView.cs @@ -67,7 +67,7 @@ namespace OpenNest.Controls internal Func EditDrawing { get; set; } /// - /// Chooses the set for Add to Set: Ok false when cancelled, otherwise the listed set or + /// Chooses the set for Add to Set: Ok false when canceled, otherwise the listed set or /// null for a new one; replaced by tests. /// internal Func<(bool Ok, DrawingSetRecord Listed)> ChooseSet { get; set; } diff --git a/OpenNest/Controls/DrawingSetBrowser.cs b/OpenNest/Controls/DrawingSetBrowser.cs index 1f5e507e..e3b467ba 100644 --- a/OpenNest/Controls/DrawingSetBrowser.cs +++ b/OpenNest/Controls/DrawingSetBrowser.cs @@ -62,7 +62,7 @@ namespace OpenNest.Controls /// /// Shows Import BOM and returns the new set it prefilled (its library drawings already - /// stored with the operator's consent), or null when cancelled; replaced by tests. + /// stored with the operator's consent), or null when canceled; replaced by tests. /// internal Func ImportBom { get; set; } diff --git a/OpenNest/Controls/EntityView.cs b/OpenNest/Controls/EntityView.cs index 98cbab37..035452d1 100644 --- a/OpenNest/Controls/EntityView.cs +++ b/OpenNest/Controls/EntityView.cs @@ -39,7 +39,7 @@ namespace OpenNest.Controls private readonly SolidBrush textBrush = new SolidBrush(Color.FromArgb(180, 200, 200, 200)); public event EventHandler LinePicked; - public event EventHandler PickCancelled; + public event EventHandler PickCanceled; public event EventHandler TextConvertRequested; private bool isPickingBendLine; @@ -263,7 +263,7 @@ namespace OpenNest.Controls IsPickingBendLine = false; IsPickingBreakoff = false; IsPickingTabbedCutout = false; - PickCancelled?.Invoke(this, EventArgs.Empty); + PickCanceled?.Invoke(this, EventArgs.Empty); } } diff --git a/OpenNest/Controls/GridStyle.cs b/OpenNest/Controls/GridStyle.cs index 9a11ca36..a15f2dcb 100644 --- a/OpenNest/Controls/GridStyle.cs +++ b/OpenNest/Controls/GridStyle.cs @@ -9,7 +9,7 @@ namespace OpenNest.Controls; /// The shared look of every in the desktop app, taken from the /// database nest browser: flat light headers, faint grid lines, a soft blue selection and /// fixed row heights. Columns size once to their first content, before it is first painted, -/// and are then the user's to resize. Other behaviour (editing, selection mode) stays with each grid. +/// and are then the user's to resize. Other behavior (editing, selection mode) stays with each grid. /// public static class GridStyle { diff --git a/OpenNest/Controls/PlateRenderer.cs b/OpenNest/Controls/PlateRenderer.cs index 7d566cf2..32b6a6c9 100644 --- a/OpenNest/Controls/PlateRenderer.cs +++ b/OpenNest/Controls/PlateRenderer.cs @@ -287,7 +287,7 @@ namespace OpenNest.Controls // D8: a clamp taken off this sheet, by Auto Nest as a last resort or by hand (right-click). // Distinct from an active clamp - a - // dashed grey outline and a small "remove" marker, still display + exclusion only + // dashed gray outline and a small "remove" marker, still display + exclusion only // (no hit test, selection or sequencing). private static readonly Color RemovedClampOutlineColor = Color.FromArgb(200, 110, 110, 110); diff --git a/OpenNest/Controls/PostSettingsEditor.cs b/OpenNest/Controls/PostSettingsEditor.cs index 5fe12489..d4be7705 100644 --- a/OpenNest/Controls/PostSettingsEditor.cs +++ b/OpenNest/Controls/PostSettingsEditor.cs @@ -11,7 +11,7 @@ namespace OpenNest.Controls /// /// Sectioned settings editor for a post-processor config described by /// . Edits are held in the controls and - /// written to the config only by , so cancelling + /// written to the config only by , so canceling /// leaves the config untouched. /// public sealed class PostSettingsEditor : UserControl diff --git a/OpenNest/Controls/ReleasePanel.cs b/OpenNest/Controls/ReleasePanel.cs index fc036e5c..24577820 100644 --- a/OpenNest/Controls/ReleasePanel.cs +++ b/OpenNest/Controls/ReleasePanel.cs @@ -577,7 +577,7 @@ namespace OpenNest.Controls /// /// Opens Edit Drawing, one after another, on each drawing the selected group is refused - /// for, or the first refused group's when a releasable one is selected; cancelling one + /// for, or the first refused group's when a releasable one is selected; canceling one /// stops. The plan is rebuilt after each save. /// internal async Task FixSelectedGroupAsync() diff --git a/OpenNest/Controls/SelectionManager.cs b/OpenNest/Controls/SelectionManager.cs index df9a5318..44b55975 100644 --- a/OpenNest/Controls/SelectionManager.cs +++ b/OpenNest/Controls/SelectionManager.cs @@ -173,7 +173,7 @@ namespace OpenNest.Controls } /// - /// Rotates the selection by about its centre, keeping its + /// Rotates the selection by about its center, keeping its /// lower-left corner; with , quick repeats undo as one. /// public void RotateSelectedParts(double angle, bool coalesce = false) @@ -220,7 +220,7 @@ namespace OpenNest.Controls /// Grows the part-to-part spacing of the selection as far as the plate /// allows (Expander). executes the search and may /// cancel it through its token (the desktop shows a Cancel window); by - /// default it runs synchronously. A cancelled run moves no part. Returns + /// default it runs synchronously. A canceled run moves no part. Returns /// false only when fewer than two parts are selected. /// public bool ExpandSelected( @@ -239,9 +239,9 @@ namespace OpenNest.Controls using var change = view.BeginChange("Expand Spacing"); var result = run != null ? run(Work) : Work(CancellationToken.None); - if (result.Cancelled) + if (result.Canceled) { - view.Status = "Expand Spacing cancelled - no parts were moved"; + view.Status = "Expand Spacing canceled - no parts were moved"; change.Complete(); return true; } diff --git a/OpenNest/Forms/AddReleaseDrawingsForm.cs b/OpenNest/Forms/AddReleaseDrawingsForm.cs index 3600eb66..4674c5bb 100644 --- a/OpenNest/Forms/AddReleaseDrawingsForm.cs +++ b/OpenNest/Forms/AddReleaseDrawingsForm.cs @@ -15,7 +15,7 @@ namespace OpenNest.Forms /// set editor's library pane does (, never filtered /// to a nest), and adds the selected drawings to the release dialog at the entered quantity. /// It stays open so several drawings can be added at different quantities; a drawing the - /// release already lists is greyed. + /// release already lists is grayed. /// public partial class AddReleaseDrawingsForm : Form { @@ -159,7 +159,7 @@ namespace OpenNest.Forms UpdateAddCommand(); } - // Greys the drawings the release already lists, so what is left to add stands out. + // Grays the drawings the release already lists, so what is left to add stands out. private void MarkListed() { foreach (DataGridViewRow row in libraryGrid.Rows) diff --git a/OpenNest/Forms/AutoNestForm.cs b/OpenNest/Forms/AutoNestForm.cs index 4e5c1a43..b16ad0d4 100644 --- a/OpenNest/Forms/AutoNestForm.cs +++ b/OpenNest/Forms/AutoNestForm.cs @@ -303,7 +303,7 @@ namespace OpenNest.Forms error = null; // CellValidating cancels an unparsable size and leaves the cell in edit mode; - // calling EndEdit() on that cancelled edit hangs/throws instead of returning + // calling EndEdit() on that canceled edit hangs/throws instead of returning // false for it. Catch an unparsable pending edit ourselves first so EndEdit() // is never asked to commit or discard it. if ( @@ -748,7 +748,7 @@ namespace OpenNest.Forms var ledger = ItemAt(e.RowIndex)?.LedgerRow; if (ledger == null) return; - // A substitute's source stays in full colour so it stands out from the preferred stock. + // A substitute's source stays in full color so it stands out from the preferred stock. if (property == "Source" && ledger.IsSubstitute) e.CellStyle.ForeColor = SubstituteColor; else if (property is "Size" or "Cost" or "Source") diff --git a/OpenNest/Forms/AutomaticCutOffForm.cs b/OpenNest/Forms/AutomaticCutOffForm.cs index c6100d7f..6b5a13da 100644 --- a/OpenNest/Forms/AutomaticCutOffForm.cs +++ b/OpenNest/Forms/AutomaticCutOffForm.cs @@ -25,7 +25,7 @@ public partial class AutomaticCutOffForm : Form private bool settingMinimumStrip; private bool settingsOnly; - /// In settings mode, the options chosen with OK; null otherwise or when cancelled. + /// In settings mode, the options chosen with OK; null otherwise or when canceled. internal AutomaticCutOffOptions SelectedOptions { get; private set; } /// diff --git a/OpenNest/Forms/CadConverterForm.cs b/OpenNest/Forms/CadConverterForm.cs index 282f4469..8f027725 100644 --- a/OpenNest/Forms/CadConverterForm.cs +++ b/OpenNest/Forms/CadConverterForm.cs @@ -67,7 +67,7 @@ namespace OpenNest.Forms entityView1.TabbedCutoutPicked += OnTabbedCutoutPicked; entityView1.CutoutTabDragged += OnCutoutTabDragged; entityView1.LinePicked += OnLinePicked; - entityView1.PickCancelled += OnPickCancelled; + entityView1.PickCanceled += OnPickCanceled; entityView1.TextConvertRequested += OnTextConvertRequested; entityView1.EntityActionRequested += OnEntityActionRequested; btnSplit.Click += OnSplitClicked; @@ -543,7 +543,7 @@ namespace OpenNest.Forms entityView1.Invalidate(); } - private void OnPickCancelled(object sender, EventArgs e) + private void OnPickCanceled(object sender, EventArgs e) { entityView1.IsPickingBendLine = false; filterPanel.SetPickMode(false); diff --git a/OpenNest/Forms/Commands/AutoNestCommand.cs b/OpenNest/Forms/Commands/AutoNestCommand.cs index 47640e90..b28672f2 100644 --- a/OpenNest/Forms/Commands/AutoNestCommand.cs +++ b/OpenNest/Forms/Commands/AutoNestCommand.cs @@ -49,7 +49,7 @@ namespace OpenNest.Forms.Commands /// /// Shows the Auto Nest dialog for . Returns null when it is - /// cancelled, nothing has a quantity, or the plate-size options are invalid. + /// canceled, nothing has a quantity, or the plate-size options are invalid. /// public static AutoNestCommand Prompt(IWin32Window owner, EditNestForm target) { @@ -82,7 +82,7 @@ namespace OpenNest.Forms.Commands } /// - /// Solves and commits the job. Cancelling discards the whole + /// Solves and commits the job. Canceling discards the whole /// proposal; failures are reported to the user rather than thrown. /// public async Task RunAsync(CancellationTokenSource cts) diff --git a/OpenNest/Forms/Commands/NestStorageController.cs b/OpenNest/Forms/Commands/NestStorageController.cs index 824906e4..fd5d6f99 100644 --- a/OpenNest/Forms/Commands/NestStorageController.cs +++ b/OpenNest/Forms/Commands/NestStorageController.cs @@ -130,7 +130,7 @@ namespace OpenNest.Forms.Commands if (chosen is null) { if (!owner.IsDisposed) - showStatus("Save cancelled"); + showStatus("Save canceled"); return; } renamed = chosen != originalName; diff --git a/OpenNest/Forms/CuttingInspectionPanel.cs b/OpenNest/Forms/CuttingInspectionPanel.cs index 465b6b98..2d4de082 100644 --- a/OpenNest/Forms/CuttingInspectionPanel.cs +++ b/OpenNest/Forms/CuttingInspectionPanel.cs @@ -330,14 +330,14 @@ internal sealed class CuttingInspectionPanel : UserControl return; if (IsPlanning) { - // The dialog changes the live plates, so it opens once the running plan has cancelled. + // The dialog changes the live plates, so it opens once the running plan has canceled. if (pendingCutOffSettings || pendingClear) return; pendingCutOffSettings = true; pendingReplan = true; ClearResult(); SetPlanning(true); - SetStatus(Tone.Neutral, "Cancelling the plan to edit the cut-off settings…"); + SetStatus(Tone.Neutral, "Canceling the plan to edit the cut-off settings…"); if (!inspection.CloseRequested) inspection.RequestClose(); return; @@ -471,7 +471,7 @@ internal sealed class CuttingInspectionPanel : UserControl scopeSelector.Visible = planning && (allPlates || everyPlate.Length > 1 || !ReferenceEquals(everyPlate[0], current)); } - /// Replans for the chosen scope; a running plan is cancelled first so the plates never change under it. + /// Replans for the chosen scope; a running plan is canceled first so the plates never change under it. internal void ChangeScope(bool all) { if (closed || closeRequested || pendingMode != null || Mode != CuttingInspectionMode.Plan @@ -582,7 +582,7 @@ internal sealed class CuttingInspectionPanel : UserControl if (!task.IsCompletedSuccessfully) { if (task.IsCanceled) - SetStatus(Tone.Neutral, "Validation cancelled.", "Recheck to review this nest."); + SetStatus(Tone.Neutral, "Validation canceled.", "Recheck to review this nest."); else SetStatus(Tone.Bad, "Validation failed. Recheck to review this nest.", task.Exception?.GetBaseException().Message); @@ -683,7 +683,7 @@ internal sealed class CuttingInspectionPanel : UserControl size = System.Math.Max(size, start.DistanceTo(end) * 1.5); view.ZoomToArea(point.X - size / 2, point.Y - size / 2, size, size); // A narrow docked canvas can put a contact at its edge after zoom. - // Centre a typed witness, never infer one from the diagnostic text. + // Center a typed witness, never infer one from the diagnostic text. var focus = finding.Kind == PostVerificationKind.RapidCrossing && finding.ContactPoints.Any(contact => double.IsFinite(contact.X) && double.IsFinite(contact.Y)) ? finding.ContactPoints.First(contact => double.IsFinite(contact.X) && double.IsFinite(contact.Y)) @@ -801,7 +801,7 @@ internal sealed class CuttingInspectionPanel : UserControl inspection = new CuttingProposalInspection(); if (pendingClear) { - pendingClear = false; // The cancelled run no longer reads the plates. + pendingClear = false; // The canceled run no longer reads the plates. if (!ClearAppliedWork()) { pendingScope = null; @@ -821,7 +821,7 @@ internal sealed class CuttingInspectionPanel : UserControl } if (pendingCutOffSettings) { - pendingCutOffSettings = false; // The cancelled run no longer reads the plates. + pendingCutOffSettings = false; // The canceled run no longer reads the plates. SetPlanning(false); EditCutOffSettings(); // Replans when the dialog closes. return; @@ -839,7 +839,7 @@ internal sealed class CuttingInspectionPanel : UserControl } if (work.IsCanceled) { - SetStatus(Tone.Neutral, "Planning cancelled. Nothing changed."); + SetStatus(Tone.Neutral, "Planning canceled. Nothing changed."); return; } invalidated = false; @@ -883,8 +883,8 @@ internal sealed class CuttingInspectionPanel : UserControl private void ShowPlanStatus() { var issues = warningGrid.Rows.Count; - if (Proposal.IsCancelled) - SetStatus(Tone.Neutral, "Planning cancelled. Nothing changed."); + if (Proposal.IsCanceled) + SetStatus(Tone.Neutral, "Planning canceled. Nothing changed."); else if (Proposal.CanApply) SetStatus(Tone.Good, plates.Length > 1 ? $"Ready to apply to {Count(plates.Length, "plate")}." : "Ready to apply."); else if (Proposal.RequiresWarningAcceptance) @@ -934,7 +934,7 @@ internal sealed class CuttingInspectionPanel : UserControl CuttingPlanStatus.UnsupportedGeometry => "unsupported geometry", CuttingPlanStatus.InvalidInput => "invalid input", CuttingPlanStatus.NoSolutionWithinBudget => "no plan found within the search limit", - CuttingPlanStatus.Cancelled => "cancelled", + CuttingPlanStatus.Canceled => "canceled", var status => status.ToString(), }; } @@ -972,7 +972,7 @@ internal sealed class CuttingInspectionPanel : UserControl private void SetPlanning(bool running) { - // Planning inputs change mid-plan by cancelling the run and replanning, so they stay enabled + // Planning inputs change mid-plan by canceling the run and replanning, so they stay enabled // unless closing or switching; validation still locks them while it runs. var replannable = !running || Mode == CuttingInspectionMode.Plan && !closeRequested && pendingMode == null; settingsButton.Enabled = keepOrderCheckBox.Enabled = planButton.Enabled = replannable; @@ -1383,7 +1383,7 @@ internal sealed class CuttingInspectionPanel : UserControl pendingReplan = true; ClearResult(); SetPlanning(true); - SetStatus(Tone.Neutral, "Cancelling the plan to clear lead-ins and cut-offs…"); + SetStatus(Tone.Neutral, "Canceling the plan to clear lead-ins and cut-offs…"); if (!inspection.CloseRequested) inspection.RequestClose(); return; diff --git a/OpenNest/Forms/EditDrawingSetForm.cs b/OpenNest/Forms/EditDrawingSetForm.cs index 42ebb47c..dbd939fd 100644 --- a/OpenNest/Forms/EditDrawingSetForm.cs +++ b/OpenNest/Forms/EditDrawingSetForm.cs @@ -17,7 +17,7 @@ namespace OpenNest.Forms /// customer, notes and the members with a quantity each. The drawing library is /// browsed in the left pane (every active drawing, a page at a time through /// ); Add to Set, a double-click or Enter adds the - /// selected drawings at the entered quantity, and a drawing already in the set is greyed + /// selected drawings at the entered quantity, and a drawing already in the set is grayed /// and not added twice. Edit Drawing (a double-click on a member, its right-click menu or /// the button) reads the member's current library record and edits its details there, so /// a drawing without a material or thickness can be fixed in place. History lists a saved @@ -358,7 +358,7 @@ namespace OpenNest.Forms UpdateAddCommand(); } - // Greys the library rows already in the set, so what is left to add stands out. + // Grays the library rows already in the set, so what is left to add stands out. private void MarkMembersInLibrary() { var members = session.Members.Select(m => m.DrawingId).ToHashSet(); diff --git a/OpenNest/Forms/ImportBomToSetForm.cs b/OpenNest/Forms/ImportBomToSetForm.cs index 67f935ac..bcc580e1 100644 --- a/OpenNest/Forms/ImportBomToSetForm.cs +++ b/OpenNest/Forms/ImportBomToSetForm.cs @@ -196,7 +196,7 @@ namespace OpenNest.Forms }; var left = plan.Count(DrawingSetImportAction.Skip) + drawings.Skipped.Count; if (left > 0) - parts.Add($"{left} not imported (greyed)."); + parts.Add($"{left} not imported (grayed)."); var bare = plan.Entries.Where((e, i) => e.Action != DrawingSetImportAction.Skip && drawings.Drawings[i].NeedsDetails).Count(); if (bare > 0) parts.Add($"{bare} {(bare == 1 ? "has" : "have")} no material or thickness; fix {(bare == 1 ? "it" : "them")} with Edit Drawing in the set editor before making nests."); diff --git a/OpenNest/Forms/LedgerCodeRecheck.cs b/OpenNest/Forms/LedgerCodeRecheck.cs index a5111f0f..fbc4276a 100644 --- a/OpenNest/Forms/LedgerCodeRecheck.cs +++ b/OpenNest/Forms/LedgerCodeRecheck.cs @@ -60,7 +60,7 @@ namespace OpenNest.Forms /// /// True when ("Save" or "Post") may go on: no codes, nothing /// to check, nothing taken, or the programmer chose to go on or to remove the codes. - /// False when they cancelled or the window closed meanwhile. A Save As + /// False when they canceled or the window closed meanwhile. A Save As /// () is a new nest: the original's codes and holds count as /// another nest's. /// @@ -125,7 +125,7 @@ namespace OpenNest.Forms showStatus($"Removed {codes.Count} ledger item code{(codes.Count == 1 ? "" : "s")} from {removed} sheet{(removed == 1 ? "" : "s")}"); return true; default: - showStatus($"{action} cancelled"); + showStatus($"{action} canceled"); return false; } } diff --git a/OpenNest/Forms/NestDrawingsToSet.cs b/OpenNest/Forms/NestDrawingsToSet.cs index c34e820f..77bdf01b 100644 --- a/OpenNest/Forms/NestDrawingsToSet.cs +++ b/OpenNest/Forms/NestDrawingsToSet.cs @@ -24,7 +24,7 @@ namespace OpenNest.Forms /// Shows a message and returns the operator's answer; replaced by tests. internal Func ShowMessage { get; set; } - /// Chooses the set: Ok false when cancelled, otherwise the listed set or null for a new one; replaced by tests. + /// Chooses the set: Ok false when canceled, otherwise the listed set or null for a new one; replaced by tests. internal Func<(bool Ok, DrawingSetRecord Listed)> ChooseSet { get; set; } /// Shows the set editor and returns the saved record, or null; replaced by tests. diff --git a/OpenNest/Forms/OperationProgressForm.cs b/OpenNest/Forms/OperationProgressForm.cs index a2d138ce..11f88b76 100644 --- a/OpenNest/Forms/OperationProgressForm.cs +++ b/OpenNest/Forms/OperationProgressForm.cs @@ -10,7 +10,7 @@ namespace OpenNest.Forms; /// /// Small "working" window with a Cancel button for a long plate operation that /// runs on a worker thread. Cancel, Escape and the close box only request -/// cancellation: the window stays open showing "Cancelling..." until the worker +/// cancellation: the window stays open showing "Canceling..." until the worker /// has actually stopped, so the caller never continues while it is still running. /// internal sealed class OperationProgressForm : Form @@ -188,7 +188,7 @@ internal sealed class OperationProgressForm : Form var elapsed = stopwatch.Elapsed; var time = $"{(int)elapsed.TotalMinutes}:{elapsed.Seconds:00}"; statusLabel.Text = cts.IsCancellationRequested - ? $"Cancelling... waiting for the current step to stop ({time})" + ? $"Canceling... waiting for the current step to stop ({time})" : $"Elapsed {time}"; } } diff --git a/OpenNest/LayoutPart.cs b/OpenNest/LayoutPart.cs index 228b5d98..eda7268a 100644 --- a/OpenNest/LayoutPart.cs +++ b/OpenNest/LayoutPart.cs @@ -446,7 +446,7 @@ namespace OpenNest } // Every segment of a cut-off is a part of the one cut-off drawing with its own trimmed - // program. Labelled from the drawing, all of them would stack on one point and the view's + // program. Labeled from the drawing, all of them would stack on one point and the view's // culling would decide which number shows; label each at the middle of its own cut. private Vector? CutOffSegmentLabelPoint() { diff --git a/OpenNest/ToolStripRenderer.cs b/OpenNest/ToolStripRenderer.cs index 936d75ac..55711c5a 100644 --- a/OpenNest/ToolStripRenderer.cs +++ b/OpenNest/ToolStripRenderer.cs @@ -426,7 +426,7 @@ namespace OpenNest } } - // The only purpose of this override is to change the arrow colour. + // The only purpose of this override is to change the arrow color. // It's OK to just draw over the default arrow since we also pass down arrow drawing to the system renderer. protected override void OnRenderSplitButtonBackground(ToolStripItemRenderEventArgs e) { @@ -435,7 +435,7 @@ namespace OpenNest ToolStripSplitButton sb = (ToolStripSplitButton)e.Item; base.OnRenderSplitButtonBackground(e); - // It doesn't matter what colour of arrow we tell it to draw. OnRenderArrow will compute it from the item anyway. + // It doesn't matter what color of arrow we tell it to draw. OnRenderArrow will compute it from the item anyway. OnRenderArrow( new ToolStripArrowRenderEventArgs( e.Graphics, @@ -589,7 +589,7 @@ namespace OpenNest protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) { // The default renderer will draw an arrow for us (the UXTheme API seems not to have one for all directions), - // but it will get the colour wrong in many cases. The text colour is probably the best colour to use. + // but it will get the color wrong in many cases. The text color is probably the best color to use. if (EnsureRenderer()) e.ArrowColor = GetItemTextColor(e.Item); base.OnRenderArrow(e); diff --git a/Posts/OpenNest.Posts.CincinnatiCIFiber/CIFiberProgramWriter.cs b/Posts/OpenNest.Posts.CincinnatiCIFiber/CIFiberProgramWriter.cs index 0bde4ded..cf287491 100644 --- a/Posts/OpenNest.Posts.CincinnatiCIFiber/CIFiberProgramWriter.cs +++ b/Posts/OpenNest.Posts.CincinnatiCIFiber/CIFiberProgramWriter.cs @@ -311,7 +311,7 @@ namespace OpenNest.Posts.CincinnatiCIFiber /// /// Cut-offs are open straight lines with no lead-in: the line is the - /// beam centreline (CutOffSettings clearance already allows for kerf) + /// beam centerline (CutOffSettings clearance already allows for kerf) /// and an open line has no inside/outside, so no G41/G42 is selected /// and the §13.2.4.1 linear-lead-in rule does not apply. The exterior /// lead layer still runs so the pierce sequence matches a perimeter. diff --git a/README.md b/README.md index 531f5897..318f9027 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A Windows desktop application for CNC nesting — imports DXF drawings, arranges - **Nesting** — automatic multi-plate/multi-material jobs, interlocking pair evaluation, and built-in or plug-in engines. [Choose an engine](docs/nesting-engines.md). - **Plate operations** — manual sheet cut-offs, [plate- or nest-wide automatic scrap cutoffs with a minimum tail-to-keep setting](docs/automatic-scrap-cutoffs.md), oversized-part splitting (straight, weld-gap tabs, spike-groove), interactive editing, and spacing-aware pushes that can slide along or away from touching parts. - **Visual overlap check** — highlight shared material on the active plate, rechecked automatically after edits, including containment and cutouts, with area shading, pair markers, and hover details through View > Overlap Check. [Usage and limitations](docs/geometry/visual-overlap-check.md). -- **Cut simulator** — Plate > Simulate Cutting replays the active plate in cut order: the torch traces each cut, rapid and pierce at adjustable feed, rapid and pierce settings, with play/pause, scrubbing, 1×–250× speed and previous/next part (Page Up/Down) and cutout (Ctrl+Left/Right) jumps. Parts the torch has not reached stay greyed. It and Calculate Cut Time use separate outside and hole feeds, skip etch-only contours like the CI Fiber post, and apply the chosen machine's acceleration and corner limits from Machine Configuration (placeholder values until you enter the controller's). [Timing model](docs/cut-time-estimates.md). +- **Cut simulator** — Plate > Simulate Cutting replays the active plate in cut order: the torch traces each cut, rapid and pierce at adjustable feed, rapid and pierce settings, with play/pause, scrubbing, 1×–250× speed and previous/next part (Page Up/Down) and cutout (Ctrl+Left/Right) jumps. Parts the torch has not reached stay grayed. It and Calculate Cut Time use separate outside and hole feeds, skip etch-only contours like the CI Fiber post, and apply the chosen machine's acceleration and corner limits from Machine Configuration (placeholder values until you enter the controller's). [Timing model](docs/cut-time-estimates.md). - **CNC output** — configurable lead-ins/outs and tabs, contour editing, user-defined G-code variables (`$name` → `#200+` machine variables), plugin post-processors (Cincinnati CL-707/800/900/940/CLX included). [Pre-post verification](docs/post-verification.md) checks overlaps, missing lead-ins, and rapid crossings, with explicit risk acknowledgment required to bypass warnings. ## Requirements diff --git a/docs/automatic-nesting.md b/docs/automatic-nesting.md index b2c62699..efe1a817 100644 --- a/docs/automatic-nesting.md +++ b/docs/automatic-nesting.md @@ -160,7 +160,7 @@ rail and puts every removed clamp back, whether removed by hand or by Auto Nest. When a part cannot be placed on an empty sheet of any offered size with every clamp in place - neither the selected engine nor the Irregular or Rectangles lane finds a clamped placement - Auto Nest takes the fewest clamps off one sheet -that let it fit (not necessarily neighbours: a notch may let a clamp between +that let it fit (not necessarily neighbors: a notch may let a clamp between them stay; the clamps nearest the origin on ties) and nests it on extra sheets with those clamps removed; other unplaced parts may share the freed sheets. It never removes a clamp to save material, never re-plans a sheet @@ -194,7 +194,7 @@ MCP `autonest_plate` requires an empty target. The stdio server serializes all t MCP `pack_plate` and `autonest_plate` report each requested drawing's newly placed count and remaining quantity, indexed by request; partial fulfillment is explicitly warned about. Per-sheet ratios are not enforced or required: an uneven sheet is acceptable if the remaining quantities are placed elsewhere in the nest. These two plate tools operate on a single selected plate and do not automatically finish a multi-sheet job; callers can use `autonest_job` for that. Duplicate request tokens and ambiguous drawing names are refused before placement. A zero-quantity pack request places zero parts for that drawing; negative quantities are rejected. -`autonest_job(plateIndex, drawingNames, quantities, engine?, no_new_plates=false, sheets?)` is the whole-session completion path. Quantities are total targets across existing placed parts (physical plate quantity included) plus newly proposed sheets. Without `sheets`, the selected empty cutoff-free plate supplies stock size, spacing, quadrant, grain and cutting settings; other empty plates with equivalent persisted settings may be reused first, then additional matching plates are created as needed. `no_new_plates=true` caps physical stock by the number of existing matching empty plates, not the number of grouped output layouts or their old repeat quantities. Exact repeats still attach once with their total quantity; redundant empty entries remain unchanged and are normally omitted on save. Empty entries consumed by those physical copies are reserved by their populated layout in the live MCP session and cannot be offered again or filled by another nesting tool while that owner remains populated. Clearing or removing the owner (including replacement by `load_nest`) releases only its surviving placeholders; clearing or deleting a placeholder does not release the owner's other copies or another layout's reservations. Genuinely unused entries remain available. No automatic deletion of user plates occurs. No new layout entries are created in this mode. The request uses the independently validated `NestPipeline` and commits only when every requested quantity is met; invalid, incomplete, cancelled or unknown-engine proposals leave existing plates and counts unchanged. A no-placement solver result is not proof that geometry cannot fit. `pack_plate` and `autonest_plate` remain single-sheet operations. +`autonest_job(plateIndex, drawingNames, quantities, engine?, no_new_plates=false, sheets?)` is the whole-session completion path. Quantities are total targets across existing placed parts (physical plate quantity included) plus newly proposed sheets. Without `sheets`, the selected empty cutoff-free plate supplies stock size, spacing, quadrant, grain and cutting settings; other empty plates with equivalent persisted settings may be reused first, then additional matching plates are created as needed. `no_new_plates=true` caps physical stock by the number of existing matching empty plates, not the number of grouped output layouts or their old repeat quantities. Exact repeats still attach once with their total quantity; redundant empty entries remain unchanged and are normally omitted on save. Empty entries consumed by those physical copies are reserved by their populated layout in the live MCP session and cannot be offered again or filled by another nesting tool while that owner remains populated. Clearing or removing the owner (including replacement by `load_nest`) releases only its surviving placeholders; clearing or deleting a placeholder does not release the owner's other copies or another layout's reservations. Genuinely unused entries remain available. No automatic deletion of user plates occurs. No new layout entries are created in this mode. The request uses the independently validated `NestPipeline` and commits only when every requested quantity is met; invalid, incomplete, canceled or unknown-engine proposals leave existing plates and counts unchanged. A no-placement solver result is not proof that geometry cannot fit. `pack_plate` and `autonest_plate` remain single-sheet operations. For finite mixed-size inventory, supply `sheets` as an array, for example `{"plateIndex":0,"drawingNames":"large,small","quantities":"1,1","engine":"Rectangles","sheets":[{"width":60,"length":120,"quantity":1},{"width":48,"length":96,"quantity":2}]}`. Width and length have the same units and orientation as `create_plate`. Every row's positive integer `quantity` is the total physical sheets available for this solve, including any compatible pre-created empty plates; it is never a `Plate.Quantity` repeat multiplier or additional stock. The selected plate supplies common spacing, edge spacing, quadrant, grain and cutting settings, but is reused only if its size matches a chosen sheet. Other compatible empty sheets can be reused; occupied or cutoff-bearing sheets cannot. Only needed different-sized sheets are created. Duplicate size pairs, nonpositive or nonfinite dimensions, unusable work areas, nonpositive quantities, an empty list and excessive total inventory are refused before solving. `sheets` cannot be combined with `no_new_plates=true`. Omit `sheets` to retain the previous single-size behavior. Successful output reports `stock-0`, `stock-1`, etc. in input order with physical used/remaining counts, reused/created layout counts, plus committed session layout index to stock ID and per-drawing totals. Stock is request-local, not a persistent purchasing catalog. Unused empty templates may be omitted by the `.nest` writer on save. @@ -278,7 +278,7 @@ not previously occupied session sheets, and exclude penalties for unplaced deman Invalid API proposals have no cost summary. Overflow fails instead of becoming a score. An accepted MCP solve stores requested drawing quantities and offered stock prices; -save/reopen preserves them and existing nest metadata. Rejected/cancelled proposals +save/reopen preserves them and existing nest metadata. Rejected/canceled proposals change neither requirements nor options. Inventory remains request-local; saved options are offers, not a per-sheet purchase ledger. These are cost-aware heuristics, not global cost optimizers; validation and fulfillment remain required. @@ -373,7 +373,7 @@ plate on a ledger row that row's next item codes, in nest plate order, one per s the plate's quantity (a bundle repeats its code). It reads each sheet's stock from `NestPipelineCommit.PairWithStock`; a sheet Auto Nest solved with clamps removed takes its base row's codes. Plates committed on hand-typed stock get none, and a discarded, -rejected or cancelled result changes no codes. The plate keeps them as +rejected or canceled result changes no codes. The plate keeps them as `Plate.StockItemCodes` (saved in the nest, see the [nest file format](nest-file-format.md)), and `/api/nests/{id}/sheets` reports them per plate so MaterialLedger can hold those exact items. The plate list's tooltip shows "Stock: CODE (location)"; the location comes from diff --git a/docs/automatic-scrap-cutoffs.md b/docs/automatic-scrap-cutoffs.md index 2d2a96ac..cb6f6991 100644 --- a/docs/automatic-scrap-cutoffs.md +++ b/docs/automatic-scrap-cutoffs.md @@ -12,7 +12,7 @@ Finish nesting, then choose **Nest > Automatic Scrap Cutoffs (All Plates)** to p For the Nest command, the on-sheet overlay and upper measurements show the active plate; a per-plate table lists each plate's proposed cut-off count, occupied and used spans, retained tail, and readiness (Ready, Blocked, or No change), while the details list reports only issues and notices, each prefixed with its plate number. Each plate uses its own dimensions, quadrant and part spacing with the dialog's common spacing/minimum-strip/minimum-tail settings and current cutoff clearance/direction settings. No plate navigation or per-plate confirmation is required. Empty or unchanged plates are left untouched. A blocking conflict or invalid plate prevents changes to **all** plates, with the plate number reported; resolve it before retrying. If application fails after changes begin, all touched plates' original cutoff programs and sequence are restored. An explicit incomplete-recovery warning requires manual review before saving or cutting. -An empty sheet is left untouched. Invalid input or out-of-sheet part geometry prevents automatic planning. Excessively small spacing is rejected rather than allocating an unbounded number of cuts. Small bounded discrepancies between converted material and cached bounds—including amplified roundoff in fitted near-tangent arcs—are accepted without changing the part or its program. That allowance is absolute (10⁻¹⁰ model units), not a count of floating-point steps, so it does not shrink for parts near the origin: an arc whose end radius differs from its start radius by less than `Tolerance.Epsilon` is converted without refitting its centre, and rotated imported arcs can then rebuild a start point ~5 × 10⁻¹¹ outside the cached bounds. The same conservative numerical padding applies to cutoff pruning and exclusions. Their broad-phase envelope uses the farther edge of the cached box and converted perimeter; a cutoff within the narrow uncertainty band at a cached edge gets a full-envelope exclusion instead of relying on a near-tangent contour intersection. Elsewhere the contour is retained for precise trimming. Larger arc-center discrepancies still prevent automatic planning rather than risking a cut through material; repair the geometry before retrying. +An empty sheet is left untouched. Invalid input or out-of-sheet part geometry prevents automatic planning. Excessively small spacing is rejected rather than allocating an unbounded number of cuts. Small bounded discrepancies between converted material and cached bounds—including amplified roundoff in fitted near-tangent arcs—are accepted without changing the part or its program. That allowance is absolute (10⁻¹⁰ model units), not a count of floating-point steps, so it does not shrink for parts near the origin: an arc whose end radius differs from its start radius by less than `Tolerance.Epsilon` is converted without refitting its center, and rotated imported arcs can then rebuild a start point ~5 × 10⁻¹¹ outside the cached bounds. The same conservative numerical padding applies to cutoff pruning and exclusions. Their broad-phase envelope uses the farther edge of the cached box and converted perimeter; a cutoff within the narrow uncertainty band at a cached edge gets a full-envelope exclusion instead of relying on a near-tangent contour intersection. Elsewhere the contour is retained for precise trimming. Larger arc-center discrepancies still prevent automatic planning rather than risking a cut through material; repair the geometry before retrying. ## Preserving the unused tail @@ -34,7 +34,7 @@ When the parts leave an unused band beyond them along Y (away from the origin), - The desktop dialog and Plan Cutting's `Add scrap cut-offs` also propose a new full-length horizontal separator beyond the parts, at the same margin as the X tail separator, when the band is at least **Minimum tail to keep** wide and its area beats the X tail it competes with. The vertical lines then stop at it. API callers opt in with `AutomaticCutOffOptions.KeepHorizontalRemnant`; without it they get full-width lines unless a horizontal cut-off already exists. - Beside a kept band, the X tail becomes a corner piece. Its separator stops at the band too, and it is kept only when both its length and the distance to the band are at least the minimum; otherwise the strip lines continue to the sheet end. -For a 96-by-48-inch sheet with parts through Y 23 and a horizontal cut-off at Y 23.57, the 35-inch strip lines (shifted as usual) cut from Y 0 to 23.57 and the 24.43-inch band stays whole. Rerunning recognises the stopped lines as existing. A new separator is not proposed when it would cross an active clamp or a same-line manual cut with other limits, or when its program is not one uninterrupted cut; the details list reports `NoSafeHorizontalSeparator`, and the lines cross the full width. A `HorizontalRemnant` notice reports the separator's Y and the band width. The separator splits the sheet, so [Part sequencing](#part-sequencing) cuts it last. +For a 96-by-48-inch sheet with parts through Y 23 and a horizontal cut-off at Y 23.57, the 35-inch strip lines (shifted as usual) cut from Y 0 to 23.57 and the 24.43-inch band stays whole. Rerunning recognizes the stopped lines as existing. A new separator is not proposed when it would cross an active clamp or a same-line manual cut with other limits, or when its program is not one uninterrupted cut; the details list reports `NoSafeHorizontalSeparator`, and the lines cross the full width. A `HorizontalRemnant` notice reports the separator's Y and the band width. The separator splits the sheet, so [Part sequencing](#part-sequencing) cuts it last. ## Shifting strip lines @@ -106,7 +106,7 @@ Saving `.nest` retains ordinary cutoff positions, axes, limits, head-locked over **Sheet Cut-Off** stops a new line at the first crossing cut-off from its start edge: the origin side, or the far edge when the cut direction is `TowardOrigin`, in any plate quadrant. Clicking past that crossing still draws the line from the start edge, as the preview shows. The line runs full length when nothing crosses it or what remains would be shorter than the minimum segment length. Tab switches to full-length lines and back, and the choice lasts until the nest is closed. Only the new line's limits are set (`CutOffTrim.StopAtFirstCrossing`); existing lines are not changed. A head-locked line stopped short of the far edge loses its overcut, and the status bar says so. **Plate > Trim/Extend Cut-Off** (and the toolbar button beside **Sheet Cut-Off**) edits a cut-off against the cut-offs that cross it, AutoCAD-style. Tab switches between Trim and Extend; Esc finishes. The edits change only the cut-off's start and end limits and its gaps (`CutOff.Gaps`; `CutOffTrim` in Core), and Plan Cutting sees them like any other definition change. -- **Trim**: click the piece to remove. The crossing cut-offs on either side of the click (or a gap or the line's end, where there is no crossing on that side) bound the piece. Every trim stops on a crossing line's centre, where half the crossing cut's kerf still overlaps the trimmed end. An end piece moves that end's limit, past any gap it borders. A piece between two crossing lines becomes a gap from one centre to the other, merged with any gap it touches: the line then splits into segments exactly as it does around a part, and each segment takes its own place in the cut sequence. A crossing line counts when one of its cut pieces reaches the target, including a line that stops on it. +- **Trim**: click the piece to remove. The crossing cut-offs on either side of the click (or a gap or the line's end, where there is no crossing on that side) bound the piece. Every trim stops on a crossing line's center, where half the crossing cut's kerf still overlaps the trimmed end. An end piece moves that end's limit, past any gap it borders. A piece between two crossing lines becomes a gap from one center to the other, merged with any gap it touches: the line then splits into segments exactly as it does around a part, and each segment takes its own place in the cut sequence. A crossing line counts when one of its cut pieces reaches the target, including a line that stops on it. - **Extend**: click near an end to grow. An end bordering a gap closes that gap (one click removes the whole gap). The line's own end runs to the next crossing cut-off beyond it, skipping one sitting at the current end (click again to go one more step), or to the sheet edge, which clears the limit so the usual overtravel or head-locked overcut applies again. - **Swap Through-Cut**: right-click where two cut-offs meet, one running through and the other stopping at it. The stopped one extends past the junction as Extend does, and the through one is trimmed there, losing the side away from the plate's origin (and any gaps on it), since only the origin-side edge is certain. On a 96 x 48 sheet whose verticals stop at a full-length horizontal separator, swapping at the last vertical leaves that vertical splitting the sheet and keeps the area beyond it whole. A junction a gap touches is not offered, and a swap there is refused: close the gap first. diff --git a/docs/breakoffs.md b/docs/breakoffs.md index 03ab4201..050fb4c4 100644 --- a/docs/breakoffs.md +++ b/docs/breakoffs.md @@ -29,7 +29,7 @@ against the entities being cut: short connecting line is added between arcs), because the planner closes contours within 1e-6 and the program is re-chained from any entity. - The joining line between consecutive tabs becomes open cuts on the `Break` layer - (`LayerType.Break`, `SpecialLayers.Break`), each travelling with the scrap on its + (`LayerType.Break`, `SpecialLayers.Break`), each traveling with the scrap on its left. The joining line itself is not cut at the tabs; end tabs keep cuts off the outline. diff --git a/docs/cincinnati-ci-fiber-post-output.md b/docs/cincinnati-ci-fiber-post-output.md index 81692776..049b1d65 100644 --- a/docs/cincinnati-ci-fiber-post-output.md +++ b/docs/cincinnati-ci-fiber-post-output.md @@ -44,7 +44,7 @@ uses the Cincinnati machine-sample convention, not a generic TF5200 laser API: the parts. Each segment is an open line with no lead-in: rapid to its start, `/L "L4"`, `/L "L6"`, the `G1`, and `/L "ZHSOFF"`. No `G41`/`G42` is selected, because the line is the beam - centreline and has no inside or outside. Whether the `L4` macro runs + centerline and has no inside or outside. Whether the `L4` macro runs correctly without a following lead-in move has not been confirmed on the machine. - A head-locked cut-off overcut (see diff --git a/docs/cutting-planner.md b/docs/cutting-planner.md index d3099e75..c2455250 100644 --- a/docs/cutting-planner.md +++ b/docs/cutting-planner.md @@ -91,7 +91,7 @@ straight move and cuts the arc as drawn, rather than starting the arc off its ow such bridge, since a lead-in must join the contour itself. Native intersections, executed-motion checks and pre-post verification retain their existing tolerances. -Arcs of one circle whose centres were each derived from their own endpoints agree only +Arcs of one circle whose centers were each derived from their own endpoints agree only within the 1e-8 support tolerance, not bit for bit. Their spans are compared at the 1e-6 seam tolerance: arcs that share a span still refuse as overlap, while arcs that only meet at a joint, or lie apart on the circle (a notched ring), do not. @@ -125,7 +125,7 @@ the final replay enforce them: when its placed program is one continuous straight cut on its own line spanning the sheet from edge to edge (`CutOff.SeparatesSheet`). A line trimmed around parts, limited short of an edge, on the sheet edge, stale after a move or in an - unrecognised program form does not qualify and keeps the crossing rule above. + unrecognized program form does not qualify and keeps the crossing rule above. Being continuous, a separating line passes through no part. A kept order that cuts it earlier is a constraint conflict naming the separating cutoff. - A drawing's break cuts (`LayerType.Break`, see [breakoffs](breakoffs.md)) are open @@ -160,7 +160,7 @@ revisit an earlier entry when a later part cannot be reached safely. For multi-p requests containing regenerated holes, it first tries one ranked hole chain for each outside endpoint. This lets a later blocked approach change the previous part's departure without first exhausting combinations of its earlier holes. -This preferred pass uses the hole centres to propose an order and checks only the +This preferred pass uses the hole centers to propose an order and checks only the one previously lead-feasible entry selected for each hole; it does not prepare alternative entries until a subsequent recovery/full pass needs them. It still checks emitted motions under the shared expansion budget and stall limit, and @@ -196,12 +196,12 @@ cutoff segments that must precede some part are left out of the search: the part planned as if the segments were not there, so a plate's route does not change because strip lines were added, and the segments are placed into that plan afterwards (see [cutoff segments](#cutoff-segments) below). The order is an open -travelling-salesman path over part centres from the start point: nearest neighbour, +traveling-salesman path over part centers from the start point: nearest neighbor, then 2-opt reversals and Or-opt moves of one to three parts, never placing a part before a cutoff or nested-part prerequisite. A part with other parts nested in its cutouts (a host) is cut after all of them, so the tool reaches it from whichever was cut last, and from the middle of a crowded cutout every straight approach crosses a -finished neighbour. The nested parts of each host are therefore toured as one run, +finished neighbor. The nested parts of each host are therefore toured as one run, immediately before the host, ending beside the point of the host's contours nearest the tool position at the start of the run; nested hosts apply the same rule inside the run. Host groups follow the parts beside them, because a finished host is a large @@ -209,8 +209,8 @@ obstacle that can only be left across its own outside edge. Learned rules win ov both: a rule between parts of two groups orders the groups, and rules that cannot keep a group whole fall back to the plain tour. Plates without nested parts get the plain tour unchanged, except a large grid: a plate of at least 200 parts with no -cutoffs or prerequisites, whose part centres bin into rows by Y and columns by X -within a quarter of the smallest part extent (every gap between neighbouring bins +cutoffs or prerequisites, whose part centers bin into rows by Y and columns by X +within a quarter of the smallest part extent (every gap between neighboring bins wider than that, no two parts in one cell, at least a quarter of the cells filled, as interleaved rows fill half), is toured as a serpentine: line by line, alternating direction, along whichever axis and from whichever corner gives the shortest route @@ -239,7 +239,7 @@ separator teaches its other-way-round rule at once. A rule that would contradict "Cut before" rules are a heuristic (a part blocked straight after another may be reachable via a third), so once nothing new can be learned the remaining budget first tries sequence-free recovery, visiting dependency-ready parts lazily by -material-centre distance. When a branch stalls, it disposes the deeper search +material-center distance. When a branch stalls, it disposes the deeper search frames and resumes alternatives at the root instead of spending the remainder on that branch's completed prefix. The retained full search runs after it. Each of these two passes, and the full pass along a kept order, is held to two stalls' worth @@ -286,7 +286,7 @@ routes the plan had, and replays Ready again. Candidates use native closest points, vertices, midpoints and circle angles in stable order. `maxEntries` caps the normal ranked shortlist, not the recovery -catalogue: recovery may inspect the remaining finite native entries, with every +catalog: recovery may inspect the remaining finite native entries, with every precheck and visited transition charged to the same expansion budget. Circle rounding, clamping, corner resolution and tab trimming happen during emission. Validation uses the actual emitted @@ -344,7 +344,7 @@ tangent arc at a shared vertex, such as a fillet, is an ordinary joint: an exact contact that the native query rounds away is not uncertain at a line endpoint the other curve already touches, while a contact anywhere else on the line still refuses. -Source parts rank by modeled travel (material-centre distance at a holed-part +Source parts rank by modeled travel (material-center distance at a holed-part boundary); within a part, preferred contour order and facing-entry rank precede travel. Ties use stable source/contour/entry ordinals. Hash values and drawing names are not tie breakers. @@ -354,12 +354,12 @@ search generates and checks contour alternatives on demand in contour/entry rank order. It does not emit every sibling before trying the first. Backtracking still visits the remaining alternatives when needed; none is pruned. The retained full whole-part fallback still evaluates all ready sources before ranking their travel distances; -sequence-free recovery instead uses lazy centre-distance order. +sequence-free recovery instead uses lazy center-distance order. The expansion budget counts evaluated candidates and frontier ranking, including rejections, before emission; it is not a wall-clock timeout. An unvisited sibling consumes no additional DFS-prefix emission work or per-sibling expansion charge; -entry-catalogue prechecks still emit isolated contours and consume budget. +entry-catalog prechecks still emit isolated contours and consume budget. Consequently a bounded search can reach a different frontier and report different rejected approaches than eager expansion did. All visited candidates retain their lead/rapid checks, and a selected @@ -369,11 +369,11 @@ a refusal, not an unranked fallback or proof of geometric impossibility. ## Automatic outside entries and look-ahead An unlocked part's outside entry is chosen automatically toward the NEXT cut: the ranker orders the native candidate -catalogue by the facing side(s) of the next part's placed-material centre, and +catalog by the facing side(s) of the next part's placed-material center, and the shared lead validator certifies each emitted lead lazily until up to `maxEntries` feasible candidates remain. At caps of four or more, a corrective scan reconsiders memoized clear candidates for each missing side before evaluating -more of the catalogue; a later side cannot lose a usable point merely because +more of the catalog; a later side cannot lose a usable point merely because an earlier side's scan passed it. Replacements preserve other covered sides and global rank, never exceed the cap, and stop evaluating the tail once coverage settles. Smaller caps retain rank priority rather than promising all-side coverage. @@ -383,14 +383,14 @@ candidate on its selected entity when a joined contour has an accepted rounding no entry-membership or lead-clearance tolerance is widened. With no lead-out the tool leaves a part from its outside entry. An entry inside a slot -or pocket can only be left back over the part just cut, so within the ranked catalogue +or pocket can only be left back over the part just cut, so within the ranked catalog entries are ordered by how many straight sight lines to the next cut clear the part's own perimeter: the look-ahead point and, for an ordinary next part, the four corners of its cut extent. This is a stable reordering before the lead checks; no entry is dropped, and every emitted rapid is still checked. When the next cut is the host whose cutout the part sits in, the look-ahead point is -the nearest point of the host's own contours, not its centre (which lies in the middle +the nearest point of the host's own contours, not its center (which lies in the middle of the cutout, among the other nested parts). The next cut is the next unfinished part in a supplied order — recomputed @@ -403,17 +403,17 @@ Uncertain (numerically incomplete) validator answers are not geometric refusals: those candidates can fill remaining retained slots for emitted-prefix checking and complete replay. The normal ranked entry count stays within `maxEntries`; directed recovery can inspect additional native entries as described above. A -part/contour with no fitting lead in its fully evaluated catalogue is reported +part/contour with no fitting lead in its fully evaluated catalog is reported as "No tested lead-in fits on part N, contour M"; budget exhaustion stays a budget finding and incomplete checks are never presented as geometric impossibility. Lead prechecks are reported separately and their requests also consume the shared expansion budget before native work. For a holed part, the search chooses an outside endpoint before cutting any hole. -Each endpoint branch builds an open hole-centre route from the original arrival to -that endpoint, using bounded nearest-neighbour, 2-opt and Or-opt improvement. +Each endpoint branch builds an open hole-center route from the original arrival to +that endpoint, using bounded nearest-neighbor, 2-opt and Or-opt improvement. A cutout that contains the arrival point (the tool comes from a part nested in it) is -routed from the arrival point itself, not its centre, so it is cut first, before a +routed from the arrival point itself, not its center, so it is cut first, before a later hop to it would have to cross the other parts nested there. On a part with at least 64 contours, a middle step of that route (neither the first contour, which also cuts the part's scribes and open cuts, nor the last) checks only the @@ -489,7 +489,7 @@ on its own fresh replay: that is an ordinary replayed `Ready` proposal. geometry, empty input, invalid eligibility or nonpositive bounds. - `NoSolutionWithinBudget`: the bounded/capped search found no complete proposal; it does not prove no possible geometric route exists. -- `Cancelled`: capture, search or replay cancelled without live mutation. +- `Canceled`: capture, search or replay canceled without live mutation. Malformed original executed graphs are refused, not salvaged. Valid but incomplete old programs can regenerate from clean geometry. Regenerated programs retain genuine @@ -539,7 +539,7 @@ plate's settings. Capture resolves each regenerated part's pins against its own clean contours with `CutPinResolver` and prepares them with `PreparedContours.Capture(program, parameters, pins)`: -- A pinned contour has exactly one entry, the pin's; every candidate catalogue returns it +- A pinned contour has exactly one entry, the pin's; every candidate catalog returns it alone and emission refuses any other entry for that contour, so the search can never move it. It is emitted through the same emitter with the pin's own lead-in and lead-out for every contour type, the pin's tab (or none) and angle rounding off; the emitter's own @@ -551,7 +551,7 @@ clean contours with `CutPinResolver` and prepares them with contour with another pin, or cannot be placed on the program leaves its contour automatic and adds a `FixedLead` warning naming the pin (`FixedLeadWarning.PinNumber`), for example "Drawing pin 2 no longer matches the geometry; planned with nest settings.", which makes the - plate UNVERIFIED. A tab pinned on an internal contour is not honoured either: only the + plate UNVERIFIED. A tab pinned on an internal contour is not honored either: only the outside is tabbed. - A pinned contour's lead-in, cut, lead-out and tab are a fixed emission like a locked program (see [fixed emissions](#fixed-emissions-warn)): a pinned lead that meets another part's @@ -692,7 +692,7 @@ panel is wired in the editor. Non-editor callers still use the shared analyzer. missing-lead warning remains available for operator review; a ready plan does not waive posting checks. When a lead hits another part, the finding suggests more spacing or a shorter lead; - when no tested entry fits, it suggests reducing lead-in length and, if neighbours + when no tested entry fits, it suggests reducing lead-in length and, if neighbors obstruct it, spacing the parts farther apart. These are suggestions, not guaranteed fixes: replanning runs the same strict checks; an unverified fallback requires separate warning acceptance and is not approval to post or cut. @@ -748,7 +748,7 @@ panel is wired in the editor. Non-editor callers still use the shared analyzer. editor numbers them. The panel shows the selected plate detached from the nest (quantity zero, so drawing quantities do not change) in the proposed order with the proposed programs. Ready and best-effort proposals can be previewed only while the plate still - matches capture. Best-effort previews are labelled `UNVERIFIED`. Refused program graphs + matches capture. Best-effort previews are labeled `UNVERIFIED`. Refused program graphs are never copied, and changed plates require replanning. - Apply requires usable output for every plate and remains all or nothing. The outcome line counts best-effort proposals as usable when reporting how many plates block Apply; @@ -761,7 +761,7 @@ panel is wired in the editor. Non-editor callers still use the shared analyzer. Both use the same owned-program, freshness and rollback boundary. After it applies, each plate keeps its own copy of the confirmed settings, which also become the saved defaults. `Stale` keeps the panel open and asks for a replan; nothing changes. -- Closing or cancelling while planning cancels the worker and keeps the panel locked until +- Closing or canceling while planning cancels the worker and keeps the panel locked until it stops. Planning and Apply refuse to start while a nesting or plate operation runs. The panel plans with its own copy of the settings, and posts progress and results to the thread it was created on rather than to whichever context is current. @@ -780,7 +780,7 @@ or numerically uncertain material boundaries need not prevent lead-in generation closed executable contours are readable. The fallback reuses the existing contour emitter: internal contours first, the largest bounding perimeter last, nearest entry from the preceding departure, with the confirmed lead styles. The internal contours follow the same open -nearest-neighbour + 2-opt/Or-opt tour over hole centres that the strict search proposes, not +nearest-neighbor + 2-opt/Or-opt tour over hole centers that the strict search proposes, not source order, so their rapids do not cross each other. It retains source part order except to satisfy proven cutoff and nested-part prerequisites. `Keep the current part order` still refuses an order that contradicts a proven prerequisite. Uncertain containment is named as a warning. @@ -863,7 +863,7 @@ plates' own saved settings, which must be identical across the plates in scope. sheet `--autonest` added) after filling and before saving or posting; `--no-fill` plans a loaded `.nest` as it is, and `--all-plates` widens the scope to every occupied plate. `--cutting-params ` supplies settings and `--keep-part-order` fixes whole-part order. - A blocked or cancelled plan exits 2 and saves or posts nothing. An unverified plan is + A blocked or canceled plan exits 2 and saves or posts nothing. An unverified plan is applied only with `--accept-unverified-plan` for that invocation; posting still runs its own verification and needs `--acknowledge-post-risks` separately. - MCP: `plan_cutting(plateIndex = -1, keepPartOrder, cuttingParametersPath)` reports the diff --git a/docs/geometry/expand-spacing.md b/docs/geometry/expand-spacing.md index 335c43eb..63f5c47e 100644 --- a/docs/geometry/expand-spacing.md +++ b/docs/geometry/expand-spacing.md @@ -6,6 +6,6 @@ Every selected/selected and selected/nonselected pair has an operation-entry cle Probes run on scratch poses. Each trial translation is clipped against blocking material along its entire straight path, including cutout walls and regenerated open cut-off paths; a remote cut-off does not pin an unrelated move. Entry floors for open cut-offs use nearest points on every native segment, not a program endpoint or a fictional closing chord. Open paths that strictly enter part material stay as violations even at zero target; boundary contact and paths wholly inside holes remain legal. An open path's broad box is not a blocker when its real segments miss the part. Initially overlapping convex line profiles and complete native disks can take a certified direct separating path, including a safe partial move when the plate edge prevents a full exit; unsupported or ambiguous overlap paths stay put and remain reported. Complete native disks use analytic clearance rather than interpreting a shallow arc overlap as a positive polygon gap. For other curved pairs, a polygon gap inside the combined 0.002-unit chord band is uncertain and conservatively reported as a violation rather than proof of clear material. When a part touches a cutout wall and the usual nearest-boundary direction makes no safe progress, the tool tries the opposite direction through the same checks. Tiny clamp keep-outs use tolerance-free material occupancy and a conservative native-bound motion limit when tolerant geometry cannot certify them. Cancellation before application leaves the live layout unchanged; `Separate` never changes it. A bounded search reports the spacing it found, not an optimum. See [directional slides](directional-slides.md) for directional contact behavior. -## Cancelling a long search +## Canceling a long search -On a complex layout the search can run for minutes. The desktop command runs it on a worker thread; if it is still running after about 0.3 seconds, a small Expand Spacing window opens with an elapsed time and a Cancel button, and the rest of the application waits behind it. Cancel, Escape and the window's close box all request cancellation. The window then shows "Cancelling..." and stays open until the search stops at its next pair check, which took under 0.3 seconds on the real jobs measured. A cancelled search moves no part, and the status bar reads "Expand Spacing cancelled - no parts were moved". A search that finishes before the cancellation takes effect applies its result normally. While Auto Nest or a fill is still running on the nest, the command refuses with "Finish or cancel the current nesting or fill before Expand Spacing." because those operations can still add parts to the plate the search reads. The command does not save automatically. +On a complex layout the search can run for minutes. The desktop command runs it on a worker thread; if it is still running after about 0.3 seconds, a small Expand Spacing window opens with an elapsed time and a Cancel button, and the rest of the application waits behind it. Cancel, Escape and the window's close box all request cancellation. The window then shows "Canceling..." and stays open until the search stops at its next pair check, which took under 0.3 seconds on the real jobs measured. A canceled search moves no part, and the status bar reads "Expand Spacing canceled - no parts were moved". A search that finishes before the cancellation takes effect applies its result normally. While Auto Nest or a fill is still running on the nest, the command refuses with "Finish or cancel the current nesting or fill before Expand Spacing." because those operations can still add parts to the plate the search reads. The command does not save automatically. diff --git a/docs/geometry/lead-in-placement.md b/docs/geometry/lead-in-placement.md index ac5e24c7..8ba50c9a 100644 --- a/docs/geometry/lead-in-placement.md +++ b/docs/geometry/lead-in-placement.md @@ -99,13 +99,13 @@ Plan Cutting has tried every entry of a cutout and none fits, it erodes the cuto joins and Clipper rounding. Shallower levels, down to half that depth, back it up. 3. Each of the cutout's ranked entries gets the nearest point of the deepest level that reaches the wall beside it: a letter stroke narrower than the cutout's widest place is still pierced - on its own centre line next to the entry, so the route can enter and leave a letter where it + on its own center line next to the entry, so the route can enter and leave a letter where it needs to. 4. The lead-in runs straight from the pierce to that entry, or else to the cutout's native point closest to the pierce (`PreparedContours.ErodedPierceEntries`, a `ContourChoice` whose `Pierce` is set). A cutout so pierced has no lead-out: a feature too small for its lead-in has no room for one either. -5. A cutout too small to erode is pierced at its pole, and a round hole at its centre. +5. A cutout too small to erode is pierced at its pole, and a round hole at its center. 6. `LeadPathValidator` checks each candidate like any other planner-chosen entry, pierce zone included. When none is clear, the "No tested lead-in fits" finding says why. @@ -130,16 +130,16 @@ ordinary search may have spent all of its share on the outside entries. A lead t can check clear alone and still touch in the whole part, where rounding moves it by about 1e-15: a widened try drops such an entry and repeats that outside entry instead of rebuilding the chain. -## Leads stop at the centre line +## Leads stop at the center line -In a cut Plan Cutting chooses, a lead-in stays out of the far half of a small feature. The centre +In a cut Plan Cutting chooses, a lead-in stays out of the far half of a small feature. The center line is where the walls meet as the cutout erodes: straight in from an entry, the distance to the wall grows steadily until a second wall is as near, then levels off along a stroke or falls -(`ContourCuttingStrategy.StopAtCentreLine`). +(`ContourCuttingStrategy.StopAtCenterLine`). A lead longer than that depth, or one whose own line gets closer to a wall again, becomes a straight -lead normal to the wall (the bisector at a corner). It runs from the centre line, or from the lead's -own length in when that comes first; a round hole's centre is its centre line. So a round hole +lead normal to the wall (the bisector at a corner). It runs from the center line, or from the lead's +own length in when that comes first; a round hole's center is its center line. So a round hole smaller than its lead is pierced in the middle, at any approach angle, and a letter stroke at a shallow approach angle gets a short lead across the stroke instead of a full one along it. @@ -158,7 +158,7 @@ unchanged/fallback behavior. The perimeter tests cover every square corner under windings and a rotation, auto and manual placement from either edge, preview agreement, approach-angle handling, the flat-corner clearance fallback, reflex notches, and straight lead-outs. `ErodedPierceTests` covers the eroded pierces of a slot and a small round hole, leads stopped at a -centre line, a cutout that keeps its configured lead, the containment of text cutouts that sit a micro-inch apart and, with the +center line, a cutout that keeps its configured lead, the containment of text cutouts that sit a micro-inch apart and, with the optional `SmallFeatureLeadNestPath` input, a plate of stencil-text tags planned in reading order. `ArcLeadInTangentTests` checks curved-lead tangency, direction and sweep on perimeters and cutouts under both windings, and at every perimeter corner from diff --git a/docs/geometry/pierce-zone.md b/docs/geometry/pierce-zone.md index 9bc7b00a..ee92939f 100644 --- a/docs/geometry/pierce-zone.md +++ b/docs/geometry/pierce-zone.md @@ -24,13 +24,13 @@ clean material, so marks (scribes, rapids) are not material, and cutoffs are not emitter cuts, and for the manual lead-in preview: 1. A configured lead-in whose pierce already keeps the zone from the hole wall is kept as is. -2. Otherwise the pierce moves straight in from the wall to the hole's centre line, the centre of +2. Otherwise the pierce moves straight in from the wall to the hole's center line, the center of a round hole, or the lead's own length in when that comes first (see - [leads stop at the centre line](lead-in-placement.md#leads-stop-at-the-centre-line)). The lead + [leads stop at the center line](lead-in-placement.md#leads-stop-at-the-center-line)). The lead becomes a straight line from there to the entry. 3. If that point cannot keep the zone, the entry sits too close to another wall or the lead is shorter than the zone. The pierce moves toward the nearest eroded point beside the entry - (`ErodedPierce`), on the stroke's centre line when the lead reaches that far, else the hole's + (`ErodedPierce`), on the stroke's center line when the lead reaches that far, else the hole's pole of inaccessibility (`PolyLabel`). A lead shorter than the zone stops at the first point that keeps the zone: in a convex hole clearance grows steadily along that line, so this is the shortest clear straight lead from that entry. diff --git a/docs/geometry/visual-overlap-check.md b/docs/geometry/visual-overlap-check.md index 321d160e..9d64f7b4 100644 --- a/docs/geometry/visual-overlap-check.md +++ b/docs/geometry/visual-overlap-check.md @@ -198,7 +198,7 @@ but no crosshair. A clamp narrower than the 0.001 chord tolerance is judged tolerance-free against finely re-read material rather than by Clipper2. Any material entering it is reported, even below the area threshold. The finding's region is then the whole clamp -rectangle, and its centroid and marker are the clamp's centre: within half the +rectangle, and its centroid and marker are the clamp's center: within half the clamp's size (under 0.0005) of the material, though not necessarily on it. `PolygonAreaMoments` evaluates signed moments about local origins. The analyzer diff --git a/docs/irregular-stock.md b/docs/irregular-stock.md index e948fab2..eff7e57d 100644 --- a/docs/irregular-stock.md +++ b/docs/irregular-stock.md @@ -36,7 +36,7 @@ Drawing an outline in the plate view and taking the leftover of a cut plate are | Support bed | Unchanged: it is fixed to the machine and reports contacts under material | | Area, utilization, cost | `Plate.Area` and `NestPlateStock.Area` are the material area (outline less obstacles); area-based cost prices that area and utilization divides by it | | Salvage and remnants | No salvage credit and no `expectedRemnant`: no rectangular edge strip is guaranteed inside an outline | -| Manual cut-offs | A line is cut only where it crosses material: each crossing is a segment of its own, started at the material's edge and overtravelled past the far one, within the user's limits and the usual part clearance. The head-locked overcut applies only to a span that reaches the bounding box's far edge | +| Manual cut-offs | A line is cut only where it crosses material: each crossing is a segment of its own, started at the material's edge and overtraveled past the far one, within the user's limits and the usual part clearance. The head-locked overcut applies only to a span that reaches the bounding box's far edge | | Automatic cut-offs | Refused: `AutomaticCutOffPlanner` rejects an outlined plate ("Automatic cut-offs need a rectangular sheet") | | AutoSize, Snap to Standard Size | Leave an outlined plate unchanged: the outline is a particular piece of material | | Rotate 90/180 | Turn the outline with the sheet | diff --git a/docs/nest-storage.md b/docs/nest-storage.md index 46f6dd9e..704d418c 100644 --- a/docs/nest-storage.md +++ b/docs/nest-storage.md @@ -199,7 +199,7 @@ open holds with the sheets of the last open or save: the sum of plate quantities skipping the trailing empty plate as `/sheets` does. Proposed, Approved and AwaitingCloseout holds are open, the statuses ML counts against free stock. Released means the hold was let go, not sent to cutting, so it is listed but not counted, as -are closed, cancelled, exception and unknown statuses; unknown status strings are kept +are closed, canceled, exception and unknown statuses; unknown status strings are kept as sent. | Holds | Label | @@ -552,7 +552,7 @@ and **Releases...** for the selected set, then **Import BOM...** every active drawing (never filtered to a nest), searched, sorted and paged like the Drawing Library dialog. Select one or several and choose **Add to Set**, double-click or press Enter to add them at the entered **Qty per set**. - Drawings already in the set are greyed; one picked again is skipped and + Drawings already in the set are grayed; one picked again is skipped and named, so there is one member per drawing. Quantities are edited in the grid (1 to 100,000) and **Remove** drops a member. Members stay in the order they were added (and stored in that order); nothing a release @@ -589,7 +589,7 @@ Add to Release as its only buttons; File > Import BOM stays the familiar way in. the same material (ignoring case) and thickness are one drawing needing their total quantity, which becomes its quantity per set (`BomSetDrawings`). Rows with no file name, no drawing file or a quantity below 1, and files that fail - to import, are listed greyed and left out. Rows with no material or thickness + to import, are listed grayed and left out. Rows with no material or thickness are kept: the drawing is stored with a blank material and thickness 0, and the set editor's note column leads to Edit Drawing to fix it before Make Nests. 2. Each drawing is matched to the library (`OpenNest.Data.DrawingSetImport`) by @@ -616,7 +616,7 @@ Add to Release as its only buttons; File > Import BOM stays the familiar way in. against), and then the set editor opens with a new, unsaved set holding every imported drawing at its BOM quantity, named and with the customer as entered and notes naming the BOM file. The set is stored only by the editor's - **Save**; cancelling the editor leaves the confirmed library drawings and no + **Save**; canceling the editor leaves the confirmed library drawings and no set. A failed write stops the import, names what was already stored and leaves the set unchanged; Read BOM again then reuses those drawings, so importing twice never stores a drawing twice. @@ -961,7 +961,7 @@ it, and nothing is built or saved. without plates and a note, and the release goes on. A refusal or a download failure stops here, so nothing is uploaded. The factory may already have allocated nest numbers. -2. **Upload in order** under client-allocated ids, never cancelling an upload in +2. **Upload in order** under client-allocated ids, never canceling an upload in flight; cancellation is checked between uploads. A failed upload is checked by its id, so one stored before its reply was lost still counts as created. A merged draft is saved with the revision it was chosen at as `If-Match`; a diff --git a/docs/nesting-engines.md b/docs/nesting-engines.md index 37fa160c..6c0fec28 100644 --- a/docs/nesting-engines.md +++ b/docs/nesting-engines.md @@ -146,7 +146,7 @@ row along it, so it is a one-dimensional cut list. Each part's length is its mat the shortest rotation whose cross extent fits the bar's width; a part that fits no bar is unplaced. Lengths carry one part spacing each, like a saw kerf. -Parts with shaped ends nest into their neighbours. FlatBar measures each part's self-nesting +Parts with shaped ends nest into their neighbors. FlatBar measures each part's self-nesting gain once per stock by laying three copies the way the layout pass will and averaging the two joints (so a part that only nests every other copy is not over-credited), and packs each copy at its length less that gain; the first copy of each run pays the gain back. diff --git a/docs/performance/fill-verification.md b/docs/performance/fill-verification.md index beb74695..29a08f1e 100644 --- a/docs/performance/fill-verification.md +++ b/docs/performance/fill-verification.md @@ -23,7 +23,7 @@ keep their full-area behavior. This can change which private block candidate wins; it is not a promise of identical Irregular layouts. Verify fulfillment, bounds, spacing and rotation policy through -the full pipeline, rather than treating a faster cancelled run as acceptance. +the full pipeline, rather than treating a faster canceled run as acceptance. ```sh dotnet test OpenNest.Tests/OpenNest.Tests.csproj -c Release \ diff --git a/docs/performance/synthetic-nest-validity.md b/docs/performance/synthetic-nest-validity.md index 3017185e..bcf744a8 100644 --- a/docs/performance/synthetic-nest-validity.md +++ b/docs/performance/synthetic-nest-validity.md @@ -77,7 +77,7 @@ GitHub's cross-platform workflow runs both the checker tests and the six-fixture in a separate job, concurrently with four independent unit-suite jobs (main, Engine, IO and Server). Unit jobs retain the default Debug configuration and do not cancel siblings on failure. The final `tests` check requires the entire unit matrix and -synthetic job to succeed; failed, cancelled or skipped dependencies cannot produce +synthetic job to succeed; failed, canceled or skipped dependencies cannot produce a green final check. This preserves the existing check name without changing branch protection or removing tests. `python3 scripts/test_ci_results.py -v` exercises the same fail-closed aggregate command used by CI. The six-minute step limit and diff --git a/docs/post-verification.md b/docs/post-verification.md index ed5fb5d6..87169a81 100644 --- a/docs/post-verification.md +++ b/docs/post-verification.md @@ -153,7 +153,7 @@ they may form no loop, counting each closed contour with its leads as one point. an open end must also stay out of the gap beyond it: a lead-out never reaches ahead of the end it leaves, and a lead-in never behind the start it enters. Anything else (pieces that meet exactly, a lead that bridges or curls into a tab, cuts from edge to edge) is reported -as incomplete, needing manual review. Kerf, tab strength and other parts' cuts are not modelled. Plan +as incomplete, needing manual review. Kerf, tab strength and other parts' cuts are not modeled. Plan Cutting runs the same proof, so its own [tabbed cutouts](tabbed-cutouts.md) (pieces without lead-outs) pass, but keeps its stricter rule and does not certify its own tabs followed by a lead-out. A program that still has a tabbed cutout's `Tab` motions (never planned) is diff --git a/docs/support-tabs.md b/docs/support-tabs.md index 16cb0769..a6b007d3 100644 --- a/docs/support-tabs.md +++ b/docs/support-tabs.md @@ -89,7 +89,7 @@ tabbed perimeter (`PreparedContours.WithSupportTab`), using `TabConfig` for the other parts keep the plate settings, so supported parts are not tabbed. The emitter tabs a perimeter at its entry: the cut stops short of the entry by the tab size. -A support-tabbed perimeter's automatic entries are therefore limited to catalogue points the +A support-tabbed perimeter's automatic entries are therefore limited to catalog points the analysis accepts, plus the closest native point to its best tab point (`AutomaticEntryKind.SupportTab`, never on a reflex or cusp vertex). Ranking and lead checks are unchanged. @@ -118,7 +118,7 @@ hand-placed lead-ins and the pre-post review alike; a plate with a bed never use `SupportAnalyzer.AnalyzeWithoutBed` gives such a part a `PartSupport` with `HasBed` false: no contacts, never supported, and every tab clear of inside corners steadies it, so the perimeter's -automatic entries are every catalogue point clear of inside corners plus the best tab point, the +automatic entries are every catalog point clear of inside corners plus the best tab point, the clear outline point nearest the line through the center of gravity across the long side. Which of those wins is left to the usual ranking toward the next cut. @@ -126,10 +126,10 @@ With support tabs on, no bed and no range, nothing is tabbed and the plan carrie note saying so; its status is unchanged. If none of those entries has a lead-in that fits, the part is still tabbed. The search falls -back first to every catalogue entry clear of inside corners, then to every entry +back first to every catalog entry clear of inside corners, then to every entry (`SupportEntries`), each ordered by how well the tab steadies the part; of the entries whose lead-in fits, it keeps every one that holds the part level, or else only the steadiest. The -open-scrap pierce fallback then tries the last of those catalogues. +open-scrap pierce fallback then tries the last of those catalogs. A drawing pin on the perimeter wins: its entry, leads and tab are kept as pinned, and the analysis is only carried for review. Replay and best-effort plans (`SupportTabCapture.Review`) diff --git a/docs/undo-redo.md b/docs/undo-redo.md index 44399651..99b26adf 100644 --- a/docs/undo-redo.md +++ b/docs/undo-redo.md @@ -63,7 +63,7 @@ change.Complete(); ``` - Dispose after `Complete()` commits one history entry. A scope that never called - `MarkChanged()` records nothing, so a cancelled dialog or an edit that changed nothing does not + `MarkChanged()` records nothing, so a canceled dialog or an edit that changed nothing does not add an entry. - A scope disposed without `Complete()` (an exception, a cancellation) rolls a changed nest back to the last recorded state. @@ -82,7 +82,7 @@ change.Complete(); The window keeps a fingerprint (`NestFingerprint`: plate sizes and parts, poses, programs, cut-offs, drawings and required quantities, objects by reference) of the last recorded state. Before a scope opens and before Undo or Redo, a changed fingerprint means an edit bypassed -recording; it is committed as an entry labelled "Change", so it is never discarded. The +recording; it is committed as an entry labeled "Change", so it is never discarded. The fingerprint is a cheap hash, so this is best effort and no excuse to skip recording. In DEBUG builds an `Application.Idle` check writes a `Debug.WriteLine` warning when the nest changed outside a scope; watch the output window when adding an edit. @@ -98,7 +98,7 @@ outside a scope; watch the output window when adding an edit. `snapshot.Restore(live)` reads the copy and reuses each live `Drawing` whose saved content is unchanged (matched by `NestWriter.GetDrawingFingerprints`), so `BestFitCache`, -`FillResultCache`, colours and `Drawing.Id` survive. A changed drawing, a quantity edit +`FillResultCache`, colors and `Drawing.Id` survive. A changed drawing, a quantity edit included, comes from the copy. Restore then recomputes nested quantities. Never compare snapshots byte for byte to detect a change: two writes of one nest can differ in @@ -116,7 +116,7 @@ derived values (`expectedRemnant` around 1e-10). The scope's `MarkChanged` flag 5. Unbinds the old nest, replaces `Document.Nest` and binds the new one through the same path the constructor uses (`PlateManager`, sentinel, units, cut-off defaults, overlap check). 6. Regenerates each plate's cut-offs with `PlateView.CutOffSettings` (reading uses defaults) - and recolours drawings with the current scheme, as Open does. + and recolors drawings with the current scheme, as Open does. 7. Loads the same plate index (clamped), restores the viewport instead of zooming to fit, and reselects by part index when the plate's part count is unchanged. 8. Refreshes the plate list and header, then raises `NestRestored`; the main window closes a diff --git a/scripts/__pycache__/test_check_synthetic_nests.cpython-313.pyc b/scripts/__pycache__/test_check_synthetic_nests.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23a23960c8c8070f14fa42be7803123dbb477b01 GIT binary patch literal 15464 zcmd5@dvF`adA|b=PXZu85+p%O6hulQA@L!Zq9sbAWr+`ol1M2yQV)|70s==076{OL zfF&ZaYkSg~nl`cN#3j`_5tXPTx%JfY#BJy%jpcZ1t5eSuXHp?^R@-#ynO6OadSskv zI@5mN9_|2Apk%knOb;`A``*3XZ@>NhzFpk0+pP>d|M{<y*y8SF+>03wi^vw|t-unH9eMVyRD0xi8MAOW~Oy3q_p>Hd((sv%oqi-9r z@m#+pVpkjO*ZWqe{>6!sSmKx_Sl zzIE9-6@L(Nl`;amOfS6mm*_84TOh97b^7XZlya%1JWLr=$?&FfhBx=yeD(L|ZPF`o zq^#e~Tecl#m_Q-)-{#wVf8I)_DIMuyhIB(ZuQhq7HyVz6LV5%3HwA9n6K4XkX2(5?7OG~j90UnSZSe4CeFB8#Hdl{c8JCEXrSasO55`E^ZK-!y; z&b~Y~b(zvOH9hlIOGA&eUO;I_CWq?d^>t7`$VK&0T@>d*`_dukNhW2G@mji*MX?bfiff_{mrGq7eXyF0BSaVspGoEs zK}y6wqY!^M5DAB5Q!5FG zCxwul*O7pweJBzLV&G7K#Km;LK?6SF=>#+kiB^b*KJ<#&=(Vabb95FdPx& z!XEI&NPvvCg+VLCV`Nmegfy=;5DK+Mgg`VgBAbGWhoI=nTr@B&$Q+5q;<6sUg~QL4 z&Fx1IwYT=Px5(?wVjMn^#7>J|PUb`*GDucpEyj>A9EgTwBYc$*7e$m` z4?OYyKLAZkcQB zkQzH?8~6Uoq<8IOZyTA-ovh?;m@Jl7HB1@rnwXOE$l6_N{LH<*b(I-+NA1BC zOLdfy>L^&>T2jX2!yHQ<)KyPCDW_x%hn;9p2$?n8w?Q8R;967 z7uEObeVX3N^>n2j_Wa-tK()=-Hz$A3uA1vhlL+%8{|-lD*|>$qiT8#EDl= zOm(~ypKg1v^WDy?fp-tgZ0VF-`^GxvZH05T3dvS6Yx7Y53dy!&vS-#-`MHU4JU(Y{ z`MJI2o`_q=>$~i`9@W49sC74ETC@jRAd$+~KZEBr*du%}=1U)l&6de@avur=eR8Ms zEM`!puz^K@mYI1dqe+}n3%amZV2|k2M=>*cb4pRpoldP^d#C%2(&IIDQ<;#>y91#5 zKv)P$r&mV`;6)G(+{9JrHIrtHKxrUV;K+Fa5p-a@{pmy?BI_eUlz1@OqUbD`Nh(%v zuv9`s96*mE36)f}31=_52PFSgW^ZgYsw)a4=;wYD0YJbvI8p4an|ul zd}4Hb^kUoP;%$t|#%UP5{DdhNnG)`Th(GjRVXe;Z!q-m%~-0)2nva85zYjK5oDmC8j`RvuT?gMqcj-+ZW>*i;?Pg%rECquo<2Mh5dhg504T>t$zE*1 zC{S2Vsv$rSG{^>^)$kdtY={Jahf{rj6IIsD|AxnFrTUyyVpfxw80Z1ynNjw#P0{l{ zz`BB%*73+6+X;yg@&uHkir#CWie5GZL6wUH5t(cZo(x2X1iER6xa1K&r+0ysRGkk7 z!V!Nk5(5U{SICE-mX|j!w*f3yVm(wZo`kP@p82fwk*R8_bo~u@cU;*Zl|GKX>eQwK zQfb$X@`}q_uIi=owi_<@RB*cLT9xGL#tarLQc^zUl}c*ieR+*k(tzQhRI(oOraYS^ zSJN$5p3^#JSSVvEs?PVF>-*mEvt48D^G?^qit!aw?XRr(#JPUHpm@SD?zqTJ^;|l3 z;n?M;FZ4^E9aj#6lUmhsmHWu@zUA8LYn4~+(yFf6g6?^jd(O2^a;>`EUF`O?-4TW5=FKi4xQTRt~1g&QR2`dfOYV#9)!DM7gIKIfiloZ3BEk>24# zKMKDczRJEGxpG4Cw$2o{jkV3&3SRC$+da7%5s}k1=d6^Rl@~W(di=uU*PV~vP&zvq zKY!-jnc0FGXsWPLaz1+7z_{93XtQJsbm$&!e9pQ4-sd(*|GD$gd*UV-@%LMHxjSkM zAC!1HN=+X;W(NP?t@m_nH+)!X?O2=l;c64ad{|@c*lPK3yLFG%k{f4z3+8P(oYjXL zEqy?x<-q9~MAfXL8%eG_T+WRohYIDnK22@sQlNmvaPwFDqp@u@E`#P8G*+KM^6&*Y zO89bYL&1YBrQaADF0%A+n&7flQg2m}-psy)Jklgz8DQ_O9E^^$pD z5vWxR0#;HF$#1Y^BfPv8MU_-xF$x|ZN1q2AnHvs-qht++DFd-8Bp@!FiIZIrdp~Fd z>O2@Dpr?^3fWn9;NL2JkW6`8QV#|ZZ2Nt6(eFvJ;K;!G&WY76y=Z;N1eXjq?b5dDH zs&vn_HUH@SdvB_zH`R0aTAfsSWY&B%8#%U}?>yHz_3S&r={4`wyj%0b;ncdenHBA` z<_<)n=CkHG^COb^k;(2WM^fl(`2vNnn>$DwbS(FpIRh!ntr?!})3`}40LMR+*{VPy zmlT6^=(`meu-2jN0;U1>7X#6zmYjgjDKlGvzNNFdjw=7*uqeWA2biDM;0HngT*43L zVKO=r14FUgyxcDE(4u>wSrKGs+ zJWasE<~)s(r}3S(A9cRnnR=p6+T1te>7Q9~{JQzX{fhz>IZnf!{{jb&i@?m&0QP)d z4=(Vp1|3Dt{b-N{6%3or(kHWA)S;&aq6bdsgG@HiibmNpZSlq^^F@h-9)(p!_Q$%w(_H3jU8@3 z6OL1%Q5G*<%N>}`f$2y9q>JoY<^p6$1iXphPsAbD0G&52MA2XZ49C&nC>5B~fq3v_ zC^kezX&{z}!pV-jV|m$mc|%HSbz)Y9~Ka+ykIT z13KGgo%L7NBFwRjTPD|hCm#_`!!KSb%|Ev_-8M0zGza{4-!Qc1Y}fvMi3J5wgwughQML+agkT~b7>EdTSCcthO|oS;2Iwdj4F`b~ z(&b@Ho9}UbsZ6JgE{rrt0h4|>0vZ;0k0@_gZXM*v%tMXh*TDg?2e#oJcTXOZoa@Gn z^Jd4K*)5sfsq#(Jds66a1Iy{0y-KoIU2MD5eWClxzU%g#H&ls#J$OEPF8XHh%DTTe zm0G#&CvER_|4sMIjsw?-wBsxDD_0}*xm+%-Y`m*y?M<*+98a)w_MJbs@4P1>_I;n( zRlIwp{%0$#yEm9*T{NEDdgvhEdDO#q?&)dwb$MXu288XNBjIQW4prbl_vr*2+JGkk z2fxFDClEve9)JVgMaTw)mMZa|g4%uPa>^}ibQg{4mJvmI;s+M`oaQe;)Y<~<)v)^x zodfN!nH22|j;0tJ4OuuHK49s?Tj=uVdbwOCH{P15Idj&KVIb;el#_|%sj2Fl_Q;m0 zF|(9uiajeO_vksYF$gV_-)K_5FUxS2gTquZeQ4jHPc9Q$R@<793O45gFjDHGh6<(+ zd4*CMts+aFELBs8swQfLQxxq?HIrF2VIuIuCj^WAi`Lw0+y>U5K*ypI?US7x`a_#fOVU#xBm&_A6Ixz&Sds;Tz2;2)eMm^@<7-rXnRl-tlQVsGu8W!mnbph} zFE^;3#+7y_3xcTO=t(ay8r-?^)tGQdtdF0GCvE8nI5rE7CSMNYX?NTc6Kg$ShD&ci z;2(tuRGij95*zl6z|EIPc)*j+jTd38bW`!PWEHDFgvWU`eNebQvw78es_TN);HC>> zt=nnc^>7#R@=4$?%rYsw2gv_26JM_?4fLvUs2 z3ylVTb0`*#`<31gjK<+gQAmLC!Fvo=aYP7$e{lo#80*IY#v>@fABhF2Nw%gMuMWVF z5!?cjKk!;He1GxbSSSI-Xa!hR4LV-h7Jv^tHl@?xSMt?hC6G$Lsa|>2q(kXlwAO=p z>XiY4F(jkgtbnzZ*erl@{}d-z9arR~UV|q!I9r>VYCUvflUAixL`BI4m@&m7?%6Ml z4#WZ^)CpI#2uX~@l@=8d3dd_UHE#4;d%%wD6ytDx0d6Cl_Jgfg1j{u^!07z@*NXpg z&%Y+Wu`{_wX#j3_pj8|1J$RzRGhkF75Q1>#43Gc>{^pBN2FyfV@bZ>tz?otm#7A$kSg?IR z+L<7ABoc-@AZTsK69qVmRHgxLebC8~P3ifd#toS}9e~^gN?m@yHG&vKdxZyEbilB| znE_0jA3qsPUkWA!HU@cQ6D$vUuf;$=UpA$s9uicn3GK@UF!;l58xC@dB9cg)b^0jB zr!@-CqRK@XVE?IbBqD-23-d=py$hgWTP2WBs6;&-T?3&^m z#if&mZ|@s_972_=7Ayw)DllZP-?U(7EakTtqvg>B2Ll&QX#Ja{!c9=WIe*SvE}6@* z#&#B}>|i_DkBdJ(`41IyodKyckQ(^zd%6%45ybB|q$Y z`ye#d#?rRA^Okd#sRL5k#+l+xQqg8eX=+(;TI?+gh0I>|AiLmVERWn`td>LU-4do~ zLqCxw+4TMiVX;ek}uu2kW@cM{zbu!#X?p;m@ z{5@kp*HGHILZAEI&J~3)vv8dG9w3YCn>fgvmONSLkKUJv>H#lmh@98;B1YFYYRDXp zN4Z=UI2GBbAS3|a0XcIRYSf&$aJQPqbJzvmKySq&S{q^*=$B^7$z|!sJ4J9WIQ@+j z@f0ojSO{j_OM2jF^y+yN{dO~ayGF3HN^6)p(*~edO9tn3{aMDel)>*NCIAc!Zy0q+ zaMwu1G}i8$bPqH(puTEI8X905h?8NcTxOr7r;14jRX@l8kvw~n4p8-IlyO{p63ZI_2Pz zd=HE2L2HuN(FeDY0`Y{nC;<8`gEnv#l-(gs1xeWE{;eAiUv+egcl(w35ADFDI zF2e`KEV#)gg{-GH?mD_T!+d2k_5>t);sNm#PJ*YQ$J5ZUh^eDtg);R?kducp_1tV* zxre8tYXGWS`tSzIo0ntqMw+T$hUZh06KDZlPR?!4=#C`}*^-r_X%otWvv_*uk_Ao4 z1BQ$@3gJt58*ksQ-^WD_@Kpv_X%0RgugL&gHRjSJ57rf#_4p7zt=THTV5hBk--B6n z0TQZZM$bvD05G%o0PFjrbt=r<3>x*f&CJdJD`x)1`tfC$xzZ2R^~*E!2e!J1nd|=# z%-phwnOm}$xu)H-n7K7-fw^9*%xJcoC4m}8&!qD%b*G|Ny-YrDCQbG6C46Z!d%szC z>BXqr-2R9)vlnTc+k%{Xx%;l&bq~8F)csicD5R`AX-@Of(c~jpjQ0VA)S_T@B%)>n z;7HTSIr!LQC|$wtl$|HdD)}ZaK%?YEbPxjo=_>3wi3tBtEEZ{})@ZnWgGOOU${P-x z@#771xRXx44{^yn2O{!PA#j<)-gS1|YtI@B0% zRIUZljT?{yWmE?G8Ds)8O`?M{q%;oJf3(!ch-_3kMbQBHE@nW4Ko4}%d_ zO8xpplt>W>KVDKDBH+@d<=r_D#FwlCKU(wnO zyq&sVHTw5S&Kiw`O+FA;b@nJM=t~i@UpW}d zwqMv+UEcMHz5Ytgyldrzf82kuXKrniw6^Id`u7~~IzHB4>-dMf)RvwbYrU6FeE-DE z+NNn%TH8Fm`Mu_Mo3B1AZST3GXG;#VV;!Gm=u#R+{kG}S{#o0BFGH8`ps-qUR=>%; z<#@x9+Pd$$bN_rn$%K8}J~i-)T`KV6f#Cu6b0_0ySSV&JFgGhD^UBH4b#v8k;It4p z(!V(OL#cZ-%XK>(8{+Bd&z!B^z1#JFw__IruMc;)_O3O4)x%FYnx5z-)`-+n7kal6hqJgtt>s%-`!pp8b#0!;`hr|f7+e|ew!c65rIfL zB_9nZM2zEw?r6;KC+o4AW^{I=gY=$!6`deDC($A3JPVF&PQd^6P@G{cp9+t34w8$Q zhK6Wz9vwu{YwcW|zTxyPh-bVQ<@5bd9XR4=!hT?6%EdXac){(eaZ1MgJ?li6i4j zrnqr`YTZ|741rs^N`v=~o-q!v3+TPQm$eyIFRaLs{rHUG#4VlMum-dH**oY}`iWh{ zaYd@)_j@0aO@4nU7KCv_;lHPNp&sKfc?4L5uPcbI{ zQzj4GUzS%qub*W~=S>AKJ@>+MbEZ1URF|rM{C)1~(GMJRPaKt=IGQ>p&O8yHF(sbo z=1qB$sdTdK{Qh(Mr4@}SrZHt|)XJ`tOzWl~V=ZK4xR>%?$eUwIC8l(en`KtsHTrby tn#r;`_j<{_{x19ngI%-m6vuG3vE+>2JUy#3_YZ=Bg)66@_dhTTwl4qx literal 0 HcmV?d00001 diff --git a/scripts/check-synthetic-nests.py b/scripts/check-synthetic-nests.py index 76b2581e..93eb7ee0 100644 --- a/scripts/check-synthetic-nests.py +++ b/scripts/check-synthetic-nests.py @@ -174,7 +174,7 @@ def main(argv=None): print("PASS: exactly six Irregular results, all valid and fully placed") return 0 except KeyboardInterrupt: - print("FAIL: cancelled; owned subprocess tree terminated", file=sys.stderr) + print("FAIL: canceled; owned subprocess tree terminated", file=sys.stderr) return 130 except (GateError, OSError, ValueError, KeyError, zipfile.BadZipFile, subprocess.SubprocessError) as error: diff --git a/scripts/test_ci_results.py b/scripts/test_ci_results.py index 5619a43b..1db8e2e5 100644 --- a/scripts/test_ci_results.py +++ b/scripts/test_ci_results.py @@ -27,7 +27,7 @@ class CIResultsTests(unittest.TestCase): def test_synthetic_failure_blocks_aggregate(self): self.assertNotEqual(self.check("success", "failure").returncode, 0) - def test_cancelled_dependency_blocks_aggregate(self): + def test_canceled_dependency_blocks_aggregate(self): for results in [("cancelled", "success"), ("success", "cancelled")]: with self.subTest(results=results): self.assertNotEqual(self.check(*results).returncode, 0) diff --git a/scripts/windows-acceptance.json b/scripts/windows-acceptance.json index b599e9d4..ff251d29 100644 --- a/scripts/windows-acceptance.json +++ b/scripts/windows-acceptance.json @@ -61,12 +61,12 @@ }, { "project": "OpenNest.WinForms.Tests", - "method": "OpenNest.WinForms.Tests.Forms.ImportBomToSetFormTests.ImportBom_OpensTheEditorPrefilled_AndCancellingItStoresNoSet", + "method": "OpenNest.WinForms.Tests.Forms.ImportBomToSetFormTests.ImportBom_OpensTheEditorPrefilled_AndCancelingItStoresNoSet", "minimum_cases": 1 }, { "project": "OpenNest.WinForms.Tests", - "method": "OpenNest.WinForms.Tests.Forms.ImportBomToSetFormTests.DecliningTheLibraryWrites_OrCancelling_StoresNothing", + "method": "OpenNest.WinForms.Tests.Forms.ImportBomToSetFormTests.DecliningTheLibraryWrites_OrCanceling_StoresNothing", "minimum_cases": 1 } ], @@ -170,12 +170,12 @@ }, { "project": "OpenNest.FrontEnd.Tests", - "method": "OpenNest.FrontEnd.Tests.NestingPipelineTests.Console_CancelledOrdinaryFillDoesNotOverwriteOutput", + "method": "OpenNest.FrontEnd.Tests.NestingPipelineTests.Console_CanceledOrdinaryFillDoesNotOverwriteOutput", "minimum_cases": 1 }, { "project": "OpenNest.FrontEnd.Tests", - "method": "OpenNest.FrontEnd.Tests.NestingPipelineTests.Console_CancelledSolveDoesNotSave", + "method": "OpenNest.FrontEnd.Tests.NestingPipelineTests.Console_CanceledSolveDoesNotSave", "minimum_cases": 1 }, { @@ -230,7 +230,7 @@ }, { "project": "OpenNest.WinForms.Tests", - "method": "OpenNest.WinForms.Tests.Forms.AutoNestFormStockOptionsTests.BlankAndCancelledRowsDoNotBecomeStockOptions", + "method": "OpenNest.WinForms.Tests.Forms.AutoNestFormStockOptionsTests.BlankAndCanceledRowsDoNotBecomeStockOptions", "minimum_cases": 1 }, { @@ -270,7 +270,7 @@ }, { "project": "OpenNest.WinForms.Tests", - "method": "OpenNest.WinForms.Tests.Forms.NestValidationFormTests.CompletionClosesWithoutCancellingSuccessfulJob", + "method": "OpenNest.WinForms.Tests.Forms.NestValidationFormTests.CompletionClosesWithoutCancelingSuccessfulJob", "minimum_cases": 1 }, { @@ -983,7 +983,7 @@ "required_tests": [ { "project": "OpenNest.FrontEnd.Tests", - "method": "OpenNest.FrontEnd.Tests.McpEngineHarnessProcessTests.AlreadyCancelled_DoesNotStartChild", + "method": "OpenNest.FrontEnd.Tests.McpEngineHarnessProcessTests.AlreadyCanceled_DoesNotStartChild", "minimum_cases": 1 }, {