Swiftpack.co - nicklockwood/Euclid as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by nicklockwood.
nicklockwood/Euclid 0.5.27
A Swift library for creating and manipulating 3D geometry
⭐️ 489
🕓 4 days ago
.package(url: "https://github.com/nicklockwood/Euclid.git", from: "0.5.27")

PayPal Build Codecov Platforms Swift 5.1 License Twitter



Euclid is a Swift library for creating and manipulating 3D geometry using techniques such as extruding or "lathing" 2D paths to create solid 3D shapes, and CSG (Constructive Solid Geometry) to combine or subtract those shapes from one another.

Euclid is the underlying implementation for the open source ShapeScript scripting language and ShapeScript macOS app. Anything you can build in ShapeScript can be replicated programmatically in Swift using this library.

If you would like to support the development of Euclid, please consider buying a copy of ShapeScript (the app itself is free, but there is an in-app purchase to unlock some features). You can also donate directly to the project via PayPal:

Donate via PayPal

Note: Euclid is a fairly complex piece of code, at a fairly early stage of development. You should expect some bugs and breaking changes over the first few releases, and the documentation is a little sparse. Please report any issues you encounter, and I will do my best to fix them.


Euclid is packaged as a dynamic framework that you can import into your Xcode project. You can install this manually, or by using CocoaPods, Carthage, or Swift Package Manager.

Note: Euclid requires Xcode 10+ to build, and runs on iOS 10+ or macOS 10.12+.

To install Euclid using CocoaPods, add the following to your Podfile:

pod 'Euclid', '~> 0.5'

To install using Carthage, add this to your Cartfile:

github "nicklockwood/Euclid" ~> 0.5

To install using Swift Package Manage, add this to the dependencies: section in your Package.swift file:

.package(url: "https://github.com/nicklockwood/Euclid.git", .upToNextMinor(from: "0.5.0")),


Feel free to open an issue in Github if you have questions about how to use the library, or think you may have found a bug.

If you wish to contribute improvements to the documentation or the code itself, that's great! But please read the CONTRIBUTING.md file before submitting a pull request.


See the included project for an example of how Euclid can be used in conjunction with SceneKit to generate and render a nontrivial 3D shape on iOS.


Full documentation for all Euclid types and functions can be found here.


The Euclid framework is primarily the work of Nick Lockwood.

Special thanks go to Evan Wallace, whose JavaScript CSG library provided the inspiration for Euclid in the first place, along with the BSP algorithm used for Euclid's CSG operations.

Thanks also go to Joseph Heck for implementing the DocC documentation, Andy Geers for several bug fixes and improvements, and Patrick Goley who first suggested "Euclid" for the library name.

(Full list of contributors)


Stars: 489
Last commit: 17 hours ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics