Skip to main content

EngScript is an experimental library aiming to provide fast OpenSCAD-like, python tool, with integrated rendering and assembly capabilities

Project description

EngScript

API Documentation

What is EngScript

EngScript is an experimental library aiming to provide fast OpenSCAD-like, python tool, with integrated rendering and assembly capabilities.

Ideally EngScript will eventually be able to support complex projects like the OpenFlexure microscope.

Installation

To install EngScript you must have Python 3.10 or greater installed, and pip installed. You can then run:

pip install engscript

from your terminal.

A more complete getting started guide is available.

Why write another code CAD program?

This is a fair question. The open source code-CAD space is very crowded, and there is arguably very little to gain from creating another similar tool. This tool is experimental and is based on extensive experience building complex hardware in OpenSCAD.

We created the OpenFlexure Microscope in OpenSCAD (repo). OpenSCAD allowed us to build a very compact, complex, precision translation stage for 3D printing a microscope body. We also have written a lot of custom assembly scripts allowing us to automatically generate the images for our assembly instructions in OpenSCAD:

While OpenSCAD has taken us a long way we still have issues with:

  • A lack of language specific tools such linters (we wrote our own SCAD linter), unit test frameworks, package managers, etc.
  • Difficulty handling data for a large complex project
  • Speed issues
  • Faulty meshs

As OpenSCAD moves to the manifold kernel the mesh quality and speed will improve. But a project the size and complexity of OpenFlexure really feels that it needs advanced language features and tools that OpenSCAD. For this it makes sense to look for an alternative in an established general purpose language.

Other options include:

  • CadQuery - CadQuery is a really ambitious project, bringing full B-rep modelling (and STEP file compatibility) to the open source code CAD world. Moving away from meshes would open up opportunities outside 3D printing. For OpenFlexure the microscope is designed entirely around 3D printing, and relies heavily on operations not supported in the underlying OCC kernel. Porting to CadQuery would be a huge task, and would require a lot of work on CADQuery to reproduce our renders (This work is ongoing in CadQuery and is very exciting).
  • Python OpenSCAD - Another cool project which brings Python to OpenSCAD. However, as the python runs within OpenSCAD this ties the project still to many of the pitfalls of the OpenSCAD internals. I also worry that this approach makes it hard to run python virtual environments so that different projects can have different libraries installed, and so that packages can be handled with a package manager.
  • Web-based CAD such as ManifoldCAD - The web provides easy options for getting started, nothing to install, just start coding. However, I think that as a project becomes more complex and has multiple files and even external packages this simplicity goes away. Either you need a fully hosted solution with storage, multiple files, and package management; or you need to run things locally, hosting dev servers, installing packages with npm. I don't see an easy way for this to scale.
  • One of the many other PythonCADs - There are lots of other programs similar to EngScript which are Python based, using the same or different underlying kernel. While many look really cool, none I found seem to be very mature and stable. (Not that EngScript is mature or stable either).

The purpose of EngScript is to take all the lessons we learned in creating the OpenFlexure in OpenSCAD, the lessons we learned making auto-updating rendered assembly manuals, and the lessons collaborating on the code with a growing community. EngScript doesn't offer to solve these problems yet, but it is a space for us to experiment with features that are needed for complex projects. A key focus of this will be object oriented code so that object properties can be queried during the design process. This should help mitigate some data handling issues, but should also make it easier to capture design intent.

EngScript may be a successful new code CAD program adopted by the OpenFlexure project. It may just be a place to try new things and to learn from that experience.

Should I use EngScript

  • If you want to play around with something new - Yes
  • If you want to help develop it - Very yes
  • If you want a good stable CAD package - Nope!

See also

This package heavily uses manifold and trimesh.

It also too a lot of inspiration from badcad.

Project details


Download files

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

Source Distribution

engscript-0.0.2.tar.gz (722.0 kB view details)

Uploaded Source

Built Distribution

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

engscript-0.0.2-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file engscript-0.0.2.tar.gz.

File metadata

  • Download URL: engscript-0.0.2.tar.gz
  • Upload date:
  • Size: 722.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for engscript-0.0.2.tar.gz
Algorithm Hash digest
SHA256 238a937dfa480da625bb92f2e248f704b636a8528b4ec63838dc35bc0c9d8523
MD5 e590c772f76ca3f7d5a38806fe997dce
BLAKE2b-256 30087b741161e3afcf41b14e5037211456784ee1d3e645d7ccea5f99d182a5a1

See more details on using hashes here.

File details

Details for the file engscript-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: engscript-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 42.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.17

File hashes

Hashes for engscript-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6a41f223f9c7b412a3cab06410bd8edd915ffbde9324002daea42197f512423
MD5 16b7e8d0d724ad2f7aae98e15bc16ec2
BLAKE2b-256 78b69c053750772461465e226d1c31c33d3869f21ee9689601ffb693ddde6d89

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page