Carve is robust.

A correctly computed union of three cylinders with degenerate triangulation. The inset shows a magnification of the intersection of degenerate triangles.

Carve emphasises robustness in the face of the inherent inexactness of floating point calculation.

While other CSG libraries achieve robustness through the use of extended precision or 'exact' numeric types, which are significantly slower than native numeric types, Carve produces robust results using IEEE double precision values. As a result, Carve is significantly more robust than other CSG libraries using standard precision, and significantly faster than other CSG libraries which rely on extended precision.

Carve handles complex faces.

Subtraction of a cube from a torus. Both the cube and the torus are constructed from quadrilateral faces, and the result contains single faces for the intersection surfaces. Hooks exist to provide triangulation of output, if desired.

Apart from requiring planar faces that are not self intersecting, Carve places no restrictions on the form of input data. Faces that make up surfaces may have an arbitrary number of edges, and are not required to be convex. Carve does not produce triangulated output, which protects against errors caused by poor triangulation that can impact subsequent CSG operations.

If triangulated output is required, we recommend that it be performed as a post processing step on the final result. Alternatively, hooks exist in Carve to allow a 3rd party triangulator to tesselate faces before the final result is produced.

Carve handles open surfaces.

An open surface is intersected by a closed cube. To the right is shown the classification of the resulting regions of the open surface with respect to the cube, with blue representing portions of the surface interior to the cube, and red repesenting exterior portions of the surface.

Carve accepts both closed and open surfaces as input. Boolean operations are not defined for open surfaces, but Carve is able to provide above/below orientation for surfaces intersecting open surfaces. Detailed classification information is available with respect to closed surfaces.

Carve handles complex surfaces.

In this example, a hollow shell has been constructed by subtracting a small sphere from a larger sphere. The hollow shell consists of two non intersecting closed surfaces, one embedded within the other. A cube is then subtracted from this complex surface, producing the desired result.

Inputs to Carve are constructed from sets of vertices and faces defined with respect to those vertices. Carve uses connectivity and orientation information to correctly group faces into closed and open surfaces, and determine embedding information for closed surfaces. Cases in which surfaces share vertices, edges or faces are correctly handled.

The only restrictions placed upon inputs are that surfaces should not be self intersecting, and that embedded closed surfaces be consistenly oriented with respect to their embedding surfaces.

Carve handles large datasets.

In this example, a model consisting of 5 embedded hollow shells (10 surfaces, 51,240 vertices, 102,400 faces) is intersected with two slightly shifted copies of itself. The resulting model consists of 784 distinct closed surfaces, 107,570 vertices, and 88,724 faces.

Carve has been designed with large datasets in mind. An adaptive spatial subdivision system ensures that calculation of intersections scales well with increasing input size. Carve has been profiled throughout its development in order to identify and remove bottlenecks and poorly scaling algorithms. Similarly, efforts have been made to keep memory usage to a minimum during calculations.

As a result, Carve is able to handle inputs of more than 100,000 vertices with ease.

Carve supports vertex interpolation.

A torus is subtracted from a cube with per vertex colour attributes. The vertex colours are interpolated across the faces, producing correct vertex colours for the vertices introduced by the CSG operation.

Because CSG operations create new vertices in output polyhedra, it is common for information such as vertex colour and texture coordinates to be discarded by CSG operations. This makes the use of CSG operations particularly problematic in 3d modelling software. Carve provides a mechanism for associating arbitrary data with the vertices of a face, and for interpolating that data to derive values for new vertices as they are created, regardless of the number of vertices from which the original face is constructed.

For details on the algorithm used for interpolation, refer to Mean Value Coordinates for Arbitrary Planar Polygons (Hormann)