Incomplete intersection nurbs surface with surface of revolution

I’ve go two surfaces, one surface of revolution which entirely encompasses a nurbs surface. If I try to find the intersection curve it only finds a part of the intersection. This also means I cannot trim the nurbs etc.

Incomplete_intersection.3dm (155.3 KB)

Hi @Arjan,

Get the NURB form of the surface of revolution, and then calculate the intersection of the the two NURBS surfaces.

https://mcneel.myjetbrains.com/youtrack/issue/RH-41125

– Dale

Hi @dale,

Getting the nurb form is not sufficient for this case (@Arjan is my co-worker and we’ve tried to solve this problem using the nurb form already). You actually need to rebuild the surface to get a decent intersection curve. Run the code below and the intersection on the nurb surface is the same as the intersection on the revolve surface.

public Result RunCommand(RhinoDoc doc, RunMode mode)
{
    ObjRef sRef;
    Result res = RhinoGet.GetOneObject("revolve-srf", false, ObjectType.Surface, out sRef);
    if (res != Result.Success)
        return res;

    doc.Objects.Select(sRef, false);

    ObjRef tRef;
    res = RhinoGet.GetOneObject("srf-2", false, ObjectType.Surface, out tRef);
    if (res != Result.Success)
        return res;

    Surface revSrf = sRef.Surface();
    Surface t = tRef.Surface();

    Curve[] cx;
    Point3d[] px;
    if (Intersection.SurfaceSurface(revSrf, t, doc.ModelAbsoluteTolerance, out cx, out px))
    {
        if (null != cx)
        {
            ObjectAttributes a = new ObjectAttributes {Name = "Intersection rev-surface"};
            foreach (var c in cx)
            {
                doc.Objects.AddCurve(c, a);
            }
        }
    }

    using (var ns = revSrf.ToNurbsSurface())
    {
        if (Intersection.SurfaceSurface(ns, t, doc.ModelAbsoluteTolerance, out cx, out px))
        {
            if (null != cx)
            {
                ObjectAttributes a = new ObjectAttributes { Name = "Intersection nurbs-surface" };
                foreach (var c in cx)
                {
                    doc.Objects.AddCurve(c, a);
                }
            }
        }
    }

    using (var rebuilt = revSrf.Rebuild(3, 3, 30, 30))
    {
        if (Intersection.SurfaceSurface(rebuilt, t, doc.ModelAbsoluteTolerance, out cx, out px))
        {
            if (null != cx)
            {
                ObjectAttributes a = new ObjectAttributes { Name = "Intersection rebuilt-surface" };
                foreach (var c in cx)
                {
                    doc.Objects.AddCurve(c, a);
                }
            }
        }
    }

    return Result.Success;
}

Yeah. It does’t work. The problem lies in the Curve/Surface intersector.

Hi @GregArden,

See attached file, this is one in the same category but has nothing to do with revolved surfaces. Again, due to an incomplete intersection operations like boolean union fail. I only have to slightly nudge the geometry to make it work.

intersectionFail.3dm (127.1 KB)

Made a bug report. The problem is a missed curve surface intersection point.