Model's volume using ruby api

thnx for your answer now i understand it.
but how can i get the volume for such a model, the B one ? as i need to calculate the volume of the entire model even if it has the shape of the “B” model ?