BSpline Surface Intersection Question

Does anyone know why if I use the boolean Section operation to find the intersection between a bspline surface (it happens to be a ruled surface between two identical arcs offset in space) and a plane, the intersection line (arc in this case) comes back as two segments. The two arc segments do, together, form the correct intersection arc, but why did it not just return a single arc?


Stephane Routelous's picture

Hi Tom,

Perhaps you can try to read the OCC code to see what happens ?

Tom_MacAdam's picture

I took your advice, and after much tracing, here is what I know:

Everything seems fine until I get to the point of calling:


from IntPatch_TheIPIntOfIntersection::Perform(). This probably means nothing on its own, so my call stack at this point is:

IntPatch_TheIPIntOfIntersection::Perform(…) line 1224
IntPatch_TheIPIntOfIntersection::IntPatch_TheIPIntOfIntersection(…) line 18
IntPatch_Intersection::Perform(…) line 318
TopOpeBRep_FacesIntersector::Perform(…) line 172
TopOpeBRep_ShapeIntersector::FindFFIntersection() line 453
TopOpeBRep_ShapeIntersector::InitFFIntersection() line 418
TopOpeBRep_ShapeIntersector::InitIntersection(…) line 199
TopOpeBRep_DSFiller::InsertIntersection(…) line 291
BRepAlgoAPI_BooleanOperation::PerformDS() line 123
BRepAlgoAPI_Section::Build() line 297

When I said everything seems fine, that is I think that the geometric intersection seems to be calculated fine (it was a "Geom-Param" intersection between the plane and the BSpline surface and the points defining the intersection line are what I'd expect).

So at the point of calling theRstInt::PutVertexOnLine(), as far as I can tell, it is going to insert some verticies onto the geometric intersection line according to the bounds of my surfaces.

At this point, however, is where the problem occurs. I would expect only two verticies to be inserted into the line - those at the begin and end points of the line. This is not the case, however, as a third vertex is inserted at the center of the intersection line. The vertex results from a "tangent zone" being calculated using the IntPatch_SearchPnt class within this function (on line 470). If Commun_NbTangentZones comes back zero instead of one, then everything works OK (i.e. no third vertex is added). (the tangent zone is found on the second of three passes through the loop that calls the IntPatch_SearchPnt class)

I know this is a lot of detail, but I can't see any other way of conveying what's going on. I am hoping that someone out there is very familiar with this chunk of code and can at least tell me if this is a bug or not. I feel that it is, since I would expect this operation to only return one intersection edge, but I could be ignorant of some criteria that would rightly dictate that two edges should be returned (like something concerning tangent zones). Can anyone help me out?

Many thanks,

P.S. If it would help, I can also try to extract out some code that would set up the problem if someone wanted to give it a try themselves...

Stephane Routelous's picture

You can also register a bug if you think this behaviour is wrong.