Thank you, somehow I missed “BlenderCAD” even thought it’s such an obvious name, I thought of using it myself at one point. Looks pretty early though – it could be I need to work within that project. I’ll have to see.
Unfortunately people mean many different things when they say “CAD”, so I have to look very closely to see if a given project actually has similar goals. I’m wanting to find or create something that could actually take the place of commercial engineering CAD systems, and then go beyond, by tackling the problems of free internet collaboration tools that the free software development community has proved itself so good at solving (indeed, I think the problem will be almost solved when the application is factored properly – since collaboration tools already exist).
regarding the Blender data model, i’ve started an attempt to make Blender use Python data - see http://mediawiki.blender.org/index.php/BlenderDev/PythonBlender … that data model could probably be made quite a bit more flexible than the current one, which is pretty slick too though.
Now that sounds exciting. When I started looking into this, I found out about how Blender objects are really C structs. One obvious way to hack Blender into an MVC model, is to actually use a MMVC model, in which there is a CAD model M which is mapped to a Blender representation model, M that interacts within the program (with which Blender’s View and Controller are integrated). That would work fine for me if it could be made to work.
The problem is that M* will be quite different from M, and I doubt that full round-trip conversion can be guaranteed. That means that all the CAD controls have to work directly on the M* model, so that the CAD model is always driving the Blender model. In order to take advantage of Blender’s interface, though, I’d want to map transformation commands to the CAD model, so I’d want to use objects within the Blender model (M) that had callbacks so they could report how they were being transformed. Then the M* model could be updated.
One nice thing about this, is that the Blender model, being a “rendering” of the CAD model (M* -> M) would automatically provide support for creating art from CAD models, which is a nice feature (in professional CAD systems, you usually have to do the CAD work, export to a rendering tool like Blender, in order to make artistic ray tracings from the model, for example).
The problem is that you’d need a Blender object that did a callback whenever it was transformed within Blender. I’m wondering if that’s something you have (or could easily) do with your PythonBlender?
also there seems to be http://www.pythoncad.org/ - did not looked closely but seemed ok. if we manage to get also Blender to use a Python base then these two apps would probably be quite easy to get to work together…
PythonCAD is a great, but still quite immature 2D CAD system. Indeed, I would hope to use it as a 2D module. It’s the 3D module that I still consider missing at this point. (There is also QCAD which is more mature and has a better GUI, but I’m more inclined to bring PythonCAD’s GUI up to spec – I believe Python has real potential because it’s the kind of programming language that engineers can handle as opposed to career programmers – free software usually must be maintainable by its users to succeed).
There is also the point of interoperability. In order to be used professionally, a free software 3D mechanical CAD system will need to have file-level (which implies model-level) compatibility with proprietary industry-leading CAD systems like AutoCAD. I had been thinking to use the ISO “STEP” (or ANSI “PDES”) standard for that, but I’m distressed to find that these aren’t really open standards, so I’m having to reconsider that idea.
As you know there are many ways to implement a 3D model of a given form. Blender can get away with a fairly sparse set of model systems, and can even do shapes approximately. But whereas a sufficiently large-order polygon can be considered a circle in the Blender M model, the CAD M* model has to know it’s really meant to be a circle (for example). Hence M* is going to be a much richer collection of modelling methods in general. One way to get that is to try to support the set of representation models in STEP.
but surely also otherwise the modularization, like separating the GUI, would be good in many ways … it is just difficult to achieve, and does not help in the more immediate goals we have.
Yes it would, and yet I fully understand this is not what the Blender team wants to focus on. Blender is a terrific artistic modelling and animation system, which is what it should remain. The question is whether it’s possible to leverage that development to provide CAD too.
I think the M* -> M mapping and M -> M* callback concept would provide a means of doing that with a fairly small hack. Unfortunately, while I’m willing to put some effort into Python-level development, I’m pretty rusty in C, and I really don’t work on C projects anymore. OTOH, there do seem to be a number of people interested in this kind of functionality, so I’m trying to send out some feelers and find out what kind of design could get done.
I will take this up with the BlenderCAD folks, too.
Thanks a lot, Toni.