Пример #1
0
        public override void OnDraw(GeometryBuilder dc)
        {
            dc.Clear();
            dc.Color = McDbEntity.ByObject;//color will be taken from object properties and object will be redrawn after color change
            //dc.DrawPolyline(new Point3d[] { _pnt, _pnt1, _pnt2, _pnt3, _pnt });
            //dc.DrawPolyline(poly.GetTrimmedOffset(Height)[0]);

            BendingShape shape1 = new BendingShape(_pnt, _pnt1, Height, Thickness, Gap);
            BendingShape shape2 = new BendingShape(_pnt1, _pnt2, Height, Thickness);
            BendingShape shape3 = new BendingShape(_pnt2, _pnt3, Height, Thickness, Gap);
            BendingShape shape4 = new BendingShape(_pnt3, _pnt, Height, Thickness);

            Polyline3d poly = new Polyline3d(new List <Point3d> (shape1.Shape));

            poly.AddPoliline(new Polyline3d(new List <Point3d>(shape2.Shape)));
            poly.AddPoliline(new Polyline3d(new List <Point3d>(shape3.Shape)));
            poly.AddPoliline(new Polyline3d(new List <Point3d>(shape4.Shape)));
            poly.SetClosed(true);

            //CircArc3d test = new CircArc3d(_pnt1, new Vector3d(), new Vector3d(), 0.25, ((180 + _pnt.AngleTo(_pnt1)) * Math.PI / 180), (_pnt.AngleTo(_pnt1) * Math.PI / 180));
            //dc.DrawArc(test);

            //dc.DrawArc(_pnt1, 0.25, ((180+_pnt1.AngleTo(_pnt2)) * Math.PI/180), (_pnt1.AngleTo(_pnt2) * Math.PI/180));

            Polyline3d.VertexDataOfPolyline polyVertecies = poly.Vertices;
            for (int i = 0; i < polyVertecies.Count; i++)
            {
                polyVertecies.MakeFilletAtVertex(i + 1, Radius);
            }
            dc.DrawPolyline(poly);
        }
Пример #2
0
        public override void OnDraw(GeometryBuilder dc)
        {
            dc.Clear();
            dc.Color = McDbEntity.ByObject;

            BendingShape shape1 = new BendingShape(_pnt1, _pnt2, Height, Thickness, Gap);
            //BendingShape shape2 = new BendingShape(_pnt1, _pnt2, Height, Thickness);

            Polyline3d poly = new Polyline3d(new List <Point3d>(shape1.Shape));

            //poly.SetClosed(true);

            Polyline3d.VertexDataOfPolyline polyVertecies = poly.Vertices;
            for (int i = 0; i < polyVertecies.Count; i++)
            {
                polyVertecies.MakeFilletAtVertex(i + 1, Radius);
            }
            dc.DrawPolyline(poly);
        }