Wavefront to DXF 3D polymesh conversion

Hello everybody,

I need to convert polygon meshes either .stl, .obj, or .3ds into AutoCAD dxf 3d mesh format.

The standard .dxf output from Blender does not seem to be of the exact type I need.

Is there a plug-in available for blender that could handle this?

Any other free or low cost file conversion tool you know of that might be able to handle this?

Thanks in advance,

The Evil PlantStalker

“does not seem to be of the exact type I need” - Can you explain?
Also, are there other formats you could use?

Ideasman42,

Thank you for your reply. This is a bit complicated issue. Software able to do this kind of conversion seem to be rare. I just figured out the that the most convenient way to make a tool like that oneself would be to make a dxf mesh export script for blender…since blender is already geared towards importing the above mentioned types of polygon meshes.

…The problem is that I don´t know anything about programming!!! :slight_smile:

All the best,

The Evil Plantstalker

Well, just explain what you want to import export etc.

If there is a bug in any of the tools, we can look at fixing it for you, but you need to explain what your trying to do.

What is the issue with DXF export?

Ideasman42

I need to export dxf as dxf 3d polymesh (AutoCAD R12). I have tried exporting from Blender as dxf…but it doesn´t seem to export the seemingly rare type of dxf I need. Actually this is no big deal. I can live with out these dxf 3d polymeshes. My apologies for starting this topic/thread.

Plantstalker,
Currently I write the importDXF-3d script and I could write export-dxf script too, but I see no requirements. Programming for 3d-polymesh is not more complicated then for another autocad entities, so if many people call for this functionality, I could write it next.

Remi_01

Thank you for your reply. I must admit I find it very interesting to be exchanging messages with the one responsible for the dxf imp/exp scriptwriting. (For a simple mind/atrophic brain like me these polygon files are a little bit mysterious ;-)).

Anyway, just idle curiosity. Work of this type (writing such a script) …is it very time consuming for someone familiar with Python and the file format mentioned?

P.s…gonna email Okino and ask them if their PolyTrans file converter application is able to handle this…their software might be able to satisfy my abnormal preferences.

Best regards,

The Evil Plantstalker

sure you cant give some details? - I need to do some maintainince on blenders built in importers and exporters so it would be good to know what is not working for you.

Ideasman42 & Remi01

I think the problem is that I need a dxf mesh consisting of squares, not triangles :confused:

All the best,

The Evil Plantstalker

I just tested and blender can import and export squares (quads) to DXF. - try with a cube even.
I expect the program your exporting from coinverts all quads to triangles.
Was there something else missing?

Ideasman42

“I expect the program your exporting from coinverts all quads to triangles”

Not sure if I am understanding you completely here (English is not my natvie one). I wanna import .obj as a mesh consisting of triangles and export it as dxf as a mesh consisting of quads. I thinks thats what I need. Is Blender able to handle this? If Blender can´t it´s no big deal.

P.S. If Blender can, which settings should be choosen during the export process to obtain the much desired “quads only” result?

All the best,

The Evil Plantstalker

yep, blender can do this no problems.

However converting triangles to quads is not somthing that can be automatic because there needs to be limits as to which triangles join.

  • import obj,
  • enter editmode,
    (Edit Buttons, Mesh Tools panel there is a “Join Triangles” button) - Or press Ctrl+J in the 3d view.
  • Export the model as DXF.

Ideasman42,

Thanks a lot for the tips. Obviously Blender is a powerful tool ( I am new to it). However this route didn´t quite yield the odd type of dxf I need (this is something special and even Rhino doesn´t put this typ out).Anyway, Let´s just forget this whole mesh thing.

However I do have a nother rather naive question not related to Blender at all. Interested in learning how to program (I am a NERD :cool:), or at least getting some grip on it. Would Python be a suitable language for a beginner? Or should I rather try Visual Basic or Java. Which one of these is the most poweful one:confused:?

All the best

The Evil Planstalker

I would say pythons a lot easier to learn then java (and I wouldnt bother with VB anyway)
Python is generally known to be one of the better languages to learn.

We shall lay this subject to rest :wink: - however I had a look at blenders DXF import/export and Im not sure what your expecting, blender imports and exports quads and triangles for obj and DXF.

if you have some kind of format your expecting, best provide a DXF from rhino.

Perhaps your used to rhino’s nurbs?

Yes I´m a NURBS man :-).

Anyway. thanks for commenting on programming languages. Gonna take a further look a Python then. Have had some books on C and Java for some time but never really looked at them. Who knows maybe I´ll be a skilled Python scripter after a few years of occasional experimentation ? :wink:

All the best,

The Evil Plantstalker

np, Iv loooked at adding even basic nurbs support to the OBJ format but it seems other applications (Maya for instance) dont support nurbs in OBJ so its hard to test.

Ideasman42,

Does the .obj file format support NURBS? Hadn´t heard of that before. Anyway, actually this exchange of messages here has been quite helpful for me to understand the problem I am encountering. Yesterday I had on of those lightbulb moments (in my case these are rare and long between). It occured to me that order to obtain the fine mesh I am going for one must tessellate to quads before saving to dxf. Something tells me Blender is probably able to do this.

yep, obj does nurbs, but I every app Iv seen so far just converts nurbs to a mesh when saving to obj, and dosnt load the obj nurbs.

Im also not sure how good the nurbs support is - weather it supports all nurbs options that applications use.

so in practice, it dosnt

If all commercially available applications avoid utilizing the NURBS support availble in the .obj format it is temptating to jump to the conclusion that the support the format offers in incomplete or somehow seriously flawed.

Anyway, one of the more interesting NURBS topics is the proper tessellation of trimmed NURBS (to quads mesh of course). This is something that seems to be hard to implement and is perhaps not widely supported. I dug up an algorithm for this but the math is of course not readable by ordinary human beings.