public class SolidPolygonMesh extends AbstractCompositeShape
A renderable mesh composed of SolidPolygon triangles.

This is a generic composite shape that holds a collection of triangles. It can be constructed from any source of triangles, such as CSG operation results or procedural geometry generation.

Usage:


 // From CSG result with fluent configuration
 shapes.addShape(CSGSolid.subtract(cube, sphere).toMesh(location)
     .setShadingEnabled(true)
     .setBackfaceCulling(true));

 // From list of triangles
 List<SolidPolygon> triangles = ...;
 SolidPolygonMesh mesh = new SolidPolygonMesh(triangles, location);
 
See Also:
  • Constructor Details

    • SolidPolygonMesh

      public SolidPolygonMesh(List<SolidPolygon> triangles, Point3D location)
      Creates a mesh from a list of SolidPolygon triangles.
      Parameters:
      triangles - the triangles to include in the mesh
      location - the position in 3D space
  • Method Details

    • getTriangleCount

      public int getTriangleCount()
      Returns the number of triangles in this mesh.
      Returns:
      the triangle count