Ejemplo n.º 1
0
        public AcadDB.Ellipse EllipseToNativeDB(Ellipse ellipse)
        {
            var normal      = VectorToNative(ellipse.plane.normal);
            var majorAxis   = ScaleToNative((double)ellipse.firstRadius, ellipse.units) * VectorToNative(ellipse.plane.xdir);
            var radiusRatio = (double)ellipse.secondRadius / (double)ellipse.firstRadius;

            return(new AcadDB.Ellipse(PointToNative(ellipse.plane.origin), normal, majorAxis, radiusRatio, 0, 2 * Math.PI));
        }
Ejemplo n.º 2
0
        // Ellipses
        // TODO: fix major/minor vs x axis/yaxis distinction in conversions after speckle firstRadius & secondRadius def is set
        public Ellipse EllipseToSpeckle(AcadDB.Ellipse ellipse)
        {
            var _ellipse = new Ellipse(PlaneToSpeckle(ellipse.GetPlane()), ellipse.MajorRadius, ellipse.MinorRadius, ModelUnits);

            _ellipse.domain = new Interval(ellipse.StartParam, ellipse.EndParam);
            _ellipse.length = ellipse.GetDistanceAtParameter(ellipse.EndParam);
            _ellipse.bbox   = BoxToSpeckle(ellipse.GeometricExtents, true);
            return(_ellipse);
        }