Your Ad Here

Go to: Synopsis. Return value. MEL examples.

Synopsis

computePolysetVolume

Prints the total volume of all polysets on the pick list. For accurate results the geometry should be closed, with no holes or minimal gaps and no interpenetrating surfaces( such as as two overlapping spheres ). The method uses the divergence theorem: \int_{vol} Div(f) dV = int_{surf} Dot(f,n) dS To use it to compute volumes set f=(0,0,z), you then have Volume = \int_{vol} 1 dV = int_{surf} n_z(u,v) du dv Where n_z is the "z" component of the normal to the surface at the parameter value (u,v). If you only have triangles then the formula reads: Volume = sum_{over all triangles} (z0+z1+z2)/3*n_z*A

Arguments

Variable Name Variable type Description
None.

Return value

None

MEL examples

	// Create a poly cube and find its volume 
  polyCube;
 // Result: pCube2 polyCube1 //
 computePolysetVolume;
 // pCube3 faces = 6 //
 // TOTAL VOLUME = 1 //

Return to Autodesk Index


Your Ad Here