SolveSpace 3.2.0

dotnet add package SolveSpace --version 3.2.0
                    
NuGet\Install-Package SolveSpace -Version 3.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SolveSpace" Version="3.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SolveSpace" Version="3.2.0" />
                    
Directory.Packages.props
<PackageReference Include="SolveSpace" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SolveSpace --version 3.2.0
                    
#r "nuget: SolveSpace, 3.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SolveSpace@3.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SolveSpace&version=3.2.0
                    
Install as a Cake Addin
#tool nuget:?package=SolveSpace&version=3.2.0
                    
Install as a Cake Tool

SolveSpaceSharp

C# wrapper for the SolveSpace geometric constraint solver (slvs), targeting .NET 8+ and .NET Standard 2.0 on Windows, Linux, and macOS.

SolveSpace is a parametric 2D/3D geometric constraint solver. This package wraps its C API (slvs.h) for use in .NET applications.

Quick Start

using SolveSpace;

var sketch = new Sketch(1);
var wp = sketch.AddBase2D();

// Create two 2D points
var p1 = sketch.AddPoint2D(0, 0, wp);
var p2 = sketch.AddPoint2D(10, 10, wp);

// Constrain distance between them
sketch.Distance(p1, p2, 20, wp);

// Solve
var result = sketch.Solve();
Console.WriteLine($"Solved: {result.Succeeded}");
Console.WriteLine($"p1: ({p1.U:F4}, {p1.V:F4})");
Console.WriteLine($"p2: ({p2.U:F4}, {p2.V:F4})");
Console.WriteLine($"Distance: {Math.Sqrt(Math.Pow(p2.U - p1.U, 2) + Math.Pow(p2.V - p1.V, 2)):F4}");

Installation

dotnet add package SolveSpace

The NuGet package bundles native libraries for win-x64, linux-x64, osx-x64, and osx-arm64.

Building from Source

Prerequisites

  • .NET 8 SDK
  • CMake 3.16+
  • C++ compiler (Visual Studio 2022, Xcode, GCC/Clang)

Build native library

# macOS (arm64)
bash native/build-native.sh osx-arm64

# macOS (x64)
bash native/build-native.sh osx-x64

# Linux
bash native/build-native.sh linux-x64

# Windows (PowerShell)
.\native\build-native.ps1 -RID win-x64

Build and test

dotnet build
dotnet test

API Overview

Sketch

The Sketch class wraps a solver group. Create entities and constraints through it:

Method Description
AddPoint2D(u, v, workplane) 2D point in a workplane
AddPoint3D(x, y, z) 3D point in free space
AddLine2D(ptA, ptB, workplane) 2D line segment
AddLine3D(ptA, ptB) 3D line segment
AddArc(normal, center, start, end, workplane) Arc of a circle
AddCircle(normal, center, radius, workplane) Complete circle
AddCubic(ptA, ptB, ptC, ptD, workplane) Cubic Bezier spline
AddWorkplane(origin, normal) Custom workplane
AddBase2D() Default XY workplane
AddNormal3D(qw, qx, qy, qz) 3D normal (quaternion)
AddDistance(value, workplane) Distance parameter
Solve() Solve the sketch

Constraint methods: Distance, Coincident, Horizontal, Vertical, Angle, Parallel, Perpendicular, Equal, Midpoint, Tangential, Diameter, Dragged, and more.

For constraint types without a dedicated method, use AddConstraint() with the raw constraint type constant.

License

GNU General Public License v3.0 or later. See the COPYING.txt file in the solvespace submodule.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.2.0 48 5/12/2026