0

I am new to CAD. However, I am interested in implementing some interactive geometric algorithms in 3d using CAD software. There seem to be many good open-source options available online e.g. OpenJSCAD, Implicit, FreeCAD.

However, from the little I CAD I know, we program a 3d model in a scripting language of the CAD package. Then we get an STL file which is visualized offline using standard visualizing software.

I would like to have a Python / Haskell based CAD modeller, which has support for event-handling, say through call-back functions.

Matplotlib of Python for instance, in Python has wonderful support for precisely this purpose. But from what I know it works only for 2d.

A typical usage scenario would be the user initiates a random point-cloud in 3d. The point cloud is rendered to the screen. By then pressing the key 'C', we can see each step of the construction of a convex hull algorithm.

As the algorithm construction proceeds, we can spin it around, zoom in on interesting parts etc.

Do such packages exist? Ideally, in Python or Haskell.

0

Try pythonOCC, it is built on an open source real geometric kernel (opencascade).

You will have to explore and see if it answers your use case, but I think you can achieve a lot with it. See also 'Related projects' on the site, there might be something else which might interest you.

-1

Not using CAD software but using python is Jupyter VPython.

Assuming that you already have a recent Python version of python installed you can install VPython with:

pip install vpython --upgrade

This will let you start Jupyter VPython kernels by running:

jupyter notebook

and on the resulting webpage, http://localhost:8888 by default, selecting new VPython on the top right.

  • Free Gratis & Open Source
  • Cross Platform
  • You can do almost exactly the sort of thing you are looking for
  • not a CAD program

I also recommend checking out the source and the demos from github, one of said demos: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.