[Bf-funboard] adding cad features to blender with python?

Toni Alatalo antont at kyperjokki.fi
Tue Jan 16 13:17:03 CET 2007


am just wondering if it would be feasible to add cad features to Blender 
using Python (well, i guess thinking this is not surprising coming from 
me, but oh well seems to be my role here :)

am encouraged to think so because of the existing Python-written CAD 
tools out there - though i have never used any cad app myself (i did see 
autocad >15 years ago! first time when i saw a dual screen setup, back 
then you could do with a vga + hercules card on a pc .. autocad was 
still dos-based i think), and have not tested these recent py attempts 
either, has anyone here?

http://www.pythoncad.org/ is on the mature side, "Work began on 
PythonCAD in July,
2002, and the first public release was on December 21, 2002. The 
thirty-fifth release of PythonCAD was made available on December 19, 2006.".

looking at screenshots like http://www.pythoncad.org/images/part1.png i 
doubt that sort of stuff is ever added to Blender core (that is defining 
angles in degrees, visualing those things like that), though of course i 
can be just wrong there. certainly basic snapping etc. makes sense in 
Blender core but i mean there is perhaps all sorts of other things that 
CAD needs but which won't be internal in Blender, which is not primarily 
targeted as a CAD tool..

a solution might be adding such features with a script-based suite - it 
seems spacehandlers for doing custom hooks in the 3d view work ok 
nowadays so you can already make custom tools like that. i know e.g. 
MakeHuman started as a script but switched to another base, but recent 
examples like Blender2Crystal (the crystal space exporter that is almost 
like an own app running in the 3d view) have seemed promising to me. and 
now that Ton is starting soon with the event refactor (he even mentioned 
it in an interview, i guess he has to now :p), perhaps working towards 
the so-called tool-api too, we hopefully get much nicer and integral 
ways to make special apps on top of Blender core.

who knows, it might be even possible to merge stuff from other 
py-written CAD projects (pythoncad is not the only one, there are 
several newer ones but i don't know anything about them) to be used by 
the blendercad system too. and as those other projects miss almost all 
the other features of Blender, perhaps it could be an attractive 
platform even for the original developers to start using (they already 
have diff. frontends it seems, something ugly looking on x11 (oh gtk it 
seems, old screenshots i guess) and an alternative cocoa for macosx too 
(tho not well maintained they say).

of course another and probably much simpler option would be to use a cad 
tool like that externally, and then just import the data to blender for 
render & anim & physics sim and such, i guess ppl are already doing that?

just a thought,

More information about the Bf-funboard mailing list