Import 2D from .dxf - how to auto-define (sur)faces?

Hi, I created a moderately complex 2D-shape with qCAD and now would like to extrude it with blender, to ultimately get .STLs to feed into an extruder.

So I import a .dxf, as Bezier curves, and now theoretically can extrude it without converting it to a mesh before (as it has curved lines, making a mesh seems like quite a mess).

Problem is: how to define which 2-D lines constitute a surface (and extrude to volume) and which ones don’t (extrude to planes?) - If I didn’t make it clear, the double image attached (not the actual file I’m working on) should.

Thanks a lot!


Of course I tried to create the missing surfaces in Blender. But my 2D-model, transformed to a mesh, has a few hundred vertices, and neither “create face” nor “fill” seems to work. One does nothing, and the other one creates something weird with holes in it and vertices crossing each other.

I also tried to do it manually, clicking 4 vertices, hitting F (alternatively shift-F), repeat, repeat, repeat. But when I extruded the result to the Z dimension, it was corrupted. Some vertices on different Z-planes had vertices changing also in XY-coordinates, and some parts even extruded to adverse directions in Z.

You’ll have to manually edit the imported mesh to get rid of the extra vertices and then manually create the faces one by one. I’ve tried what you are doing myself and found the process so tedious and aggravating that I just remodeled the object in Blender.

some ideas:

there are two dxf importers on the pull-down list. i find the second one gives better results and has a lot of config options

you can control how the various dxf objects are converted (probably best to convert all to mesh objects) and also how the objects are grouped. then a dxf group/block will appear as a distinct mesh in blender.

you can also set the scale for the conversion…scale is an issue…if the object is very large or very small relative to blenders unit…bad behaviour

do a routine W > remove doubles

when you have your individual meshes organized, select a vert ctrl-L to select all connected, try shift-F to fill. if it works more or less, remove the odd extraneous edge, then alt-J (tris to quads) and maybe alt-F to tidy up.

as maspier says…can be tedious

I will try these, but it makes me ask if anyone knows a (free) application that may be better suited for my task, especially considering that I currently have no need for Blender’s other features.

Thanks a lot, I think especially cleaning out the doubles helped. Also, I subdived my complex shape into more or less concave segments, which seems to make it workable for the fill algorithm. Looks fine now.

OK, and for anyone else trying this, I found there are more things to heed:

STLs consist only of triangles, which have to be connected in such a way, that on no side of a triangle T1 another triangle T2 has a corner. Corners of triangles may only be placed on corners of other triangles.

Also, check the normals - they are not allowed to point in different directions.

Also, delete any superflous vertices (not connected to anything). Else Blender might do strange things when extruding.

Also, delete double vertices.

Also, remove superflous faces before extruding, that is faces intersecting each other.

Also, remove faces that may exist inside your extruded volume.

Also check if the new faces generated by extruding are complete; fill the gaps if there are any.

Use a STL sanity checker (there are several around) if you got it all right

If you follow all the steps mentioned on this page, you may get a sane STL file, and more important, stay sane yourself.

that should cover it!
it’s ok as a one off but…
it seems like a long way around if you have to do this again.
it would seem better to do it all in blender or to do it all in some other software
i’m guessing you’re on a linux machine