static void Main(string[] args) { /* * Konstanten */ Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); string inputFile = @"Galgen.txt"; int randBreite = 3; string currentPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; string path = currentPath + "\\"; string fileName = @"Bahnplanung.txt"; int infillDensity = 10; //actual Infill Percentage might differ up to 5% string infillType = "3DInfill"; //3DInfill oder HexInfill oder LineInfill oder Line3DInfill int offset = 0; //shifts axis aligned infill along the z axis double robotGeschwindigkeit = 30.0; double extrusionsGeschwindigkeit = 36.0; /* * Konstanten */ Console.WriteLine("Lese Modell ein..."); Voxelmodell v = Input(path + inputFile); Console.WriteLine("Modell eingelesen!"); Console.WriteLine("Verbreitere Rand..."); v.randVerbreiterung(randBreite); Console.WriteLine("Rand verbreitert!"); Console.WriteLine("Füge das Infill ein..."); v.InsertInfill(infillDensity, infillType, offset); Console.WriteLine("Infill eingefügt!"); Console.WriteLine("Plane die Bahn..."); List <Bahn> bahn = new List <Bahn>(); if (File.Exists(path + fileName)) { File.Delete(path + fileName); } for (int i = 0; i < v.getSchichtenAnzahl(); i++) { bahn.Add(new Bahn()); } Parallel.For(0, v.getSchichtenAnzahl(), j => { Console.WriteLine("Processing Tool path for layer:" + j); bahn[j].SetBahn(bahn[j].Bahnplanung((v.getListeAtIndex(j)), j + 1)); }); bahn.Sort((x, y) => x.GetLayerIndex().CompareTo(y.GetLayerIndex())); for (int i = 1; i < bahn.Count + 1; i++) { bahn[i - 1].Textoutput(robotGeschwindigkeit, extrusionsGeschwindigkeit, path, fileName); } Console.WriteLine("Bahn geplant!"); }
static void Main(string[] args) { /* * Konstanten */ Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); string inputFile = @"Galgen.txt"; int randBreite = 3; string currentPath = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName; string path = currentPath + "\\"; string fileName = @"Bahnplanung.txt"; int infillDensity = 20; string infillType = "3DInfill"; //3DInfill oder HexInfill oder LineInfill oder Line3DInfill int offset = 0; //für LineInfill double robotGeschwindigkeit = 30.0; double extrusionsGeschwindigkeit = 36.0; /* * Konstanten */ Console.WriteLine("Lese Modell ein..."); Voxelmodell v = Input(path + inputFile); Console.WriteLine("Modell eingelesen!"); Console.WriteLine("Verbreitere Rand..."); v.randVerbreiterung(randBreite); Console.WriteLine("Rand verbreitert!"); Console.WriteLine("Füge das Infill ein..."); v.InsertInfill(infillDensity, infillType, offset); Console.WriteLine("Infill eingefügt!"); Console.WriteLine("Plane die Bahn..."); Bahn bahn = new Bahn(); if (File.Exists(path + fileName)) { File.Delete(path + fileName); } for (int i = 0; i < v.getSchichtenAnzahl(); i++) { Console.WriteLine("Plane die Bahn für Schicht " + i + "/" + v.getSchichtenAnzahl()); bahn.Bahnplanung(v.getListeAtIndex(i), robotGeschwindigkeit, extrusionsGeschwindigkeit, path, fileName, (i + 1)); } Console.WriteLine("Bahn geplant!"); }