2011/6/11 Jayesh Salvi <jayeshsa...@gmail.com> > Hi all, > > I would like to share with you the project I've been working on for > past few weeks. > > I wanted to create a scripting solution for solid modeling - similar > to OpenSCAD, but in Python. Earlier I tried to do it using CGAL, but > recently I switched to PythonOCC. I was delighted to find how > PythonOCC worked out of the box for my purposes. > > Cadmium is a python library that lets you easily generate primitive > solids (Box, Cylinder, Sphere,...), and then apply affine > transformations and CSG operations on them in an intuitive manner - > with operator overloading union(+), intersection(*), subtraction(-). > As you may know, PythonOCC has API to do all this. Cadmium is a thin > layer on top of PythonOCC, to just hide complicated syntax. But it > leads to a lot simpler code that is easy to understand. > > Cadmium is usable as of now. It can generate some interesting solids, > with only few lines of code. You can see the results yourself here: > http://jayesh3.github.com/cadmium/ > > Please give it a try and let me know what you think. > Thanks, > -- > Jayesh > > Hi Jayesh,
Welcome to this list and thanks for reporting your contribution. We already discussed here the opportunity to simplify the API (just google the famous "Anyone seen this?" thread). Julien Blanchard reported here a kind a similar project named pycado (http://julienbld.github.com/pycado/), but I do prefer your approach: I already wrote that I do not recommand writing another scripting or macro language in order to succeed in such a project. *the* scripting language is already available: python. The use of native python features enables real 'high level' idioms, like for instance mapping boolean operations to '+', '*' or '-' as you did, which is IMO an excellent idea. The model transformation from CGAL to pythonOCC may be hazardous: I don't see how the 'Polyhedron' class (CGAL) can be related to any superclass of cylindrical primitives like Spheres, Cylinders. Do you plan to extend your project beyond CSG features? python based, visualization free, it's all I like to see in CAD in general! Good luck for your project, and feel free to announce here your recent developments. Best Regards, Thomas
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users