I am trying to check if a cube and a cone with 7 vertices (python will show 8) intersect or not. To do so, I am using a boolean intersect modifier and check how many vertices are there, after adding the modifier. If it is non-zero then they are intersecting otherwise not. I am running the following codes.
# read the objects and print number of vertices and faces cube = bpy.data.objects['Cube'] cone = bpy.data.objects['Cone'] print (len(cone.data.vertices),len(cube.data.vertices),len(cone.data.polygons),len(cube.data.polygons)) >> 8, 8, 8, 6 # select the cube and add intersect boolean modifier bpy.ops.object.select_all(action='DESELECT') cube.select_set(True) intra = cube.modifiers.new(type="BOOLEAN", name="intersctn") intra.object = cone intra.operation = 'INTERSECT' # check the number of vertices now print (len(cone.data.vertices),len(cube.data.vertices),len(cone.data.polygons),len(cube.data.polygons)) >> 8, 8, 8, 6
The issue is, whether they are intersecting or not - the number of vertices or faces returns the same as the original cube. I can clearly see that number of vertices and faces has increased after adding the boolean modifier but the python giving me the wrong result. When they are not intersected, the faces and vertices supposed to be 0, but I am still getting 8 and 6. Is this a common issue with the intersect boolean modifier or do I have to update something?