Skip to content

Repository files navigation

Build Codecov Platforms Swift 5.10 License Mastodon

Screenshot

Introduction

ShapeScript is a hybrid scripting/markup language 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.

ShapeScript is also the scripting language used for the ShapeScript Mac and iOS apps.

ShapeScript is implemented on top of Euclid, a cross-platform 3D modeling library written in Swift. Anything you can construct using ShapeScript can be replicated programmatically in Swift using Euclid.

If you would like to support the development of Euclid and the ShapeScript language, please consider buying a copy of ShapeScript for Mac or iOS (the apps themselves are free, but there is an in-app purchase to unlock some features).

Mac App Store App Store

Installation

This repository includes the source code for both the ShapeScript code library and the ShapeScript Viewer apps for iOS and macOS. These are cut-down versions of the full ShapeScript apps available on the Mac and iOS app stores.

The easiest way to try ShapeScript is to download the prebuilt ShapeScript Viewer app or CLI tool for macOS from the releases page. The CLI tool is also available for Linux (see below).

To install the command-line tool from Terminal on macOS or Linux:

VERSION=1.11.0 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/nicklockwood/ShapeScript/HEAD/Viewer/CLI/install.sh)"

To run the Viewer app on iOS, or if you prefer to build the Mac app yourself, open the included Xcode project and select the Viewer (Mac) or Viewer (iOS) scheme.

Note: ShapeScript requires Xcode 14+ to build, and runs on macOS 10.15+ and iOS 14+.

To use the ShapeScript code library in your own project, add this to the dependencies: section in your Package.swift file:

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

Usage (Mac)

Once you have opened the app, you can create a new ShapeScript document from the File menu, or open one of the example projects from the Help menu.

ShapeScript for Mac does not include a built-in editor. Instead, after opening a shape file in the ShapeScript Viewer, you can select Open in Editor (Cmd-E) from the Edit menu to open the source file in a text editor of your choice.

The ShapeScript Viewer will track changes to the source file and update in real-time as you edit it.

For more information, check out the help section.

Usage (Linux)

A prebuilt ShapeScript CLI binary for Linux is available from the releases page, or can be installed using the Terminal command above. The prebuilt Linux binary is for x86_64 Ubuntu. Other Linux distributions may work, but Ubuntu is the supported target for the prebuilt download.

To build the tool yourself from source you will need to install the latest Swift toolchain, then run the following commands:

$ git clone https://github.com/nicklockwood/ShapeScript
$ cd ShapeScript
$ swift build -c release

As with the Mac app, the ShapeScript CLI does not include an editor. Use a text editor of your choice to create your .shape file, then pass it to the CLI.

For further instructions, see the command-line tool documentation.

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.

Credits

The ShapeScript framework and apps are primarily the work of Nick Lockwood.

About

The ShapeScript 3D modeling app for macOS and iOS

Topics

Resources

Contributing

Stars

436 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages