Topmost surface identification from BREP

Hello everyone.

To be able to parametrize sanding trajectories on a robot, I need to extract on the topmost surfaces from the following BREP, to get the lines in green (by intersection of plane and surfaces):

I deconstruct BREP, get the surfaces, and pick thosz with a normal with a cross product with 0,0,1 different from 0.

Then I get the intersection between a set of planes and the surfaces.

Issue is, I have a weird surface inside the BREP, giving the short green lines in the middle, that I want to avoid. Also, I dont want the surfaces insides the four holes.

Do you have an idea how to extract the desired surfaces automatically ?

Thanks

Hello,

I would try to take the surfaces which normals’ dot product with 0,0,1 is strictly positive, join the result and take the largest brep in area from the remaining. But it’s hard to tell from just a picture.

Please upload example Breps if you need more assistance.

1 Like

Instead of messing with surface normals you could filter the highest segment per plane of intersections.

I don’t know if this works with your geometry because you didn’t post it. :man_facepalming:

1 Like

My bad. Here is the file.
Test part.3dm (610.2 KB)

Dont think it’s gonna work though, because lines are not planar. So I can’t be sure that the mid point is representative…

Any idea also, how to discard the surfaces of the holes?

here is one way …


test part____r1.gh (175.6 KB)

Thanks @rajeev_pulari for your answer. I had tried this way before, but it was quite complicated. Your solution is way more elegant.
Any idea how to get rid off these surfaces?

Is there a way to check wether surfaces are contiguous? And get rid off those that are not?

Thanks again

1 Like

As mentioned above, join your surfaces and only keep the largest one.

1 Like

Works like a charm, thanks a lot everyone.

1 Like