Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Different behaviour of boolean difference between GUI and PythonScript

$
0
0

@Nathan_Clero wrote:

Hi everyone !

I'm having an issue with BooleanDifference. Basically i have two closed polysurfaces: a symmetrical boat (X-axis) and a box all over the port side of the boat (Y>=0). So as to be clear, port side ('left side') of the boat is inside the box while starboard side ('right side') is outside the box. I want to perform a boolean difference so as to get the box minus the boat.

My issue is: if i do it in the GUI with boolean difference selecting subtract from BOX and subtract with BOAT it works fine. But, if I use the following script, it deletes everything ... (I already verified that the 2 first lines were selecting the right solid)
box = rs.FirstObject(select = True) #select the box
ship = rs.InvertSelectedObjects() #select the boat
bool = rs.BooleanDifference(box, ship)

And if I print "bool" it shows me: []

Any thoughts ? Am i clear enough ?

I also tried to do it with simple geometries (a box and a sphere), trying to subtract half of the sphere from the box, and this time, the result with the script is quite random ... Or i get the right thing, i.e the box minus half oh the sphere, or i get the "other part" of the sphere, the one which does not intersect the box.

Thanks a lot,
Nathan

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles