Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python module for parametric CAD

Tags:

python

cad

I am looking for a CAD module for python. This is what i've found, correct me if I'm wrong:

  • PythonCAD:
    • file types: DWG,DXF,SVG
    • oriented: click in a window
    • last maintained: 2012-06-15
    • documented: poor and dirty
  • PythonOCC:
    • file types: STEP, IGES, STL (import/export)
    • oriented: scripts
    • last maintained: 2013-01-12
    • documented: good and clear
    • Installation is such a pain
  • FreeCAD (python wrapping)
    • file types: ?
    • oriented: click in a window and python scripting importable from python
    • last maintained: jan 2013
    • documented: very well

Well, it seems the python bindings for FreeCAD is the best but are there other things out there?

like image 913
Mermoz Avatar asked Jan 25 '13 09:01

Mermoz


People also ask

Is Python used in CAD?

Of all the programming options available to CAD programmers, one of the more intriguing is Python.

What is CAD query?

CadQuery is an intuitive, easy-to-use python based language for building parametric 3D CAD models. CadQuery is for 3D CAD what jQuery is for javascript. Imagine selecting Faces of a 3d object the same way you select DOM objects with JQuery!


2 Answers

I found that FreeCAD is the best solution. The python bindings lets you design parts in a comprehensive way.

myShape = Part.makeBox(2,2,2) myShape.translate(Base.Vector(2,0,0)) 

From simple geometries you can use boolean operations:

cylinder1 = Part.makeCylinder(3,10,Base.Vector(0,0,0),Base.Vector(1,0,0)) cylinder2 = Part.makeCylinder(3,10,Base.Vector(5,0,-5),Base.Vector(0,0,1)) common = cylinder1.common(cylinder2) 

The only downpoint is the installation with mac os, I could not compile it on snow leaopard (because too much dependencies on unsustained libraries).

But pythonocc has the same problem and what i don't like is the minimal documentation and the synthax which is too much opencascade like and not to much pythonistic.

like image 119
Mermoz Avatar answered Sep 23 '22 12:09

Mermoz


occmodel is a small self-contained library which gives a high level access to the OpenCASCADE modelling kernel.

like image 21
Volodimir Kopey Avatar answered Sep 22 '22 12:09

Volodimir Kopey