public static void makeGreatSword() { double referenceWidth = Inches.Eigth; double overallLength = Inches.One*1.5; var tang = new Cylinder(referenceWidth, overallLength, true) { Resolution = 6 }.Scale(.5, 2, 1); var pommel = new Sphere(referenceWidth * 1.2){ Resolution = 11 }.Translate(0, 0, -Inches.Half - Inches.Eigth).Color("Gold"); var hilt = new Cylinder(referenceWidth, Inches.Half * .75, true) { Resolution = 10 } .Rotate(90, 0, 0) .Translate(0, 0, -Inches.Quarter).Color("Gold"); var hiltRight = new Sphere(referenceWidth * 1.1) { Resolution = 8 } .Scale(1, 1, 1.2).Color("Gold") .Translate(0, hilt.Bounds().YMin, hilt.Position().Z); var hiltLeft = hiltRight.Clone().Mirror(0, 1, 0); var hiltCenter = new Cylinder(referenceWidth * .9, Inches.Half * .8, true) { Resolution = 8 } .Translate(0, 0, -Inches.Quarter - Inches.Quarter*.75).Color("Gold"); hilt = hilt + hiltLeft + hiltRight + hiltCenter; var blade = tang.Translate(0, 0, Inches.Half); var tip = new Cylinder(referenceWidth, Inches.Quarter, true) { Resolution = 6, Diameter2 = .1 }.Scale(.5, 2, 1).Translate(0, 0, blade.Bounds().ZMax + Inches.Eigth); blade = blade + tip; blade = blade.Color("Silver"); var whole = (blade + pommel + hilt).Scale(.5, .5, .5); whole.ToFile("greatsword").Open(); }
public void Cylinder_CenteredCylinderPositionIsZero() { var cylinder = new Cylinder(5, 20, true); Assert.AreEqual(new Vector3(), cylinder.Position()); }
public void Minkowski_PositionThrowsNotSupportedException() { var obj = new Cylinder().Minkowski(new Sphere()).Translate(0, 5, 5); var pos = obj.Position(); }
public void Cylinder_UncenteredPositionZValueIsHalfTheHeight() { var cylinder = new Cylinder(3, 40); Assert.AreEqual(new Vector3(0, 0, 20), cylinder.Position()); }