Skip to content

A Swift library for creating and manipulating 3D geometry

License

Notifications You must be signed in to change notification settings

nicklockwood/Euclid

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

467f673 · Aug 7, 2024
Jul 24, 2024
Nov 11, 2019
Aug 7, 2024
Aug 7, 2024
Aug 7, 2024
Jul 24, 2024
Aug 7, 2024
Aug 7, 2024
Feb 11, 2024
Feb 24, 2022
Apr 4, 2021
Nov 26, 2023
Jul 24, 2024
Aug 11, 2023
Dec 11, 2018
Jul 24, 2024
Dec 11, 2018
Feb 23, 2022
Sep 23, 2023
Jul 24, 2024
Feb 11, 2024
Feb 11, 2024
Sep 23, 2023
Sep 23, 2023

Repository files navigation

PayPal Build Codecov Platforms Swift 5.1 License Mastodon

Screenshot

Introduction

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 Mac and iOS apps. 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

Installation

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 14+ to build, and runs on iOS 11+ or macOS 10.13+.

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

pod 'Euclid', '~> 0.7.8'

To install using Carthage, add this to your Cartfile:

github "nicklockwood/Euclid" ~> 0.7.8

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

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

Contributing

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.

Example and ExampleVisionOS

See the included projects for examples of how Euclid can be used in conjunction with SceneKit or RealityKit to generate and render a nontrivial 3D shape. Example uses storyboards, is built for iOS, and runs in "Designed for iPad" mode on macOS and visionOS. ExampleVisionPro uses SwiftUI and a RealityView in a volumetric window, and runs only on visionOS.

Documentation

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

Credits

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)

About

A Swift library for creating and manipulating 3D geometry

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages