0
$\begingroup$

The volume of an object resulted from a boolean operation is "sometimes" a negative number. Why is this happening? If I export this object as an STL file and import it back, the volume of the imported object is properly presented.

Here is what I did.

(1) A boolean operation (intersect) with Object_1 and Object_2

b = Object_1.modifiers.new(name='booly', type='BOOLEAN')
b.object = Object_2 
b.operation = 'INTERSECT' 
bpy.ops.object.modifier_apply({"object": Object_1},apply_as='DATA',modifier=b.name)

(2) Calculating the volume of Object_1 resulted from Step 1

bm = bmesh.new()
bm.from_mesh(Object_1.data)
bm.calc_volume(signed=True) 

enter image description here

(3) Exporting Object_1 resulted from Step 1 as an STL file and then importing it (importedObject) back.

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

I have figured it out! In this case, the object that is generated from a boolean operation should go through a triangulation.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .