Ejemplo n.º 1
0
        public override void Run(RenderControl render)
        {
            var deep   = 8.0f;
            var radius = 6;
            var width  = 100;

            var frameNode = CreateFrames(width, 50, deep, 6);

            render.ShowSceneNode(frameNode);

            var ax    = new GAx2(new GPnt(radius, (deep - 2) / 2, radius), GP.DZ());
            var glass = CreateGlass(ax, width - radius * 2, 50 - radius * 2, 2);

            render.ShowSceneNode(glass);

            var dim = new AlignedDimensionNode(new Vector3(0, deep * 0.5f, 0), new Vector3(width, deep * 0.5f, 0),
                                               -10, new Vector3(0, -1, 0), "100");

            dim.Update();
            render.ShowSceneNode(dim);
        }
        public override void Run(RenderControl render)
        {
            GPntList points = new GPntList();

            points.Add(new GPnt(-100, 0, 0));
            points.Add(new GPnt(100, 0, 0));
            points.Add(new GPnt(0, 100, 0));

            var shape = SketchBuilder.MakePolygon(points, true);

            render.ShowShape(shape, ColorTable.Red);

            var dim1 = new AlignedDimensionNode(new Vector3(-100, 0, 0), new Vector3(0, 100, 0), 20, Vector3.UNIT_Z, "长度");

            dim1.GetMaterial().SetColor(ColorTable.Green);
            dim1.Update();
            render.ShowSceneNode(dim1);

            var dim2 = new LinearDimensionNode(new Vector3(100, 0, 0), new Vector3(0, 100, 0), new Vector3(120, 0, 0), -90, "高度");

            dim2.Update();
            render.ShowSceneNode(dim2);
        }