-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- PCB Exposure: - (Fix) Polygon primitive vertex count not parsing correctly when having argument (#976) - (Fix) Obround aperture to follow the correct implementation (two semicircles connected by parallel lines tangent to their endpoints) (#976) - (Fix) Implement the "hole diameter" argument in all apertures (#976) - (Fix) Implement the "rotation" argument for the polygon aperture
- Loading branch information
Showing
17 changed files
with
175 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,4 +94,5 @@ | |
- Jeremy Conoley | ||
- Brady George | ||
- Ryan Skow | ||
- Cainam | ||
- Cainam | ||
- Cory Lytle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
- Anycubic file format: | ||
- (Fix) Reset TSMC values to comply with globals when decoding file and AdvancedMode is disabled (#971) | ||
- (Fix) Setting the LiftHeight2 was setting the base value to BottomLiftHeight2 | ||
- (Fix) Setting the BottomRetractSpeed was not applying the value in the base property | ||
- Multiple exposure finder: | ||
- (Fix) Counter triangles not taking all the new left space | ||
- (Fix) When doing multiple heights the text label always show the base height | ||
- (Improvement) Layer image viewer internal handling | ||
- (Fix) Settings - Send to process: Unable to pick a process file, it was selecting folder instead | ||
- (Fix) Save As can show incorrect file extension description when there are other file formats with the same extension | ||
- PCB Exposure: | ||
- (Fix) Polygon primitive vertex count not parsing correctly when having argument (#976) | ||
- (Fix) Obround aperture to follow the correct implementation (two semicircles connected by parallel lines tangent to their endpoints) (#976) | ||
- (Fix) Implement the "hole diameter" argument in all apertures (#976) | ||
- (Fix) Implement the "rotation" argument for the polygon aperture | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* GNU AFFERO GENERAL PUBLIC LICENSE | ||
* Version 3, 19 November 2007 | ||
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
|
||
using Emgu.CV; | ||
using Emgu.CV.CvEnum; | ||
using Emgu.CV.Structure; | ||
using System.Drawing; | ||
using UVtools.Core.Extensions; | ||
|
||
namespace UVtools.Core.Gerber.Apertures; | ||
|
||
public class ObroundAperture : Aperture | ||
{ | ||
#region Properties | ||
public SizeF Axes { get; set; } | ||
public double HoleDiameter { get; set; } | ||
#endregion | ||
|
||
#region Constructor | ||
public ObroundAperture(GerberFormat document) : base(document, "Obround") { } | ||
|
||
public ObroundAperture(GerberFormat document, int index, float width, float height, double holeDiameter = 0) : this(document, index, new SizeF(width, height), holeDiameter) | ||
{ | ||
|
||
} | ||
|
||
public ObroundAperture(GerberFormat document, int index, SizeF axes, double holeDiameter = 0) : base(document, index, "Obround") | ||
{ | ||
Axes = document.GetMillimeters(axes); | ||
if (holeDiameter > 0) HoleDiameter = document.GetMillimeters(holeDiameter); | ||
} | ||
#endregion | ||
|
||
public override void DrawFlashD3(Mat mat, PointF at, MCvScalar color, LineType lineType = LineType.EightConnected) | ||
{ | ||
var location = Document.PositionMmToPx(at); | ||
// Calculate radii of the semicircles | ||
var radius = Document.SizeMmToPx(Axes.Width / 2, Axes.Height / 2); | ||
var radiusFromHeight = Document.SizeMmToPx(Axes.Height / 2, Axes.Height / 2); | ||
var diameter = Document.SizeMmToPx(Axes.Width, Axes.Height); | ||
|
||
// Calculate centers for the semicircles | ||
var leftCircleCenter = location with { X = location.X - radius.Width + radiusFromHeight.Width }; | ||
var rightCircleCenter = location with { X = location.X + radius.Width - radiusFromHeight.Width }; | ||
|
||
// Draw the two semicircles | ||
CvInvoke.Ellipse(mat, leftCircleCenter, radiusFromHeight, 0, 90, 270, color, -1, lineType); | ||
CvInvoke.Ellipse(mat, rightCircleCenter, radiusFromHeight, 0, -90, 90, color, -1, lineType); | ||
|
||
/*CvInvoke.Ellipse(mat, | ||
location, | ||
radius, | ||
0, 0, 360, color, -1, lineType);*/ | ||
|
||
// Draw the rectangle connecting the semicircles | ||
var rect = new Rectangle(leftCircleCenter with { Y = location.Y - radius.Height }, | ||
diameter with { Width = diameter.Width - diameter.Height }); | ||
CvInvoke.Rectangle(mat, rect, color, -1, lineType); | ||
|
||
if (HoleDiameter > 0) | ||
{ | ||
var invertColor = color.Equals(EmguExtensions.BlackColor) ? EmguExtensions.WhiteColor : EmguExtensions.BlackColor; | ||
CvInvoke.Ellipse(mat, | ||
location, | ||
Document.SizeMmToPx(HoleDiameter / 2.0, HoleDiameter / 2.0), | ||
0, 0, 360, invertColor, -1, lineType); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.