fix: use two-line V arrowheads with dark pen for cut direction

This commit is contained in:
2026-03-31 22:27:22 -04:00
parent bb70ae26d3
commit d3a439181c
3 changed files with 12 additions and 14 deletions
+10 -12
View File
@@ -1,7 +1,6 @@
using OpenNest.CNC; using OpenNest.CNC;
using OpenNest.Geometry; using OpenNest.Geometry;
using OpenNest.Math; using OpenNest.Math;
using System;
using System.Drawing; using System.Drawing;
namespace OpenNest.Controls namespace OpenNest.Controls
@@ -128,19 +127,18 @@ namespace OpenNest.Controls
private static void DrawArrowHead(Graphics g, Pen pen, PointF tip, double angle, float size) private static void DrawArrowHead(Graphics g, Pen pen, PointF tip, double angle, float size)
{ {
var sin = (float)System.Math.Sin(angle); var leftAngle = angle + System.Math.PI + 0.5;
var cos = (float)System.Math.Cos(angle); var rightAngle = angle + System.Math.PI - 0.5;
var backX = -size * cos; var left = new PointF(
var backY = -size * sin; tip.X + size * (float)System.Math.Cos(leftAngle),
var wingX = size * 0.5f * sin; tip.Y + size * (float)System.Math.Sin(leftAngle));
var wingY = -size * 0.5f * cos; var right = new PointF(
tip.X + size * (float)System.Math.Cos(rightAngle),
tip.Y + size * (float)System.Math.Sin(rightAngle));
var wing1 = new PointF(tip.X + backX + wingX, tip.Y + backY + wingY); g.DrawLine(pen, left, tip);
var wing2 = new PointF(tip.X + backX - wingX, tip.Y + backY - wingY); g.DrawLine(pen, right, tip);
g.DrawLine(pen, wing1, tip);
g.DrawLine(pen, wing2, tip);
} }
} }
} }
+1 -1
View File
@@ -515,7 +515,7 @@ namespace OpenNest.Controls
private void DrawAllCutDirectionArrows(Graphics g) private void DrawAllCutDirectionArrows(Graphics g)
{ {
using var pen = new Pen(Color.FromArgb(220, Color.Black), 1.5f); using var pen = new Pen(Color.FromArgb(60, 60, 60), 1.5f);
var arrowSpacingWorld = view.LengthGuiToWorld(60f); var arrowSpacingWorld = view.LengthGuiToWorld(60f);
var arrowSize = 6f; var arrowSize = 6f;
+1 -1
View File
@@ -273,7 +273,7 @@ namespace OpenNest.Controls
var pgm = ConvertGeometry.ToProgram(contour.Shape); var pgm = ConvertGeometry.ToProgram(contour.Shape);
if (pgm == null) continue; if (pgm == null) continue;
using var pen = new Pen(Color.FromArgb(220, Color.Black), 1.5f); using var pen = new Pen(Color.FromArgb(60, 60, 60), 1.5f);
var pos = new Vector(); var pos = new Vector();
CutDirectionArrows.DrawProgram(e.Graphics, preview, pgm, ref pos, pen, spacing, arrowSize); CutDirectionArrows.DrawProgram(e.Graphics, preview, pgm, ref pos, pen, spacing, arrowSize);
} }