diff --git a/OSCADSharp/OSCADSharp.ConsoleTests/Program.cs b/OSCADSharp/OSCADSharp.ConsoleTests/Program.cs index 18b6f36..af0bec8 100644 --- a/OSCADSharp/OSCADSharp.ConsoleTests/Program.cs +++ b/OSCADSharp/OSCADSharp.ConsoleTests/Program.cs @@ -1,4 +1,5 @@ -using OSCADSharp.Solids; +using OSCADSharp.Scripting; +using OSCADSharp.Solids; using OSCADSharp.Transforms; using System; using System.Collections.Generic; @@ -13,10 +14,9 @@ namespace OSCADSharp.ConsoleTests { static void Main(string[] args) { - - Settings.Globals["$fn"] = 100; + Variables.Global["$fn"] = 100; var obj = new Sphere(30); - + var pos = obj.Position(); var cyl1 = new Cylinder(1, 100, true).Translate(pos); var cyl2 = new Cylinder(1, 100, true).Rotate(0, 90, 0).Translate(pos); diff --git a/OSCADSharp/OSCADSharp.UnitTests/OSCADObjectTests.cs b/OSCADSharp/OSCADSharp.UnitTests/OSCADObjectTests.cs index c408170..62af2ab 100644 --- a/OSCADSharp/OSCADSharp.UnitTests/OSCADObjectTests.cs +++ b/OSCADSharp/OSCADSharp.UnitTests/OSCADObjectTests.cs @@ -160,7 +160,7 @@ namespace OSCADSharp.UnitTests { var cube = new Cube(); string[] output = null; - Settings.Globals["$fn"] = 100; + Variables.Global["$fn"] = 100; var mock = new Mock(); mock.Setup(_wrtr => _wrtr.WriteAllLines(It.IsAny(), It.IsAny())) diff --git a/OSCADSharp/OSCADSharp.UnitTests/SettingsTests.cs b/OSCADSharp/OSCADSharp.UnitTests/SettingsTests.cs index 6c97e28..29926db 100644 --- a/OSCADSharp/OSCADSharp.UnitTests/SettingsTests.cs +++ b/OSCADSharp/OSCADSharp.UnitTests/SettingsTests.cs @@ -18,7 +18,7 @@ namespace OSCADSharp.UnitTests public void Settings_NullVariablesDoNothing() { var cube = new Cube(); - Settings.Globals["thing"] = null; + Variables.Global["thing"] = null; string[] output = null; var mock = new Mock(); diff --git a/OSCADSharp/OSCADSharp/OSCADObject.cs b/OSCADSharp/OSCADSharp/OSCADObject.cs index 48e1df3..4e41c3c 100644 --- a/OSCADSharp/OSCADSharp/OSCADObject.cs +++ b/OSCADSharp/OSCADSharp/OSCADObject.cs @@ -334,7 +334,7 @@ namespace OSCADSharp Settings.FileWriter.WriteAllLines(path, new string[] { Settings.OSCADSharpHeader, - Settings.Globals.ToString(), + Variables.Global.ToString(), this.ToString() }); diff --git a/OSCADSharp/OSCADSharp/Scripting/Variables.cs b/OSCADSharp/OSCADSharp/Scripting/Variables.cs index 397aad9..571e6bb 100644 --- a/OSCADSharp/OSCADSharp/Scripting/Variables.cs +++ b/OSCADSharp/OSCADSharp/Scripting/Variables.cs @@ -11,6 +11,12 @@ namespace OSCADSharp.Scripting /// public sealed class Variables { + /// + /// Global variables that can be assigned for output at the + /// top of OpenSCAD scripts + /// + public static Variables Global = new Variables(); + private Dictionary variables = new Dictionary(); /// diff --git a/OSCADSharp/OSCADSharp/Settings.cs b/OSCADSharp/OSCADSharp/Settings.cs index 3e900bd..ba57744 100644 --- a/OSCADSharp/OSCADSharp/Settings.cs +++ b/OSCADSharp/OSCADSharp/Settings.cs @@ -18,13 +18,7 @@ namespace OSCADSharp /// public static readonly string OSCADSharpHeader = String.Format("/*Code Generated using OSCADSharp on {0}. {1}{2}For more information, please visit https://github.com/Exolun/OSCADSharp */{3}", DateTime.Now.ToString(), Environment.NewLine, Environment.NewLine, Environment.NewLine); - - /// - /// Global variables that can be assigned for output at the - /// top of OpenSCAD scripts - /// - public static Variables Globals = new Variables(); - + /// /// Used to write scripts to file ///