public static Body CreateRevolvedCurve(Line axis, ITrimmedCurve curve)
        {
            Point point = curve.Geometry.Evaluate(curve.Bounds.Middle()).Point;
            Debug.Assert(Accuracy.LengthIsPositive((axis.ProjectPoint(point).Point - point).Magnitude));

            Plane plane = null;
            bool success = AddInHelper.TryCreatePlaneFromPoints(new Point[]{
                axis.Origin,
                axis.Evaluate(1).Point,
                point
            }, out plane);

            Debug.Assert(success, "Could not create plane through points.");

            Point axisStart = axis.ProjectPoint(curve.StartPoint).Point;
            Point axisEnd = axis.ProjectPoint(curve.EndPoint).Point;

            var profile = new List<ITrimmedCurve>();
            profile.Add(curve);

            if (axisStart != curve.StartPoint)
                profile.Add(CurveSegment.Create(axisStart, curve.StartPoint));

            if (axisEnd != curve.EndPoint)
                profile.Add(CurveSegment.Create(axisEnd, curve.EndPoint));

            profile.Add(CurveSegment.Create(axisStart, axisEnd));

            try {
                Body body = Body.SweepProfile(Plane.PlaneZX, profile, new ITrimmedCurve[] {
                    CurveSegment.Create(Circle.Create(Frame.World, 1))
                });

                body.DeleteFaces(body.Faces.Where(f => f.Geometry is Plane).ToArray(), RepairAction.None);
                return body;
            }
            catch {
                return null;
            }
        }