Skip to content

Commit

Permalink
relative/absolute file merging now has built in conversion to absolut…
Browse files Browse the repository at this point in the history
…e mode - legacy command combinations are still a bit suspect
StijnKuipers committed Mar 10, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 54157e4 commit 627c9d4
Showing 3 changed files with 289 additions and 114 deletions.
13 changes: 6 additions & 7 deletions GerberCombiner/CombinerProgram.cs
Original file line number Diff line number Diff line change
@@ -15,9 +15,10 @@ static void Main(string[] args)
{


GerberSplitter GS = new GerberSplitter();
GS.Split("G03*", new GerberLibrary.Core.Primitives.GerberNumberFormat());
Console.WriteLine("{0}", GS.Pairs.Count);
//GerberSplitter GS = new GerberSplitter();
//GS.Split("G03*", new GerberLibrary.Core.Primitives.GerberNumberFormat());
//GS.Split("%SRX1Y1I0.00000J1.76100*%", new GerberLibrary.Core.Primitives.GerberNumberFormat(),true);
//Console.WriteLine("{0}", GS.Pairs.Count);
Gerber.ShowProgress = true;
if (args.Count() < 2)
{
@@ -51,10 +52,8 @@ static void Main(string[] args)
{
Console.WriteLine("Warning! Filetypes seem to be mismatched! First file ({0}) is a {1}, but {2} is a {3}", args[1], FileType, args[j], FileType2);
}

}


if (FileType == BoardFileType.Drill)
{
List<string> ExcellonFiles = new List<string>();
@@ -67,8 +66,8 @@ static void Main(string[] args)
GerberFiles.AddRange(args.Skip(1));
GerberMerger.MergeAll(GerberFiles, args[0], new StandardConsoleLog());
}
// Console.WriteLine("Press any key to continue..");
// Console.ReadKey();
// Console.WriteLine("Press any key to continue..");
// Console.ReadKey();
}

}
378 changes: 272 additions & 106 deletions GerberLibrary/Core/GerberMerger.cs

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion GerberLibrary/Core/PolyLineSet.cs
Original file line number Diff line number Diff line change
@@ -1054,6 +1054,11 @@ private static bool BasicLineCommands(string Line, GerberParserState State)

private static void DoRepeating(GerberParserState State)
{
if (State.Repeater == false)
{
// cant stop a repeat that is not happening!
return;
}
int LastThin = State.NewThinShapes.Count();
int LastShape = State.NewShapes.Count();
for (int x = 0; x < State.RepeatXCount; x++)
@@ -1195,7 +1200,7 @@ private static void ParseGerber274_Lines(bool forcezerowidth, GerberParserState
{
if (Gerber.ShowProgress) Console.WriteLine("Setting up step and repeat ");
GerberSplitter GS2 = new GerberSplitter();
GS2.Split(GCC.originalline, State.CoordinateFormat);
GS2.Split(GCC.originalline, State.CoordinateFormat, true);
if (GCC.numbercommands.Count == 0)
{
DoRepeating(State);
@@ -1210,6 +1215,11 @@ private static void ParseGerber274_Lines(bool forcezerowidth, GerberParserState
{
SetupRepeater(State, Xcount, Ycount, Xoff, Yoff);
}
else
{
// apparently this is a 1:1 command!
DoRepeating(State);
}
}
}
break;

0 comments on commit 627c9d4

Please sign in to comment.