Is there a comprehensive spec for the open CAD format?

345 views
Skip to first unread message

josefsalta

unread,
Aug 22, 2009, 3:58:13 PM8/22/09
to open_cad_format
Hi,
I've just installed FreeCAD which supports a data format called "open
cad format" *.oca
In FreeCADs web-page http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Manual
, there is a link to http://groups.google.com/group/open_cad_format -
this group. So I assume that FreeCAD is using the data format
presented here.

I drew two cubes and a cylinder in FreeCAD, saved the drawing in the
OCA format and yielded to following result:

#oca file generated from FreeCAD
# edges
# faces
A1=S(POL P(-8.0 -4.89842541529e-16 10.0) P(-8.0 -4.89842541529e-16
0.0) P(-8.0 -4.89842541529e-16 10.0))
A2=S(POL P(-8.0 -4.89842541529e-16 10.0) P(-8.0 -4.89842541529e-16
10.0))
A3=S(POL P(-8.0 -4.89842541529e-16 0.0) P(-8.0 -4.89842541529e-16
0.0))
A4=S(POL P(0.0 0.0 100.0) P(0.0 0.0 0.0) P(0.0 100.0 100.0) P(0.0
100.0 0.0) P(0.0 0.0 100.0))
A5=S(POL P(100.0 0.0 100.0) P(100.0 0.0 0.0) P(100.0 100.0 100.0) P
(100.0 100.0 0.0) P(100.0 0.0 100.0))
A6=S(POL P(100.0 0.0 0.0) P(0.0 0.0 0.0) P(100.0 0.0 100.0) P(0.0 0.0
100.0) P(100.0 0.0 0.0))
A7=S(POL P(100.0 100.0 0.0) P(0.0 100.0 0.0) P(100.0 100.0 100.0) P
(0.0 100.0 100.0) P(100.0 100.0 0.0))
A8=S(POL P(0.0 100.0 0.0) P(0.0 0.0 0.0) P(100.0 100.0 0.0) P(100.0
0.0 0.0) P(0.0 100.0 0.0))
A9=S(POL P(0.0 100.0 100.0) P(0.0 0.0 100.0) P(100.0 100.0 100.0) P
(100.0 0.0 100.0) P(0.0 100.0 100.0))
A10=S(POL P(100.0 0.0 110.0) P(100.0 0.0 10.0) P(100.0 100.0 110.0) P
(100.0 100.0 10.0) P(100.0 0.0 110.0))
A11=S(POL P(200.0 0.0 110.0) P(200.0 0.0 10.0) P(200.0 100.0 110.0) P
(200.0 100.0 10.0) P(200.0 0.0 110.0))
A12=S(POL P(200.0 0.0 10.0) P(100.0 0.0 10.0) P(200.0 0.0 110.0) P
(100.0 0.0 110.0) P(200.0 0.0 10.0))
A13=S(POL P(200.0 100.0 10.0) P(100.0 100.0 10.0) P(200.0 100.0 110.0)
P(100.0 100.0 110.0) P(200.0 100.0 10.0))
A14=S(POL P(100.0 100.0 10.0) P(100.0 0.0 10.0) P(200.0 100.0 10.0) P
(200.0 0.0 10.0) P(100.0 100.0 10.0))
A15=S(POL P(100.0 100.0 110.0) P(100.0 0.0 110.0) P(200.0 100.0 110.0)
P(200.0 0.0 110.0) P(100.0 100.0 110.0))

While I admit that there are pretty much similarities to the format
discussed in this group, it is finally quite different. Particularly
the statement "S(POL ... )" but also the way the cylinder is specified
(A1 to A3) is quite cryptic to me.

Is there a comprehensive summary of the format available?

Thx for help

Josef

yorik

unread,
Sep 5, 2009, 4:26:33 PM9/5/09
to open_cad_format
Hi,
I responded this message a week ago, by email, but I see now that for
some reason it didn't arrive here, so I post my answer here again:

Hi Josef & everyone else,

It's me who coded the OCA part of FreeCAD, and I must admit it is
pretty bare and buggy. I just made a first attempt and never worked
much further on it. To my great shame I still never posted anything
about it here, it's on my todo list since months...

I actually made some tests with gCAD3D, managed to export back and
forth a couple of things, but not much more.
The part I'm developing in FreeCAD at the moment is the 2D drafting
module. I made the OCA importer mostly with the idea of having one
more application supporting that format, but never used it much,
basically because there are no other OCA apps for me to play with.
Also, since my concerns until now are only 2D, I concentrated on what
would be useful for me, basically simple 2D entities like lines,
circles, etc. The more complex 3D entities are almost not supported at
all, so that's probably why you get so disappointing result.

The 2d drafting module doc is here:
http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=2d_Drafting_Module
The OCA importer doc is here: http://sourceforge.net/apps/mediawiki/free-cad/index.php?title=Draft_OCA

Now, the importer is quite easy to extend. It is a single python
script located in the Mod/Draft folder of FreeCAD. If someone around
here had interest in it, I could add more stuff too. FreeCAD itself
evolved quite a lot in the last months, so it might be a good time to
have a new look at this.

Cheers & sorry for the lack of info about this

Yorik
Reply all
Reply to author
Forward
0 new messages