Skip to content

Help with volume estimation error #1059

Answered by marcomusy
orefram asked this question in Q&A
Discussion options

You must be logged in to vote

As you can see you have colliding faces! Allow a small tolerance to avoid it:

from vedo import *

cube_a = Box(pos = (10,10,10), size=(10, 10, 10)).triangulate().alpha(0.2)
cube_b = Box(pos = (10,15,10), size=(10, 10, 10)).triangulate().c("purple5")
cube_a.scale(1.001)  # make it a bit bigger to avoid colliding faces
intersection_ab=  cube_a.boolean("intersect", cube_b).c('blue5')

print('Vol. Intersection = ', intersection_ab.volume())
show([[cube_a, cube_b], intersection_ab], N=2, axes=1, viewup='z').close()

Vol. Intersection =  500.500011444092

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcomusy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants