public PrismSceneTests() { var prism = new Prism() { Height1 = 2, Height2 = 3 }; prism.Add(0, 0).Add(6, 0).Add(6, 8).Add(0, 8).Add(0, 0) //outer rim .Add(1, 1).Add(5, 1).Add(5, 7).Add(1, 7).Add(1, 1); //inner rim prism.AddModifiers(new Pigment() { Color = new PovColor(0, 0, 1) }); prism.AddModifiers(new Scale(new PovVector(0.5, 1, 0.5))); scene.Add(prism); var plane = new Plane(); plane.AddModifiers(new Pigment() { Color = new PovColor(1, 0, 0) }); scene.Add(plane); }
public void ToPovCodeTest() { var prism = new Prism("MyPrism") { Height1 = 2, Height2 = 3, Open = Prism.OpenFlag.open, Sturm = Prism.SturmFlag.sturm, Sweep = Prism.SweepType.conic_sweep, Spline = Prism.ObjectSplineType.bezier_spline }; prism.Add(0, 0).Add(6, 0).Add(6, 8).Add(0, 8).Add(0, 0) //outer rim .Add(1, 1).Add(5, 1).Add(5, 7).Add(1, 7).Add(1, 1); //inner rim var povCode = prism.ToPovCode(); Check.That(povCode).IsEqualTo("prism {\n conic_sweep\n bezier_spline\n 2, 3, 10\n < 0, 0>, < 6, 0>, < 6, 8>, < 0, 8>, < 0, 0>, < 1, 1>, < 5, 1>, < 5, 7>, < 1, 7>, < 1, 1>\n open\n sturm\n}"); }