Skip to main content

"Easy as Pie" CAD (Piecad)

For many years I used OpenSCAD, but the functional language it uses was often a hinderance and its speed was poor. Piecad is my opinionted view of what a good, simple CAD API should look like. It is written in Python. Its primary focus is the creation of models for 3D printing.

To install using pip (virtual environment recommended):

pip install piecad

QuickHelp

Documentation

Examples

Printable CheatSheet

Piecad-Viewer: Piecad has a view function which works like a 3d print (also does 2D). Piecad-Viewer provides the window that displays the model/image from each view call. You can use arrow keys to swtich between the models/images.

Type 'h' in the Piecad-Viewer window for a list of commands.

Piecad-Viewer is installed with Piecad. It is automatically started when you use a view call inside Piecad.

My Piecad development environment.

I have one window where I run vi as my editor.

I have another window that is Piecad-Viewer.

I use the script below to watch for changes in all *.py files, the argument to the script is the name of the main python file. When any python file is written, python is ran on that main python file.

So I use view calls for what I need to see. Edit, then when I write, the pywatch script below causes those views to be displayed.

#!/usr/bin/env python3
import sys
import os
import time
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer

class MyEventHandler(FileSystemEventHandler):
    def on_created(self, event):
        pass

    def on_modified(self, event):
        if event.src_path.endswith(".py"):
            print(event)
            os.system(f"python {sys.argv[1]}")

    def on_deleted(self, event):
        pass

    def on_moved(self, event):
        pass

if __name__ == "__main__":
    if len(sys.argv) != 2:
        print("Usage: pywatch _file_")
        sys.exit(1)
    path_to_watch = "."  # Current directory
    event_handler = MyEventHandler()
    observer = Observer()
    observer.schedule(event_handler, path_to_watch, recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()

CREDITS

Piecad is based on Manifold, a 3D CAD package written in C++. Manifold incorporates Clipper2 for 2D objects. It also uses quickhull for 3d convex hulls. You can see Manifold's web site for other packages that are used.

Piecad uses the trimesh package for mesh loading/saving and for Piecad-Viewer.

Piecad also uses isect_segments-bentley_ottmann to check for polygon self intersections. Also, fontTools and fontPens are used to support text.

We include two fonts: Hack-Regular.tts and Roboto-Regular.tts, see piecad/fonts for the licenses.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piecad-1.4.2.tar.gz (286.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piecad-1.4.2-py2.py3-none-any.whl (288.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file piecad-1.4.2.tar.gz.

File metadata

  • Download URL: piecad-1.4.2.tar.gz
  • Upload date:
  • Size: 286.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for piecad-1.4.2.tar.gz
Algorithm Hash digest
SHA256 4c63f69a3ed2ad99aaef6b1a46a5cf27920507e9161c4c1d6b246da0f12ffcc7
MD5 4dad27f21edaa9d5cd26becc5eef21bb
BLAKE2b-256 f295da5812d939ef7a390e07659754e191c77b90f91efd17192aad796a624c0c

See more details on using hashes here.

File details

Details for the file piecad-1.4.2-py2.py3-none-any.whl.

File metadata

  • Download URL: piecad-1.4.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 288.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.34.2

File hashes

Hashes for piecad-1.4.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0c71fddc7c2f5ee10719079dc7b5d991365b4991edadf3b8e45174c134d724a3
MD5 1f63ef9a72472a57bc5c6a8b64706696
BLAKE2b-256 ae3045e024d0aefaee81d857b4669aa0e6cdbce864d7e246fa95dff962c94384

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.2 This release

2 files

1.4.1

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page