[freearchitecture] Blender-Developments

Terry Hancock hancock at anansispaceworks.com
Wed May 3 07:48:31 BST 2006


Eric Wilhelm wrote:

>><sigh> I wish there was a way to combine PythonCAD and Blender. Both
>>use Python, and both have elements that architects need. If they could
>>somehow develop towards each other, we could have a technical drafting
>>program and a 3D architectural modeler with everything in between.
>>(That in-between stuff being the 2. ? between 1. Idea and 2. Profit.
>>    
>>
>
>Hmm.  I wonder what a python hacker could do about that?  :-) Chris 
>  
>

Because PythonCAD is written entirely in Python and Blender
contains a complete Python interpreter, this shouldn't really
be that hard.

Even if not and they had to run in separate processes, it
wouldn't be too hard to exchange data.

That's not really the question. The question is what would you
expect such a combination to do? PythonCAD is a 2D CAD system;
Blender is a 3D modeler.

What Blender is missing (compared to a 3D CAD system) is a
CAD-oriented model.  Blender needs to have callback hooks
inserted into the C code to allow a Python object to receive
callback events when an object is edited within Blender. This
would allow the Python code to update the model based on
changes made using the basic tools within Blender.

In addition, the Python interface should provide a means to connect
CAD-oriented input interfaces, which can control the model directly.

The fundamental linking element in all of this is the *model*.

PythonCAD provides an XML-based CAD model, but it is limited
to 2D and AFAIK, no other application supports it.

I spoke to the developer of PythonCAD sometime back suggesting the
idea that STEP (which includes 2D CAD representations in addition
to the better-known 3D systems), might be a desireable choice. He
agreed in principle (provided someone makes a patch to do it,
of course), but didn't know where to find the documentation.

It is somewhat difficult to find, since the official ISO standards
documentation is officially available only for a fee (this is required
by some annoying politics based on various national standards
organizations' requirements, notably ANSI, which insist on selling
the documents to compensate for costs, as I learned from the ISO
committee chair, Howard Mason -- it's not regarded as a big deal
because they have the assumption that all the stakeholders are
companies who can afford the fees).

However, I also learned that the Express *source code* for all the
STEP standards *is* available, and there are projects to provide
a data exchange representation of STEP data, using this information.
This is the essence of the EXFF project.  (I believe a major goal is
to implement a mapping from Express to XML so that STEP models
can be represented in a STEP-based XML format). There is also
something called "Open Cascade" that implements a library for
STEP, but it's actually a non-free library (it won't meet the standards
of open-source distributions).

Clearly, an open interchange format is the logical thing to standardize
on for the native format of a true, collaborative, free CAD system.
This is what drew me to STEP in the first place.

CAD data is quite rich, of course, and creating a new standard from
the ground up would be an enormously difficult problem.  Therefore,
even though it would be a huge job to fully support STEP, I think
that leveraging the existing development effort on it is the wisest
course.

Also, with an object-oriented standard like STEP, the standard,
implying the model, implies the implementation.  You know from
what STEP is specified to represent, what a fully capable 3D CAD
system would need to support. It provides an implicit application
specification.

I've written more about this subject in one of my articles for
Free Software Magazine:

"Towards a Free Matter Economy 4: Tools of the Trade"
http://www.freesoftwaremagazine.com/articles/free_matter_economy_4

In brief (for those who don't like to follow links in emails), I proposed
a couple of different possible configurations for collaborative free
3D CAD systems.  The ideal is to follow true Model-View-Controller (MVC)
design. This would require considerable refactoring to be done directly
with Blender, though.  Another possibility is to integrate Blender in
as a View and Controller client, with the model moderated by Python and
either callbacks to carry changes to the model or a round-trip conversion
between CAD model and Blender model (but I think that's unlikely).
You still need extra hooks coded into Blender, but not a major
refactoring.

I don't see anything that is especially hard, but it's still a big job,
I'm way overcommitted already, and there are more qualified and
motivated developers out there, I'm sure. In fact, one thing I learned
from my research is that there's probably dozens of independent
attempts to create free 3D CAD systems out there, but the job is too
big, and no one has reached any kind of maturity. So there's
motivation, but no organization.  To me, it seems like the best thing
for me to do is to get interested people to find and talk to each
other if possible (hence this email!).

(BTW, the Wiki never really got off the ground, and is down now,
in any case -- I notice a commenter posted an alternate place to find
links on the subject).

http://www.tech-edv.co.at/lunix/CADlinks.html

(Yes, it's really "lunix" not "linux", I just checked the site -- it's 
just a
links-list, but looks good anyway).

Before I finish, I must mention that the closest things to a free software
3D CAD system that already exist are:

Varkon
  * Pascal-based extension language
  * fairly primitive interfaces
  * sample application for underlying simulation library
  http://www.tech.oru.se/cad/varkon

BRL-CAD
  * Funded by US Army
  * "Constructive solid geometry" model (only)
  http://www.brlcad.org

These are my observations so far, after doing a fair amount of
online research into the problem. Surely there are wrinkles I
haven't given enough thought to, though.  Obviously, my own
interests are more along the lines of aerospace and/or mechanical
CAD rather than architecture, but ISTM, the needs are similar
enough that one modular application should serve all of these
disciplines and more.

Cheers,
Terry

-- 
Terry Hancock (hancock at AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com




More information about the freearchitecture mailing list