Michael Smith 54b8e6a686 + Text3D bindings
+ Text3D happy path binding tests
2016-02-29 23:52:25 -08:00

45 lines
1.4 KiB
C#

using OSCADSharp.Scripting;
using OSCADSharp.Solids;
using OSCADSharp.Transforms;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OSCADSharp.ConsoleTests
{
class Program
{
static void Main(string[] args)
{
Variables.Global.Add("sphereRadius", 15);
Variables.Global.Add("cubeWidth", 10);
OSCADObject obj = new Sphere();
((Sphere)obj).Bind("Radius", Variables.Global["sphereRadius"]);
var cube = new Cube();
cube.Bind("Width", Variables.Global["cubeWidth"]);
cube.Bind("Height", Variables.Global["sphereRadius"]);
cube.Size.X = 30;
obj = obj + cube;
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);
var cyl3 = new Cylinder(1, 100, true).Rotate(90, 0, 0).Translate(pos);
var axisHelper = cyl1.Union(cyl2, cyl3).Color("Red");
//var topCorner = new Sphere().Translate(obj.Bounds().TopRight);
//var botCorner = new Sphere().Translate(obj.Bounds().BottomLeft);
(obj + axisHelper).ToFile("test.scad").Open();
//Console.ReadKey();
}
}
}