Example #1
0
        public static RevSurface ToRhino(this DB.ConicalSurface surface, DB.BoundingBoxUV bboxUV)
        {
            var ctol = Revit.ShortCurveTolerance;
            var atol = Revit.AngleTolerance * 10.0;
            var uu   = new Interval(bboxUV.Min.U - atol, bboxUV.Max.U + atol);
            var vv   = new Interval(bboxUV.Min.V - ctol, bboxUV.Max.V + ctol);

            var origin = surface.Origin.ToRhino();
            var xdir   = (Vector3d)surface.XDir.ToRhino();
            var zdir   = (Vector3d)surface.Axis.ToRhino();

            var axis = new Line(origin, origin + zdir);

            var dir = zdir + xdir * Math.Tan(surface.HalfAngle);

            dir.Unitize();

            var curve = new LineCurve
                        (
                new Line
                (
                    surface.Origin.ToRhino() + (dir * vv.Min),
                    surface.Origin.ToRhino() + (dir * vv.Max)
                ),
                vv.Min,
                vv.Max
                        );

            return(RevSurface.Create(curve, axis, uu.Min, uu.Max));
        }
Example #2
0
 public static RevSurface ToRhino(this DB.ConicalSurface surface, DB.BoundingBoxUV bboxUV) => FromConicalSurface
 (
     surface.Origin,
     surface.XDir,
     surface.YDir,
     surface.Axis,
     surface.HalfAngle,
     bboxUV
 );
Example #3
0
 public static RevSurface ToRhino(this DB.ConicalSurface surface, DB.BoundingBoxUV bboxUV) => RawDecoder.ToRhino(surface, bboxUV);