Python 3D CAD -- need collaborators, or just brave souls :)

R

rantingrick

Hello all,

It has long been my dream to create an open source 3D CAD program and
i am starting to crawl my way into the first steps. I now believe i am
ready to start this endeavor and i am currently looking for fellow
Python programmers (no matter what skill level) to get started
brainstorming this design.

I have a real good idea of the UI design and at this point i just want
to start simple and build this thing. I figure this will be a good
learning experience for myself and others and in the process i can
realize my dream. And if all this turns out to be is a learning
experience, well nobody lost.

Of course Python will limit the speed here, but at this point i want
to get a template up and running. Speed does not matter at this point,
and optimizations can come along later as i am sure a few complete re-
writes are inevitable :)

My initial start will cover a very simple user interface something
like VPython but much more usable as a CAD modeler. From the start
just a few simple primitives (faces, lines-segments) that will be the
building blocks for more complex models like (arcs, rectangles,
circles, polygons, cubes, spheres, etc..).

There will need to be mouse picking as i see this application as a
very interactive environment. Of course in the beginning all
interaction will most likely be in a command line type manner until
the functionality can be worked out.

There will need to be a hierarchy of instancing and grouping within
the model to facilitate easy transformation of entities within the
model.

I am not too worried about any sort of texturing at this point. I want
to squeeze as much speed as possible and prettiness will come in due
course. I also have no plans for layering, or multiple scenes at this
time. Simple functionality is the end game here.

Once the UI is there and the modeling work flow is worked out,
everything should be a component add-on from there.

So the main points are...

#-- Entities --#
face
line-segment

#-- Hierarchy --#
Entity (one face, or line-segment)
Group (contained of multiple entities that can be translated,
rotated, scaled as one)
Instance (component definition)

#-- Tools --#
line
rect
circle
arc
select
rotation
translation
scale
extrusion along path
measurement


So there it is. Any takers? :)
 
H

Hendrik van Rooyen

8< ----------------- dreams, goals and tentative spec -----------------

Have you looked at Pycad ? - it started off with a similar rush
some time ago.

Maybe there is something there that you can use and/or salvage.

- Hendrik
 
M

Mike C. Fletcher

rantingrick wrote:
....
It has long been my dream to create an open source 3D CAD program and
i am starting to crawl my way into the first steps. I now believe i am
ready to start this endeavor and i am currently looking for fellow
Python programmers (no matter what skill level) to get started
brainstorming this design.
I'm certainly willing to help with brainstorming...
Of course Python will limit the speed here, but at this point i want
to get a template up and running. Speed does not matter at this point,
and optimizations can come along later as i am sure a few complete re-
writes are inevitable :)
Simple CAD systems without shading/texturing shouldn't have any real
performance issues under Python. We had 3D CAD back in 1993 sufficient
to build reasonably complex environments when I was in architecture.
Python's only about 10x slower than C, and if you dump large C-level
arrays into the graphics card your performance can be quite reasonable.
If you have a visit @ every face/line for every refresh you'll spend all
your time in the scenegraph traversal.
There will need to be mouse picking as i see this application as a
very interactive environment. Of course in the beginning all
interaction will most likely be in a command line type manner until
the functionality can be worked out.
Mouse picking is pretty easy, you can either use simple ray-intersection
on your bounding-box hierarchy (easiest/fastest for CAD-type structures)
or render-pass based stuff (if you have lots of organic shapes that will
show through each other a lot and you want to be able to click on the
thing "peeking through" behind another thing. Both are very well
documented and easy/fast to implement if/when your scenegraph is
tracking bounding volumes.
There will need to be a hierarchy of instancing and grouping within
the model to facilitate easy transformation of entities within the
model.
Transform and Group nodes are definitely a good idea, as are "USE" nodes.
I am not too worried about any sort of texturing at this point. I want
to squeeze as much speed as possible and prettiness will come in due
course. I also have no plans for layering, or multiple scenes at this
time. Simple functionality is the end game here.
Fair enough.
#-- Entities --#
face
line-segment
That's pretty low-level. You may want to work with "meshes" or the
like, so that you select the mesh, then modify the faces/vertices/edges
(a-la 3DSMax/Maya), particularly where you want faces to share
coordinates. Just a thought.
#-- Hierarchy --#
Entity (one face, or line-segment)
Again, seems like you'd want something a little less soup-of-lines-ish,
but then that's a 3D Modeler bias, rather than a CAD bias (where often
it really is just a soup of lines).
Group (contained of multiple entities that can be translated,
rotated, scaled as one)
Transform node.
Instance (component definition)
Node with DEF + USE's node instance. Or, if you mean a reusable,
parameterized node, a PROTO definition and PROTO-using nodes.
#-- Tools --#
line
rect
circle
arc
You'll want mechanisms to define the current coordinate system as well
(think AutoCAD "UCS") so that you can precisely align the work you are
doing without needing to calculate cos/sin/tan for everything. That is,
your rotation/translation/scale should allow you to draw *within* the
resulting Transform. You'll likely also want to be able to translate
objects to/from Transform spaces (i.e. reparent without moving).

Also (from my many-year-old recollection of doing CAD in architecture):

* tan (when you want to draw lines tangential to a circle/arc and
then trim)
* chamfer/fillet (easy to code and pretty darn useful for a lot of
detail drawings)
* copy
* align
* delete/erase
* hide/show hidden edges
* mirror/mirror3d (used it all the time)
* text (pretty important for CAD work)
* snap control (critically important IMO)
* polyline/polygon (or tools to combine lines/arcs into polygons and
close the result for e.g. extrusion)
* splines/nurbs or other high-order surfaces (eventually)
* boolean operators (eventually, use a library for this unless you
really want to learn, and even then, do it yourself and then use a
library)
Critical to get that right to make it usable.
rotation
translation
scale
I'd suggest a Maya-like control for this as far as the GUI goes, put
snaps on it, but make a single widget that lets you
rotate/translate/scale. You'll also want such things as
scale-this-line-to-be-this-size rescales (scale, pick two points, pick
two other points, scale is the relative length of the two points)...
extrusion along path
Available in GLE extensions (nodes available too). Also want "revolve"
(extrude around a path, which may be a point). Depending on your model,
you may want to allow for converting extrusions to faces in order to
allow tweaking the resulting extrusion. You'll want/need a UI to "open"
the extrusion and change the backbone and sweep shapes.
measurement
measurement == dimensioning (dim*)? Or just on-screen measurement
(dist). Both are useful.
So there it is. Any takers? :)
I can't even begin to commit any real time to another project (I barely
have time to work on the ones I already have), but if you need feedback,
feel free to email me. Most of the graphics stuff sounds like stuff you
could build on top of OpenGLContext or COIN or any of the generic
scenegraph libraries. They aren't really CAD-focused, but they've
already got the ability to draw the things you're wanting to work on,
and have the Transforms and similar support to make the coding a
reasonable task. However, they're closer to a Maya/3DSMax model than
AutoCAD, so maybe you'll decide you want to go your own way.

You may want to check out PythonCAD as well, which IIRC does 2D-only CAD.

Anyway, hope this was some help. Good luck,
Mike

--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
 
G

greg

rantingrick said:
It has long been my dream to create an open source 3D CAD program and

I have a real good idea of the UI design

Have you seen Sketchup?

http://sketchup.google.com/

It has an amazingly intuitive user interface, much better
than any other 3D modeller I've seen. Anyone thinking of
designing a 3D app would do well to study it closely, IMO.

Something with a Sketchup-like UI but designed for serious
CAD work would be an incredibly good thing to have.

In any case, your project sounds interesting, and I'll
be happy to discuss ideas if you want.
 
J

Josh Dukes

What kind of cad are you focused on? Mechanical cad, architecutal cad,
or something else? If you're interested there have been some
experiments with blender
http://projects.blender.org/projects/blendercad/
http://blenderartists.org/forum/showthread.php?t=65559

Unfortunately I don't think anything ever came out of those. There's also a 2d cad called pythoncad,
http://www.pythoncad.org/
There's also Salome, which seems to have a python interface. Basically though, there isn't anything good right now but I'd love to see this.
 
R

r

Hello Josh,
Blender is a lost cause. It is a powerful app but the UI is horrible.
Even the Blender folks admit only a complete rewrite could solve the
major flaws that plague the design. So maybe i could salvage some code
but for what i have in mind, Blender will look like a piece of
software from the middle ages. And i am absolutly only looking to do
this in 3D, 2D is boring.

So, yes, i have looked at both the applications you offer.

Thanks
 
R

r

Yes i want linux, windows, and mac support. I think you are good for a
few years though :). Getting something up and working is the easy
part. Adding all the features that are required to compete with
something the likes of SolidWorks or ACAD takes time.

One way or another i am going to build this, whether or not it takes
off and gets to a professional level -- only time will tell. I know
one thing for sure the need is there, the product is not.
 
Z

Zamnedix

Hello all,

It has long been my dream to create an open source 3D CAD program and
i am starting to crawl my way into the first steps. I now believe i am
ready to start this endeavor and i am currently looking for fellow
Python programmers (no matter what skill level) to get started
brainstorming this design.

I have a real good idea of the UI design and at this point i just want
to start simple and build this thing. I figure this will be a good
learning experience for myself and others and in the process i can
realize my dream. And if all this turns out to be is a learning
experience, well nobody lost.

Of course Python will limit the speed here, but at this point i want
to get a template up and running. Speed does not matter at this point,
and optimizations can come along later as i am sure a few complete re-
writes are inevitable :)

My initial start will cover a very simple user interface something
like VPython but much more usable as a CAD modeler. From the start
just a few simple primitives (faces, lines-segments) that will be the
building blocks for more complex models like (arcs, rectangles,
circles, polygons, cubes, spheres, etc..).

There will need to be mouse picking as i see this application as a
very interactive environment. Of course in the beginning all
interaction will most likely be in a command line type manner until
the functionality can be worked out.

There will need to be a hierarchy of instancing and grouping within
the model to facilitate easy transformation of entities within the
model.

I am not too worried about any sort of texturing at this point. I want
to squeeze as much speed as possible and prettiness will come in due
course. I also have no plans for layering, or multiple scenes at this
time. Simple functionality is the end game here.

Once the UI is there and the modeling work flow is worked out,
everything should be a component add-on from there.

So the main points are...

#-- Entities --#
 face
 line-segment

#-- Hierarchy --#
 Entity (one face, or line-segment)
 Group (contained of multiple entities that can be translated,
rotated, scaled as one)
 Instance (component definition)

#-- Tools --#
 line
 rect
 circle
 arc
 select
 rotation
 translation
 scale
 extrusion along path
 measurement

So there it is. Any takers? :)

I realize this isn't necessarily CAD, but...
http://www.blender.org/
 
J

Josh Dukes

You might also want to look in to open cascade. It supports a bunch of
standard 3d model formats (stl, iges, step) and has python bindings.
Salome is based on open cascade. http://www.pythonocc.org/ However, I'm
not entirely clear on the license for this so that might be an issue. I
know the Debian lawyers had some problems with Salome because it
compiled against open cascade. I believe if you made open cascade an
optional run-time dependency it could still be a valid gpl app.

It's also important to keep in mind that what most people think of as
cad/cam is really multiple things that can be broken up into modules
(cad/cam/fea). Those can also be broken up into modules (fea can be
broken into meshing, pre-processing, analysis, and post-processing). It
seems like attacking things this way might be best. If you're really
serious about this (there are lots of failed Linux cad packages) I'd
suggest setting up a project on sourceforge and get a mailing list.
Post a link to the mailing list and I'll join. I can probably find some
other mailing lists that you should try to recruit from, but having a
sourceforge page and a mailing list really helps your legitimacy.

Another interesting project is FreeCAD, which is written in C++ but
compiled against python,
http://juergen-riegel.net/FreeCAD/Docu/index.php?title=Main_Page might
be worth looking at.

I look forward to joining your mailing list.
 
L

Lie

Hello Josh,
Blender is a lost cause. It is a powerful app but the UI is horrible.
Even the Blender folks admit only a complete rewrite could solve the
major flaws that plague the design<CITATION NEEDED>. So maybe i could salvage some code
but for what i have in mind, Blender will look like a piece of
software from the middle ages. And i am absolutly only looking to do
this in 3D, 2D is boring.

Blender's UI is designed for effective and efficient 3D workflow, not
for low learning curve.
 
R

r

Blender's UI is designed for effective and efficient 3D workflow, not
for low learning curve.

And that will be it's downfall!

I know what what Blenders UI is designed for. However not too many
people get religious about learning a UI, which is the only way you
will ever learn Blenders UI. This is why although Blender has a cult
following, it will never grow into a tool that the mainstream world
knows about, or for that matter cares about.

I have been using Blender on and off for almost a year and i still
cannot get comfortable with the UI. For instance adding a material to
a object involves multiple steps between multiple windows (WHAT!). Go
take a look at SketchUp's UI and you will see how the future will
look. Even 3DS or Maya is easier to learn that Blender.
 
D

Dotan Cohen

Even 3DS or Maya is easier to learn that Blender.
Notepad is easier to learn that VI. Not a good program does simple make.

--
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

×-ב-×’-ד-×”-ו-×–-×—-ט-×™-ך-×›-ל-×-מ-ן-× -ס-×¢-×£-פ-×¥-צ-ק-ר-ש-ת
ا-ب-ت-Ø«-ج-Ø­-Ø®-د-Ø°-ر-ز-س-Ø´-ص-ض-Ø·-ظ-ع-غ-Ù-Ù‚-Ùƒ-Ù„-Ù…-Ù†-Ù‡â€-Ùˆ-ÙŠ
Ð-Б-Ð’-Г-Д-Е-Ð-Ж-З-И-Й-К-Л-Ðœ-Ð-О-П-Р-С-Т-У-Ф-Ð¥-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я
а-б-в-г-д-е-Ñ‘-ж-з-и-й-к-л-м-н-о-п-Ñ€-Ñ-Ñ‚-у-Ñ„-Ñ…-ц-ч-ш-щ-ÑŠ-Ñ‹-ÑŒ-Ñ-ÑŽ-Ñ
ä-ö-ü-ß-Ä-Ö-Ü
 
R

r

Notepad is easier to learn that VI. Not a good program does simple make.

And not a good program does complex make either Yoda.

Assembly language is very powerful and allows full control down to the
processor level. With your logic all programs would be written in
assembly. Only problem is with that logic we would be 30 years behind
in development of software at this time. Abstraction is paramount to
advancement. With abstraction now you can focus on the problem at hand
instead of miles of steps just to get to the problem at hand. Human
beings are not hardware, we need high levels of abstraction so we can
do what we do best... dream, image, and create.
 
D

dazaster59

I am interested in the possibilities of a CAD system built on top of a
computer algebra system. I would be willing to contribute
implementations of your "entities" (and associated transforms) using
sympy, using the current 2d geometry module as a starting point. For
adequate performance it would soon need to be ported to sympy-core or
another CAS.

I'm interested in this because I like:
- the accuracy that is possible with algebraic expressions even after
cumulative transforms (eg. rotations)
- the potential for elegant, generic implementations of geometric
operations (eg. finding intersections)
- the possibilities for analysing cumulative tolerancing effects
- the benefits for simulation and analysis of physics problems (eg.
optical systems)

What do you think?
 
J

jelle feringa

Hi Josh,
http://www.pythonocc.org/ However, I'm
not entirely clear on the license for this so that might be an issue.

We're using a French license for the moment, but will move to something more
standard soon. PythonOCC ( the current SVN version ) wraps 85% of the
OpenCASCADE kernel. Consider that complete, since there are a bunch of
modules are obsolete ( WOK, drawing ).

(Binaries are supplied for win32, linux & osx.)

We're starting to work on a high level API, so this is a wonderful moment to
jump on.


-jelle
 
J

Josh Dukes

The real problem jelle is the license of OpenCASCADE. My understanding
is that it's not recognized as "free" by debian because of it's
description.

The phrase "You are also obliged to send your modifications of the
original source code (if you have made any) to the Initial Developer
(i.e. Open CASCADE S.A.S.)." describes a nonfree license, even though
the actual license, according to debian legal, is actually free and
does not specify this requirement.

If you are wrapping OpenCASCADE code, then you are also bound by this
license. Since this license, if it were as described (which it doesn't
appear to be), would not be compatable with GPL, it wouldn't be possible
to write something in PythonOCC and GPL it. If this phrase could be
removed then OCC could be included in debian free and this would
actually solve a lot of other problems for free cad software.

Debian's legal department still wanted to avoid classifying this as
free because of the qualifying description from upstream. It seems
that it's debian's general policy to avoid legal conflicts with
upstream developers, even if those developers don't appear to have any
legal standing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top