mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-16 10:15:35 -05:00
feat(ui): position part labels at polylabel center
Replace PathPoints[0] label positioning with polylabel algorithm to place part ID labels at the visual center of each part. Labels are now centered and readable even in dense nests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b647769b51
commit
79a3410bb9
1 file changed
+3
-1
@@ -122,7 +122,9 @@ namespace OpenNest
|
||||
var entities = ConvertProgram.ToGeometry(BasePart.Program);
|
||||
var nonRapid = entities.Where(e => e.Layer != SpecialLayers.Rapid).ToList();
|
||||
|
||||
if (nonRapid.Count == 0)
|
||||
var shapes = ShapeBuilder.GetShapes(nonRapid);
|
||||
|
||||
if (shapes.Count == 0)
|
||||
{
|
||||
var bbox = BasePart.Program.BoundingBox();
|
||||
return new Vector(bbox.Location.X + bbox.Width / 2, bbox.Location.Y + bbox.Length / 2);
|
||||
|
||||
Reference in new issue
Block a user