# Hole Geometries

To create a hollow shape, Vortex® supports three special kinds of shape geometries: sphere holes, cylinder holes, and box holes.

These hole geometries are placed inside their regular (non-hole) counterparts to create an arbitrary hollow volume.

To set up a hollow shape, you need to create a Vx::VxCompositeCollisionGeometry and then add the hole geometry and the larger geometry that will contain it like so:

Vx::VxBox* cgbox = new Vx::VxBox(4.0, 4.0, 4.0);
Vx::VxBoxHole* cgboxhole = new Vx::VxBoxHole(1.0, 1.0, 1.0);

VxCompositeCollisionGeometry* cgcomposite = new VxCompositeCollisionGeometry();
cgcomposite->addCollisionGeometry(cgboxHole);

In order to produce the correct behaviour of a hollow structure created by using a hole within a collision geometry and avoid unrealistic behaviour, follow these guidelines:

• The hole shape and the non-hole shape geometries should be a part of a composite collision geometry.
• The hole shape should be completely inside the non-hole shape.
The situation demonstrated on the left (top view) is not allowed; because the grey VxBoxHole area shares two faces with the VxBox. The situation on the right, however, is allowed since it shares only one face.
• Holes should not overlap (hole-to-hole interaction is not allowed in Vortex).
Here the lower face of the VxBoxHole does not need to be open, but neither can you close it. It will be opened automatically so that something inside the VxBoxHole can fall into the SphereHole.

In order to help with face alignment, a call to Vx::VxCompositeCollisionGeometry::snapHoleSurfaces() helps positioning, orienting and dimensioning the hole volume so that its surface gets perfectly aligned with the nearest surface on the containing volume:

cgcomposite->snapHoleSurfaces();

The flat faces in the box and cylinder holes may be turned off. A removed face should be aligned with a face of the collision geometry in which the hole is contained. All non-removed surface should be well within the primitive volume to minimize interference between contacts on the primitives and holes. Collision detection robustness will be affected by thin surfaces between primitives and holes as well as usage of soft contact material allowing deep volume interpenetration.

Collision detection inside a hole is only supported for the primitive volumes for and not for triangle meshes (non-primitives). However, holes in triangle meshes can be explicitly modeled via the mesh triangulation (by a 3D modeler).