Beispiel #1
0
        public void MakeRotatingBody(uint baseFigID, Vector3d org, Vector3d axis, bool topCap, bool btmCap)
        {
            CadFigure baseFig = GetFigure(baseFigID);

            if (baseFig == null)
            {
                return;
            }

            if (baseFig.Type != CadFigure.Types.POLY_LINES)
            {
                return;
            }

            CadMesh cm = MeshMaker.CreateRotatingBody(32, org, axis, baseFig.PointList, topCap, btmCap, MeshMaker.FaceType.TRIANGLE);

            CadFigure fig = MesthToFig(cm);

            CadOpe ope = new CadOpeAddFigure(Controller.CurrentLayer.ID, fig.ID);

            Session.AddOpe(ope);
            Controller.CurrentLayer.AddFigure(fig);

            ope = new CadOpeRemoveFigure(Controller.CurrentLayer, baseFig.ID);
            Session.AddOpe(ope);
            Controller.CurrentLayer.RemoveFigureByID(baseFig.ID);

            Session.PostRemakeObjectTree();
        }
Beispiel #2
0
        public void Test()
        {
            CadFigure baseFig = GetTargetFigure();

            if (baseFig == null)
            {
                return;
            }

            if (baseFig.Type != CadFigure.Types.POLY_LINES)
            {
                return;
            }

            (Vector3d p1, Vector3d p2) = InputLine();

            Vector3d org  = p1;
            Vector3d axis = (p2 - p1).Normalized();

            CadMesh cm = MeshMaker.CreateRotatingBody(32, org, axis, baseFig.PointList, false, false, MeshMaker.FaceType.QUADRANGLE);

            CadFigure fig = MesthToFig(cm);

            CadOpe ope = new CadOpeAddFigure(Controller.CurrentLayer.ID, fig.ID);

            Session.AddOpe(ope);
            Controller.CurrentLayer.AddFigure(fig);

            Session.PostRemakeObjectTree();
        }