Compare commits
5 Commits
f04c75235c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| da4d3228b0 | |||
| 3c1700c480 | |||
| f2f50f9914 | |||
| bf36a56387 | |||
| 6e131d402e |
@@ -36,7 +36,7 @@ namespace EtchBendLines
|
||||
/// The regular expression pattern the bend note must match
|
||||
/// </summary>
|
||||
static readonly Regex bendNoteRegex = new Regex(
|
||||
@"\b(?<direction>UP|DOWN|DN)\s+(?<angle>\d+(\.\d+)?)°?\s*R\s*(?<radius>\d+(\.\d+)?)\b",
|
||||
@"\b(?<direction>UP|DOWN|DN)\s+(?<angle>\d+(\.\d+)?)[^R\d]*R\s*(?<radius>\d+(\.\d+)?)\b",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase
|
||||
);
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace EtchBendLines
|
||||
|
||||
AssignBendDirections(bends, bendNotes);
|
||||
|
||||
return bends.Where(b => b.Radius <= MaxBendRadius).ToList();
|
||||
return bends.Where(b => b.Radius == null || b.Radius <= MaxBendRadius).ToList();
|
||||
}
|
||||
|
||||
private bool IsBendLine(Line line)
|
||||
@@ -76,6 +76,7 @@ namespace EtchBendLines
|
||||
|
||||
switch (line.Layer.Name.ToUpperInvariant())
|
||||
{
|
||||
case "0":
|
||||
case "BEND":
|
||||
case "BEND LINES":
|
||||
case "BENDLINES":
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ACadSharp" Version="3.1.32" />
|
||||
<PackageReference Include="ACadSharp" Version="3.4.9" />
|
||||
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -100,10 +100,11 @@ namespace EtchBendLines
|
||||
var doc = LoadDocument(filePath);
|
||||
var bends = ExtractBends(doc);
|
||||
|
||||
// Ensure all bend lines are on the BEND layer
|
||||
// Ensure all bend lines are on the BEND layer with ByLayer color
|
||||
foreach (var bend in bends)
|
||||
{
|
||||
bend.Line.Layer = BendLayer;
|
||||
bend.Line.Color = Color.ByLayer;
|
||||
}
|
||||
|
||||
var upBends = bends.Where(b => b.Direction == BendDirection.Up);
|
||||
|
||||
Reference in New Issue
Block a user