Пример #1
0
        public void AddCentroid()
        {
            Centroid cent = PlotterUtil.Centroid(DB.GetSelectedFigList());

            if (cent.IsInvalid)
            {
                return;
            }

            CadFigure pointFig = mDB.NewFigure(CadFigure.Types.POINT);

            pointFig.AddPoint((CadVertex)cent.Point);

            pointFig.EndCreate(DC);

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

            HistoryMan.foward(ope);
            CurrentLayer.AddFigure(pointFig);

            string s = string.Format("({0:0.000},{1:0.000},{2:0.000})",
                                     cent.Point.X, cent.Point.Y, cent.Point.Z);

            ItConsole.println("Centroid:" + s);
            ItConsole.println("Area:" + (cent.Area / 100).ToString() + "(㎠)");
        }
Пример #2
0
        public double AreaOfSelected()
        {
            double area = PlotterUtil.Area(Controller.DB.GetSelectedFigList());

            ItConsole.println("Area: " + AnsiEsc.BYellow + (area / 100).ToString());

            return(area);
        }
Пример #3
0
        public Vector3d CentroidOfSelected()
        {
            Centroid c = PlotterUtil.Centroid(Controller.DB.GetSelectedFigList());

            return(c.Point);
        }