Boolean Difference is not working properly in Grasshopper Python for Rhino6

The result for the command rs.BooleanDifference in GhPython for Rhino6 is not working properly,
the result is a union. Its possible to see the code that i used in GhPython on the right side of the images, that i think its correct and its working properly in GhPython for Rhino5.

I send below two images:
Image 1 shows the two surfaces to make the subtraction between them;
Image 2 shows the result of the rs.BooleanDifference that is an union between the two surfaces.

Anyone can give me a clue to solve this problem? Thanks!


I would try checking the surface direction.
Since you haven’t provided any files, I can’t check that for you.

1 Like

when creating a 4 point surface, the order in which you select the first 3 points determines the direction of the surface normal (inside the Python component there is exactly your boolean difference script)


if the points are selected in opposite orders (not both clockwise/not both countercloskwise) as @christopher.ho pointed out, the resulting surface normals will be facing opposite directions, and the boolean in this case will work like: x - (-y) = x+y


you can confirm this is the case also by doing a rs.BooleanUnion of the two surfaces with opposite normals, the boolean in this case will work like x + (-y) = x-y

1 Like

So rather like the wrapping paper in the latest xkcd, if you invert the surface normals in your brep then it ´contains’ everything outside of its surface :smiley:

3 Likes

Yes, you´re right @christopher.ho, the problem was the drection of the normal vector of the surfaces.
Thank you!

Yes, @inno, you´re right! Problem solved, thanks for your help!

Right! Great point of view, @Dancergraham, problem solved. Thanks for your help! :smiley:

1 Like