DXF Importer

@CND It looks like I can’t really well explain why and how the DXF Importer and the SHP/HGT/OSM could get aligned planes with x,y,z offset values as custom scene properties along the lat/long ones. Maybe you could speak with them (vvoovv and @domlysz). You may understand each other better between professionals :smiley:
As said before, DXF has no georeferencing datas because of the very high precision it has. It just stores that the “vertecies” are at 7213km278m647mm. Blender can’t get a mm precision if the vertecies is at more than 1000km away form origin (don’t know exactly when 32bit float start to have a precision under .001 actually but from test it’s sure that 1000km is already too much for a real cm precision) so it needs those offsets (which we get with your center option and the lat/long values from SHP/OSM…). You see, I can’t explain it really well :confused:
Such DXF file are produces when you work with GIS data in Autocad. Actually all plans I work with are in Germany and come from GIS datasets and for that reason, are very far away from origin.

Pretty good, tested with Arc, Ellipse, Line, Polyline (open&closed), Spline.
All good conversions to Blender curves.
Hatch is missing.

NEW VERSION 0.8.4

@matali: I have some good news for you: the new version now does geo referencing - IF you install pyproj. There’s a instruction on the bitbucket site (https://bitbucket.org/treyerl/io_import_scene_dxf). pyproj lets you choose the reference coordinate system. so you can import your arcgis / openstreetmap data to your local coordinate system if needed. What’s pretty cool about it: if you have two different files containing the map data from different locations but the same reference system they will get aligned if you import them to the same scene.

@JuhaW: Thank you for testing! Glad it worked out. Hatches are missing yes. Also “Leaders” are not supported. Hatches may follow with colors etc later this year. I am focusing on geometry right now.

@CND nice :slight_smile: Thanks a lot, will try it tonight :slight_smile:

Edit: just tested and I can’t choose the projection type. The scene’s custom properties are created and pyproj in installed (linux mint 16 64bit with pyproj 64bit and blender 64bit). Tried on custom build and official 2.70a.

Does that mean you don’t see the Geo Referencing Panel? It should look like on this screenshot:

Or does your prefered projection type not appear in the dropdown list?
Did you put pyproj in the modules folder of blender, or did you just install it on your machine? pyproj must be available to Blender’s python interpreter not to your system’s interpreter.

Hi CND,

Tried to copy pyproj (self-compiled version by using “python setup.py build” on Ubuntu 13.09) in “2.70/python/lib/python3.x/site-packages” and/or “2.70/scripts/modules”. I tried with both Blender 2.70a and 2.71 (as I thought it may be due to conflict between Python 3.3 in system and 3.4 in Blender). NO success, I can’t see the panel like in your screenshot. I’m using your addon v.0.8.4.

Edit: I’ve an error on the standard output : geo referencing: blender2.71/build_linux/bin/2.70/scripts/modules/pyproj/_proj.so: undefined symbol: _Py_ZeroStruct

.so is the ending for dynamic libraries on UNIX. I assume you know that. Can’t give you any advise aside from “try it with pip install”.

WINDOWS: what you need to do first is download a 64bit version of python. Default python download for windows is 32bit on python.org.
https://www.python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi
If you don’t have Visual Studio 2010, install it. http://www.visualstudio.com/downloads/download-visual-studio-vs
Once you have that you also need to install Windows 7.1 SDK:
http://www.microsoft.com/en-us/download/details.aspx?id=8442
Make sure you download GRMSDKX which is for 64bit. You probably have to uninstall VC++2010 Redistributable in order to be able to install GRMSDKX. You may also need to update your VC compiler: http://support.microsoft.com/kb/2519277/en

In the command-line console then enter (right click for copy paste):
CALL “C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd” /x64

pip install pyproj

The source files from pyproj website did not work for me, pip install did.pyproj will be installed in C:\Python34\Lib\site-packages\pyproj. Copy that folder now to Blender-Installation\2.70\scripts\modules.

Attached you’ll find a 64bit build for new testbuilds of the upcoming Blender 2.71 with python 3.4.
pyproj.zip (1.39 MB)

Hi,

I don’t use Blender a lot, but I promote it among my customers, students and other friends.

I own a company that is dedicated on selling CAD/CAM software. One of the brands, Cabinet Vision has the ability to quickly produce rendering to customers that want to know how their furniture will look like. It’s a modest rendering. Poor when compared to some of the jobs from the forum members…

I’m looking for a way to render these jobs outside CV. I was looking at Blender for that. I can output a DXF file. I could already import it into Keyshot and it was correctly interpreted. Blender’s plugins for importing DXF files are not importing these files.

I tried this plugin but the several errors show up and no import is made

I was wondering if you could help me on this. Here is an example of a DXF file outputted from CV.

Regards,
Carlos Rodrigues

hi Carlos, hi Lukas,
we are getting a range of errors because this file is not quite DXF conform, though it was easy to fix it.
Here is a small patch for 0.8.4 “do.py” file: io_import_dxf_0.8.4_patch.zip (12.2 KB)


.

Hi Carlos, hi Remigiusz,

thank you for the bug report and the fix. I think I will have time on the weekend to include it also together with some additions to make matali happy :wink:

Lukas

:slight_smile: Can’t wait :slight_smile:

Hi Migius,

Your patch worked perfectly. Many, many thanks!

I did some tests and every exported DXF was well handled using this addon. But your remark about the DXF not being quite conform is now what I need you to extend.

Can you tell me what it was not conform so I can report it to the CV guys? That would be great.

Regards,

Carlos Rodrigues

hi Carlos,
here the short report:

  • there is no header section in this dxf file
  • there are number of triangle 3DFACE-entities with wrong order of vertex indices, e.g. (0,5,5,3) instead of (0,3,5,5). Following DXF specification for 3DFACE: if only three corners are entered, the fourth index must be the same as the third one.

Hope you all got a good time on holydays.
Any news on those additions ?

Cheers,
Matali

Good news! The DXF importer is in master. Will be part of 2.72. Give it a try and report bugs please!
https://builder.blender.org/download/

Since the 2.49 days I have dreamed of this. Congrats this will most certainly be very useful to all Blender architects out there.
Thanks for your work, will give it a test soon.

It is actually.
Replace the do.py file with the following do.py from my dropbox

Where ever this is on your platform…
2.73/scripts/addons/io_import_dxf/dxfimport/do.py

Bug report
https://developer.blender.org/T43426

Thank you, Linusy, for fixing this. Apparently my reply I typed on my phone last week didn’t come through.

Thanks! Will try it again soon.

Hi Lukas and Migius,

When my students try to import DXF Datas, they get 10 of thousands of object and it makes Blender unusable. I had a look, it is due to the blocks duplicate. Would it be possible to make dupli-faces instead of linked objects or group instances to instantiate 1000 of trees and other block objects without slowing Blender ?

Thanks