I want to produce contours from a Brep but I cannot get Grasshopper to output the final contour - no matter how many planes I try, the final one is missing. Attached file shows the Brep Plane intersection issue, but Contour (Ex) does the same thing.

Thanks for your thoughts which have steered me toward investigating Rhino intersections some more.

The top is indeed not planar but in the general case a brep being processed could have any shape top, so the script is going to have to handle it. Changing the document tolerance to 0.01 does allow it to find an intersection, but I’d rather not assume I can do that for all models.

Rhino is showing some discrepancies between different types of intersection:

It generates a bounding box that, by definition, intersects the top of the brep.

Using a surface generated from the top of the bounding box, Rhino does not find an intersection with the brep.

Using the same surface, with a curve created from the top edge of the brep, Rhino does find a short intersection. (For the brep in the example, I would expect this to appear as the final contour).

Using a plane at the top of the brep, Grasshopper does not find an intersection with the brep.

Using the same plane, and the top edge of the brep, Grasshopper finds a Curve / Plane intersection at two points. The points are within the length of the intersection found at 3, but match neither its ends nor mid point.

@pascal, may I draw your attention to these discrepancies?

A bounding box will touch that top edge at one or more points but that doesn’t mean the top edge is planar. Cap Holes closes the bottom but not the top.

Better questions might be:

Why is the top edge not planar? That depends on how it was created.

What to do about the general case where top edges are not planar? Clearly that means using the top edge instead of a contour intersection.

In a different context these may indeed be better questions, but for now I want to focus on why Grasshopper is not producing the final intersection (even if it is only a point) and on why different parts of the Rhino ecosystem produce different answers for the intersection.

And now also (@pascal): why in this derived model (the plane’s z position has been reduced from 20 to 19.9997) do I get intersections at tolerances of 0.01 and 0.0001 but not at the intermediate 0.001? RandomShape.3dm (334.3 KB)

This turned out a little more complicated than one would hope, but it combines the top and bottom edges with closed section curves, culling duplicates (within 0.001 Z).