Brep Plane Intersection fails

In the context of a more extensive script, I need the intersection curves between a surface and the offset of the tangential planes of various points on said surface.

I have noticed that there are areas on the surface for which the Brep | Plane (Sec)
component does not give a reliable result for the intersection curves. It does not matter in which scale the operation is performed. Furthermore, Python could not determine the intersection curves using Rhino.Geometry.Intersect.Intersection.BrepPlane() either, just like Rhino itself after the geometry was baked.
What finally helped was to scale the surface from the intersection plane 1-dimensionally in the direction of the plane normal.

Now I have noticed with another surface that this unfortunately gives exactly the opposite result and scaling the surface means that the section curves are no longer found reliably in contrast to the non-scaled surface.

How can this behavior be explained, is it a bug in the intersection algorithm?

BrepPlaneIntersect.gh (308.2 KB) is a file with two exemplary surfaces, which either only provide the expected intersection curves when scaled or when not scaled, if anyone would like to take a look for themselves.

Thanks in advance :slight_smile:

Seems like bug

Is there an official way to report it as a bug?

I think locally the surface is to close to planar and the intersection is below tolerance.

I scaled the surface by factor 10 along an estimated best fit plane and used the inverse transformation to show the result.

BrepPlaneIntersect_scaled.gh (27.9 KB)

1 Like

That may well be true, but there are several aspects of this code that look odd to me.

I see no obvious reason that both Srf inputs are reparameterized :question: Yet if you don’t do that, the PxS (Plane Through Shape) surfaces are profoundly affected :interrobang:

For some parameter values, BBX (Brep | Brep intersection) in the second group works when Sec (Brep | Plane intersection) fails. Not so in the first group.

What is the point of using Pl Offset (Plane Offset) :question:
What is the point of using Scale NU :question:

In the second group, reducing the ‘Scale Z’ slider value makes the second BBX intersection appear.

There are other anomalies but I suspect both groups could work if the code and/or parameter values are changed.

That was also my first thought, but an analysis of the surface curvature has shown that there are even more planar areas where, interestingly, it works perfectly, so perhaps it is a combination of this and other influencing factors.

Very interesting approach, thanks for sharing. Unfortunately this works well for this point but also leads to incomplete intersection curves a bit further with a v-coordinate of 0.663 - 0.684, after that it seems to work well again.
So if I do it with an array of points over the entire surface, there are always a few points for which it doesn’t work, unfortunately.

The reason for reparameterizing was that the points on the surface can be conveniently set with sliders between 0 and 1.

If I do not change the u-, v-coordinates accordingly, the position on the surface is of course extremely influenced, but as soon as these are adapted to the non-reparametrized surface, the same errors occur when intersecting as before.

This is an exciting insight, but as you have correctly stated, it unfortunately does not help in all cases.
However, BBX (Brep | Brep intersection) is excitingly much faster to compute than Sec (Brep | Plane intersection)

The idea was to avoid such squiggles and to generate one clean section curve per side.


As described in the original post, this was the first effective workaround to greatly reduce the areas on the surface where the intersection fails / does not deliver the expected result. Even if it unfortunately cannot completely rule them out.

That’s true, but the goal is to have such a robust code and parameters that it is possible to achieve a reliable result for “all” the points on all kinds of different surfaces (within reasons) without having to fiddle with the settings every time. That would be the advantage of the parametric approach.

Ah yes, I see that now. I grew weary of studying the code and gave up, especially because I had so many questions and your troubles appeared to be contrived. They still do.

Pl Offset (Plane Offset) is a pointless distraction.

The “bug” is an easily avoided edge case anomaly of your own creation.