public void Polyhedron_Shift_RotateNotThroughOriginAndTranslate_ThenReturnToOriginal() { Polyhedron polyhedron = new TestRectangularBox2(); //rotate 90 degrees toward z Angle xAngle = Angle.RightAngle; Line testAxis = new Line(Point.MakePointWithInches(1, 0, 0), Point.MakePointWithInches(1, 0, 1)); Rotation xRotation = new Rotation(testAxis, xAngle); Point displacementPoint = Point.MakePointWithInches(1, 3, -4); Shift ninetyShift = new Shift(xRotation, displacementPoint); Polyhedron s = new Polyhedron(polyhedron.Shift(ninetyShift)); Polyhedron s2 = s.Shift(ninetyShift.Inverse()); s2.Should().Be(polyhedron); }
public void Polyhedron_Shift_RotateAndTranslate_ThenReturnToOriginal() { Polyhedron polyhedron = new TestRectangularBox2(); //rotate 90 degrees toward z Angle xAngle = new Angle(new Degree(), 63); Rotation xRotation = new Rotation(Line.XAxis, xAngle); Point displacementPoint = Point.MakePointWithInches(0, 0, 1); Shift ninetyShift = new Shift(xRotation, displacementPoint); Polyhedron s = new Polyhedron(polyhedron.Shift(ninetyShift)); Polyhedron s2 = s.Shift(ninetyShift.Inverse()); s2.Should().Be(polyhedron); }