Henjin
Henjin

Reputation: 539

export cad formats from unity3d

I've been trying to export certain things in my scene as a cad file (like dxf or dwg) but so far nothing. I know dxf is an ASCII format but I couldn't crack it (like I did with fbx). and I've found some resources but they are for the newer versions of .net than what unity tends to use. where can I start or what should I do? any ideas?

Upvotes: 2

Views: 3256

Answers (2)

fang
fang

Reputation: 3623

DXF file is a good choice to export your cad data. It supports many types of curves (lines, arcs, splines,...etc) and also facets and it is in ASCII format. The DXF format can be relatively confusing at the first glance, but it is actually relatively simple. A DXF file is mainly consist of 6 sections (HEADER, CLASSES, TABLES, BLOCKS, ENTITIES and OBJECTS) and each entry (whether an integer value or a double value) is started with a group code (which by itself is an integer).

Here are two links to get you started to learn more about DXF export/import:

1) A good tutorial for exporting to dxf file.
2) A comprehensive DXF reference

To export triangular facets, you will use 3DFACE entity. To export curves, use ARC, LINE, CIRCLE, ELLIPSE, SPLINE and POLYLINE entities. You can find the description about these entities under the ENTITIES section in the DXF reference pdf file (the 2nd reference above).

Upvotes: 3

code11
code11

Reputation: 2309

This is a great question, and one that is somewhat hard to search for, since everyone is concerned about importing things into unity.

However, I did find a way to export things to .obj files which you might be able to convert to what you want.

http://wiki.unity3d.com/index.php?title=ObjExporter

I am a bit ignorant of the file type specifics of .obj, but I believe it supports multiple disconnected 3d objects, which is what you want.

For completeness sake, trying to do the same thing with animations however seems impossible for the moment.

Upvotes: 1

Related Questions