Table of contents for this page:
The above mass property calculations are defined as volume integrals of a given function over a closed region. The algorithm to compute these values when a boundary representation is used, is simply is to convert these volume integrals to surface integrals, using the divergence theorem, and then to approximately calculate the surface integrals using a quadrature rule.
To compute the continuous surface integral over the bounding surface, two different quadrature rules are used, depending on the input data. The first rule, used for piecewise linear surfaces, is a four point quadrature rule defined over a triangle. This means the continuous integral over a triangular region is computed as a discrete sum which is exact for polynomials up to degree three (cubic). This is both sufficient and necessary if moments of inertia are desired. Arbitrary polygons with one or more contours (concave or convex) are split into triangular components with a normal computed for each triangle (to insure that concave sections yield negative results). The calculations are then accumulated for the entire surface by summing up the calculations for all the triangles. The second rule is a 12 point rule which is exact for polynomial equations of degree 7 or less. This rule will calculate the mass properties identified above exactly for a volume bounded by bilinear surfaces. The 12 point rule is again sufficient and necessary to compute the moments of inertia exactly (up to round-off).
The two quadrature rules provide a number of strategies for computing the mass properties of a volume bounded by non-uniform rational B-splines. The first quadrature rule provides an algorithm that computes the exact mass properties for an arbitrary polyhedral volume. Surfaces may be subdivided into a polygonal representation and then the mass properties of the polyhedral volume can be calculated exactly. Empirical evidence shows that the convergence rate for the linear approximation in this case is rather slow, however. The second option is to operate on surfaces directly. The calc program has the ability to subdivide surfaces to an acceptable level and then to approximate them with a bilinear surface and calculate the mass properties using the second quadrature rule. This produces better results using less data. The subdivision is done depth first to eliminate high memory usage. A combination of surfaces and polygons is also acceptable, provided the set of objects bounds some volume. Such cases can arise when processing the results of a boolean combination of volumes bounded by B-splines (see Solid Modeling.)
The calc program produces textual output describing the results and the input and puts it on standard out. The number of surfaces and polygons used for the calculations are reported, along with the surface area, volume, mass, center of gravity (x,y,z), and the moments of inertia about the three axes that are calculated. A moment of inertia can also be calculated about an arbitrary axis (see below). Diagnostics are printed when degenerate (zero area) polygons are detected or degenerate objects (zero mass) are detected. Degenerate polygons are ignored, but degenerate objects cause program termination.
Usage:
calc filesThe switches for calc are described below. Values can be set either on the command line or in a state file.
- Output
- textfile The calculated mass properties are reported.
- files
- objectstream The geometric data for which mass properties are to be computed.
If an arbitrary axis is specified, a fourth moment of inertia is computed about that axis. If only a direction is specified with the calc.axis switch, then the axis is assumed to pass through the origin. If an origin is given with the calc.origin switch, the axis used will pass through the given point in the given direction.
- calc.axis
- If set, defines an arbitrary axis to use for a moment of inertia. The default is 0,0,1 .
- calc.density
- Set the density of the material. The default is 1.0 .
- calc.flip
- If on (the default), reverse the normal orientation of all the input.
- calc.origin
- If set, defines the origin for the arbitrary axis. The default is (0,0,0).
- calc.arbaxis
- If set, use an arbitrary axis specified by calc.axis . The default is off.
- calc.objresolution
- The resolution to use in subdivision if none is specified on the individual surfaces. Default is 0.1 .