Multiple intersection curves for closed polysurface

Hi,

I run into an issue I did not have before, where the intersection between 2 breps creates 2 curves where only 1 is expected. I never ran into an issue with this before so maybe it’s introduced in one of the latest releases.


With the file and script it’s possible to reproduce the issue:

bad_intersect.3dm (127.5 KB)

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino

tol = sc.doc.ModelAbsoluteTolerance

plane_brep = rs.coercebrep(rs.ObjectsByName('plane')[0])
part_brep = rs.coercebrep(rs.ObjectsByName('part')[0])

bln,section_curves,pts = Rhino.Geometry.Intersect.Intersection.BrepBrep(part_brep,plane_brep,tol)

print 'found {} sectioncurves '.format(len(section_curves))
_ = [sc.doc.Objects.AddCurve(c) for c in section_curves]

Thanks
-Willem

Hi @Willem,

Unlike the Intersect command, the Intersection.BrepBrep function does not join intersection curves. You can do this yourself using Curve.JoinCurves.

– Dale

Hi @dale

As a workaround I indeed Join the resulting curves.

However
How come than that the U shaped curve of the intersection is already joined?
image

I create multiple of such intersections through this Brep and for other planes intersecting I do get fully joined rectangles.

What would be the cause of some of these being closed curves where others are not?
Since I did not get this behavior before I strongly suspect there to be a change in the intersector.
But I might of course be wrong.

-Willem

Hi @Willem,

This isn’t something I can easily answer - sorry.

– Dale

Hi Dale,

Ok that is clear, I’ll keep joining the result as a means to ensure expected outcome.

Thanks
-Willem