boolean code error

sorry ~ many ask ~

i made this code too
this is boolean code about selected face

i tested many times

but i dont know error problem well
pls teach again ~~~

bigbox = selection[1]

faces_sel=polyOp.getFaceSelection selection[1];
polyOp.detachFaces selection[1] faces_sel delete:false asNode:true name:"newface"

smallface = copy $newface ;delete $newface

converttopoly smallface

polyop.extrudefaces smallface (polyop.getfaceselection smallface) (-100)

snapMode.active=false

ProBoolean.createBooleanObjects bigbox smallface 2 0 0
ProBoolean.SetPlanarEdgeRemoval bigbox 3

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

Try to cap holes of the extracted mesh and flip its normals before performing boolean operations

dussla's picture

tested , but still error

i tested~ but still error
pls what problem ?

bigbox = selection[1]

faces_sel=polyOp.getFaceSelection selection[1];
polyOp.detachFaces selection[1] faces_sel delete:false asNode:true name:"newface"

smallface = copy $newface ;delete $newface

converttopoly smallface

converttopoly bigbox

polyop.extrudefaces smallface (polyop.getfaceselection smallface) (-100)

snapMode.active=false
select smallface

modPanel.addModToSelection (Cap_Holes ()) ui:on
modPanel.addModToSelection (Normalmodifier ()) ui:on

ProBoolean.createBooleanObjects bigbox smallface 2 0 0
ProBoolean.SetPlanarEdgeRemoval bigbox 3

--boolObj.createBooleanObject bigbox

--boolObj.setBoolOp bigbox 3
--boolObj.SetOperandB bigbox smallface 4 2

AttachmentSize
booltest.max 208 KB
jahman's picture

.

I didn't test it on your scene file. Script kinda works on my test geometry, so these errors you're having are most likely geometry/topology/selection dependent. I don't know what you can do about that. As a general rule you'd better stay away from using boolean as long as you can.

These two lines certainly make no sense. First you make a copy of $newface object and then delete $newface object for no reason.

smallface = copy $newface
delete $newface
dussla's picture

thank you again ~~

Thanks for good advice
The script works fine
But sometimes an error occurs
It doesn’t produce a clean and clean result.
Like you said, it's better not to use it.
Thank you~~

dussla's picture

hahaha . ok thank you

i will try
really thank you again ~~

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.