Tessellation and Voxelization Geometry Library
61
stars
2,414
commits
C#
primary language
Sep 7, 2026
updated
TVGL is a computational geometry library for .NET. It provides data structures and algorithms for triangle meshes, polygons, voxels, analytic surfaces, convex hulls, and solid-model analysis.
The repository also contains testing, benchmarking, file-conversion, and Windows desktop presentation projects. Some of these projects have platform-specific requirements beyond those of the core library.
Clone the repository and build the core library in Release configuration:
git clone https://github.com/DesignEngrLab/TVGL.git
cd TVGL
dotnet build TessellationAndVoxelizationGeometryLibrary/TessellationAndVoxelizationGeometryLibrary.csproj --configuration Release
Reference TessellationAndVoxelizationGeometryLibrary.csproj directly from your project.
Install it from NuGet with the .NET CLI:
dotnet add package TVGL --version 2.0.0
Or add the package reference directly to your project file:
<PackageReference Include="TVGL" Version="2.0.1" />
The following example constructs the three-dimensional convex hull of five points:
using System;
using System.Collections.Generic;
using TVGL;
var points = new List<Vector3>
{
new Vector3(0, 0, 0),
new Vector3(1, 0, 0),
new Vector3(0, 1, 0),
new Vector3(0, 0, 1),
new Vector3(0.2, 0.2, 0.2)
};
if (ConvexHull3D.Create(points, out var hull, out var hullVertexIndices))
{
Console.WriteLine($"Hull vertices: {hull.Vertices.Count}");
Console.WriteLine($"Hull edges: {hull.Edges.Count}");
Console.WriteLine($"Hull faces: {hull.Faces.Count}");
Console.WriteLine($"Input vertices on hull: {string.Join(", ", hullVertexIndices)}");
}
TVGL includes tools for:
Computational geometry is sensitive to degeneracies, floating-point precision, topology, and model scale. Callers should choose tolerances appropriate to their data and validate results when working with malformed, non-manifold, or nearly degenerate geometry.
Vector2, Vector3, and Vector4 represent coordinates and directions. Many TVGL algorithms are implemented as extension methods on vectors, vertices, faces, polygons, and solids.
Polygon represents a bounded two-dimensional contour. Polygon operations include containment queries, intersections, offsets, simplification, triangulation, and related planar geometry functions.
TessellatedSolid represents a three-dimensional boundary using vertices, edges, and triangular faces. TVGL includes operations for constructing, transforming, querying, modifying, and analyzing these meshes.
VoxelizedSolid represents geometry on a regular grid of cubic cells. Voxel models are useful when a discrete representation is preferable to exact boundary geometry, including some boolean, slicing, and analysis workflows.
TVGL models planes, cylinders, cones, spheres, tori, and more general conic and quadric surfaces. These types support geometric queries and the interpretation of analytic geometry found in tessellated models.
The core library contains readers and writers for several three-dimensional mesh formats, including:
Open a supported model using its file extension:
using TVGL;
Solid solid = IO.Open("part.stl");
For two-dimensional SVG, DXF, and DWG workflows, install the companion package:
dotnet add package TVGL.PolygonImportExport --version 2.0.0
The package exposes PolygonImportExport.SVG, PolygonImportExport.DXF, and PolygonImportExport.DWG. Format support varies between reading and writing; consult the relevant APIs before depending on round-trip conversion.
The repository contains introductory guides for several major areas of TVGL:
The public API also includes XML documentation for use in IntelliSense and generated reference documentation.
Bug reports and pull requests are welcome. Geometry bug reports are most useful when they include:
Please keep behavioral changes separate from formatting or documentation-only changes where practical, and include focused tests for geometry fixes.
TVGL is distributed under the MIT License.
C#
98.7%
Tessellation and Voxelization Geometry Library
61
stars
2,414
commits
C#
primary language
Sep 7, 2026
updated
TVGL is a computational geometry library for .NET. It provides data structures and algorithms for triangle meshes, polygons, voxels, analytic surfaces, convex hulls, and solid-model analysis.
The repository also contains testing, benchmarking, file-conversion, and Windows desktop presentation projects. Some of these projects have platform-specific requirements beyond those of the core library.
Clone the repository and build the core library in Release configuration:
git clone https://github.com/DesignEngrLab/TVGL.git
cd TVGL
dotnet build TessellationAndVoxelizationGeometryLibrary/TessellationAndVoxelizationGeometryLibrary.csproj --configuration Release
Reference TessellationAndVoxelizationGeometryLibrary.csproj directly from your project.
Install it from NuGet with the .NET CLI:
dotnet add package TVGL --version 2.0.0
Or add the package reference directly to your project file:
<PackageReference Include="TVGL" Version="2.0.1" />
The following example constructs the three-dimensional convex hull of five points:
using System;
using System.Collections.Generic;
using TVGL;
var points = new List<Vector3>
{
new Vector3(0, 0, 0),
new Vector3(1, 0, 0),
new Vector3(0, 1, 0),
new Vector3(0, 0, 1),
new Vector3(0.2, 0.2, 0.2)
};
if (ConvexHull3D.Create(points, out var hull, out var hullVertexIndices))
{
Console.WriteLine($"Hull vertices: {hull.Vertices.Count}");
Console.WriteLine($"Hull edges: {hull.Edges.Count}");
Console.WriteLine($"Hull faces: {hull.Faces.Count}");
Console.WriteLine($"Input vertices on hull: {string.Join(", ", hullVertexIndices)}");
}
TVGL includes tools for:
Computational geometry is sensitive to degeneracies, floating-point precision, topology, and model scale. Callers should choose tolerances appropriate to their data and validate results when working with malformed, non-manifold, or nearly degenerate geometry.
Vector2, Vector3, and Vector4 represent coordinates and directions. Many TVGL algorithms are implemented as extension methods on vectors, vertices, faces, polygons, and solids.
Polygon represents a bounded two-dimensional contour. Polygon operations include containment queries, intersections, offsets, simplification, triangulation, and related planar geometry functions.
TessellatedSolid represents a three-dimensional boundary using vertices, edges, and triangular faces. TVGL includes operations for constructing, transforming, querying, modifying, and analyzing these meshes.
VoxelizedSolid represents geometry on a regular grid of cubic cells. Voxel models are useful when a discrete representation is preferable to exact boundary geometry, including some boolean, slicing, and analysis workflows.
TVGL models planes, cylinders, cones, spheres, tori, and more general conic and quadric surfaces. These types support geometric queries and the interpretation of analytic geometry found in tessellated models.
The core library contains readers and writers for several three-dimensional mesh formats, including:
Open a supported model using its file extension:
using TVGL;
Solid solid = IO.Open("part.stl");
For two-dimensional SVG, DXF, and DWG workflows, install the companion package:
dotnet add package TVGL.PolygonImportExport --version 2.0.0
The package exposes PolygonImportExport.SVG, PolygonImportExport.DXF, and PolygonImportExport.DWG. Format support varies between reading and writing; consult the relevant APIs before depending on round-trip conversion.
The repository contains introductory guides for several major areas of TVGL:
The public API also includes XML documentation for use in IntelliSense and generated reference documentation.
Bug reports and pull requests are welcome. Geometry bug reports are most useful when they include:
Please keep behavioral changes separate from formatting or documentation-only changes where practical, and include focused tests for geometry fixes.
TVGL is distributed under the MIT License.
C#
98.7%