示例#1
0
        public void HintLinesSketch()
        {
            var ctx = Context.Current;

            var sketch = TestSketchGenerator.CreateSketch(createBody: true);

            var array = CircularArray.Create(sketch.Body);

            array.Quantity      = 4;
            array.Radius        = 50;
            array.OriginalAngle = 20;
            array.Range         = 220;
            array.Alignment     = CircularArray.AlignmentMode.Center;
            Assume.That(array.Make(Shape.MakeFlags.None));

            ctx.ViewportController.ZoomFitAll();
            ctx.WorkspaceController.Selection.SelectEntity(array.Body);
            var editor = Editor.CreateEditor(array);

            editor.Start();

            Assert.Multiple(() =>
            {
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSketch"));

                // Cleanup
                editor.Stop();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSketch_Clean"));
            });
        }
示例#2
0
        public void SolidDefault()
        {
            var solid = TestGeomGenerator.CreateImprint();

            var array = CircularArray.Create(solid.Body);

            array.Quantity = 4;
            array.Radius   = 50;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            Assert.AreEqual(ShapeType.Solid, array.ShapeType);
            AssertHelper.IsSameModel(array, Path.Combine(_BasePath, "SolidDefault"));
        }
示例#3
0
        public void SketchRange()
        {
            var sketch = TestSketchGenerator.CreateSketch(TestSketchGenerator.SketchType.SimpleAsymmetric, true);

            var array = CircularArray.Create(sketch.Body);

            array.Quantity = 4;
            array.Radius   = 50;
            array.Range    = 180;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            Assert.AreEqual(ShapeType.Sketch, array.ShapeType);
            AssertHelper.IsSameModel2D(array, Path.Combine(_BasePath, "SketchRange"));
        }
示例#4
0
        public void SketchDefault()
        {
            var sketch = TestSketchGenerator.CreateSketch(TestSketchGenerator.SketchType.SimpleAsymmetric, true);

            var array = CircularArray.Create(sketch.Body);

            array.Quantity = 4;
            array.Radius   = 50;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            Assert.AreEqual(ShapeType.Sketch, array.ShapeType);
            AssertHelper.IsSameModel2D(array, Path.Combine(_BasePath, "SketchDefault"));

            // Ensure that original shape is still unmodified
            AssertHelper.IsSameModel2D(sketch, Path.Combine(_BasePath, "SketchDefaultUnmodified"));
        }
示例#5
0
        public void SolidOriginalAngle()
        {
            var solid = TestGeomGenerator.CreateImprint();

            var array = CircularArray.Create(solid.Body);

            array.Quantity      = 4;
            array.Radius        = 50;
            array.OriginalAngle = 30;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            Assert.AreEqual(ShapeType.Solid, array.ShapeType);
            AssertHelper.IsSameModel(array, Path.Combine(_BasePath, "SolidOriginalAngle"));

            array.Plane = CircularArray.PlaneType.ZX;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            AssertHelper.IsSameModel(array, Path.Combine(_BasePath, "SolidOriginalAngleZX"));

            array.Plane = CircularArray.PlaneType.YZ;
            Assert.IsTrue(array.Make(Shape.MakeFlags.None));
            AssertHelper.IsSameModel(array, Path.Combine(_BasePath, "SolidOriginalAngleYZ"));
        }
示例#6
0
        public void HintLinesSolid()
        {
            var ctx = Context.Current;

            var solid = TestGeomGenerator.CreateImprint();

            var array = CircularArray.Create(solid.Body);

            array.Quantity      = 4;
            array.Radius        = 50;
            array.OriginalAngle = 20;
            array.Range         = 220;
            array.Alignment     = CircularArray.AlignmentMode.Center;
            Assume.That(array.Make(Shape.MakeFlags.None));

            ctx.ViewportController.ZoomFitAll();
            ctx.WorkspaceController.Selection.SelectEntity(array.Body);
            var editor = Editor.CreateEditor(array);

            editor.Start();

            Assert.Multiple(() =>
            {
                array.Plane = CircularArray.PlaneType.XY;
                ctx.ViewportController.ZoomFitAll();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSolid_XY"));
                array.Plane = CircularArray.PlaneType.YZ;
                ctx.ViewportController.ZoomFitAll();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSolid_YZ"));
                array.Plane = CircularArray.PlaneType.ZX;
                ctx.ViewportController.ZoomFitAll();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSolid_ZX"));

                // Cleanup
                editor.Stop();
                AssertHelper.IsSameViewport(Path.Combine(_BasePath, "HintLinesSolid_Clean"));
            });
        }