How can I read CAD files into my C program ?

J

johnnash

Is there anyway to do this ? The objects are being modeled using
NURBS. How do I go about building reader in C ? Are there any pre
built libraries that I can refer to build one myself ?
 
M

Malcolm McLean

johnnash said:
Is there anyway to do this ? The objects are being modeled using
NURBS. How do I go about building reader in C ? Are there any pre
built libraries that I can refer to build one myself ?
Try rooting about on the Internet. wotsit.org is a good place to start for
the file, format. If your CAD format is not protected - most commerical
companies give read permission but not permission to generate new files in
the format - there will almost certainly be some code for it.

C readers are built on top of primitive IO functions like fscanf(). Normally
it is not particularly challenging to code a reader - the format has been
designed for the purpose of being read, after all - but it is rather tedious
because there are a lot of error cases.
 
I

Ian Collins

johnnash said:
Is there anyway to do this ? The objects are being modeled using
NURBS. How do I go about building reader in C ? Are there any pre
built libraries that I can refer to build one myself ?

Check your documentation, most CAD products I've worked with provide an API.
 
B

Bartc

Malcolm McLean said:
Try rooting about on the Internet. wotsit.org is a good place to start for
the file, format. If your CAD format is not protected - most commerical
companies give read permission but not permission to generate new files in
the format - there will almost certainly be some code for it.

C readers are built on top of primitive IO functions like fscanf().
Normally it is not particularly challenging to code a reader - the format
has been designed for the purpose of being read, after all - but it is
rather tedious because there are a lot of error cases.

That's the opposite from what I've found, especially with Autodesk products
(although opendwg.org provides useful tools). Or the format is complex and
designed to be accessed via an API -- with a C++ interface.

The OP posted the same question a couple weeks back; the code had to be in
C, but did not give further details as to the specific format.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top