wire-frame only parts after idf import

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
lorenznl
Posts: 6
Joined: Wed Feb 19, 2014 9:00 am

wire-frame only parts after idf import

Post by lorenznl »

Hi all,

I have a problem with idf import (my be a driver error, but as I'm new to freecad ...)

The problem is, that the part on the pcb I'm inporting are wire-frame only.

The idf file is generated from cadsoft eagle using the generate_3d_dat.ulp version 0.91.

Any hints how to resolve this?
--

Lorenz
Last edited by lorenznl on Wed Feb 19, 2014 4:33 pm, edited 1 time in total.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: wire-frame only parts ofter idf import

Post by jmaustpc »

Hi Lorenz
Welcome here.

Please read the first topic at the top of the help forum, READ FIRST BEFORE ASKING FOR HELP!!! .

Specifically it might help if you post you FreeCAD help about data, perhaps some files for example a fcstd file, that demonstrates the issue.

Jim
lorenznl
Posts: 6
Joined: Wed Feb 19, 2014 9:00 am

Re: wire-frame only parts ofter idf import

Post by lorenznl »

Ah, well ...

OS: Windows 7
Platform: 64-bit
Version: 0.14.2778 (Git)
Branch: master
Hash: 0506a918b24e015ac6277a7cf613ce151e1dee44
Python version: 2.6.4
Qt version: 4.5.3
Coin version: 2.4.5a
SoQt version: 1.4.1
OCC version: 6.3.0

attached are the idf fileset and the result produced by importing it as FCStd file
--

Lorenz
Attachments
LEDs.7z
(193.39 KiB) Downloaded 279 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: wire-frame only parts ofter idf import

Post by jmaustpc »

When I try to import you emn file I get the following error message, so I have file a bug report

issue #1424


Have you tried to import any other emn files? Does it fail on all or just this specific file?

Jim


Started with opening of "/home/user/Downloads/LEDs.emn" file
Emn version: 3.0
Found board thickness 1.60
['LED1L.1', 'PLCC4-3A-F2.1_salvia-opto.1', 'PLCC4-3A-F2.1.1', 98.33, 133.9, 180.0, 'BOTTOM', 'PLACED']
['LED1L.2', 'PLCC4-3A-F2.1_salvia-opto.2', 'PLCC4-3A-F2.1.2', 98.33, 133.9, 180.0, 'BOTTOM', 'PLACED']
['LED1L.3', 'PLCC4-3A-F2.1_salvia-opto.3', 'PLCC4-3A-F2.1.3', 98.33, 133.9, 180.0, 'BOTTOM', 'PLACED']

edited, - many lines similar to the above deleted


['X1R.16', '53261-04_salvia-molex.16', '53261-04.16', 80.0, 150.0, 0.0, 'TOP', 'PLACED']
['X1R.17', '53261-04_salvia-molex.17', '53261-04.17', 80.0, 150.0, 0.0, 'TOP', 'PLACED']
['X1R.18', '53261-04_salvia-molex.18', '53261-04.18', 80.0, 150.0, 0.0, 'TOP', 'PLACED']
.HEADER
.BOARD_OUTLINE
.DRILLED_HOLES
.PLACEMENTmid point <function mid_point at 0x212ded8>
mid point <function mid_point at 0x212ded8>
mid point <function mid_point at 0x212ded8>
mid point <function mid_point at 0x212ded8>
Added outline
Cutting shape inside outline
Cutting shape inside outline
Proceed 3 outlines
Emp version: 3.0

edited, - many blank lines which had been in the report view deleted



Adding EMP model LED10L.1
Adding EMP model LED10L.2
Adding EMP model LED10L.3

edited, - many lines similar to the above deleted


Adding EMP model X1R.8
Adding EMP model X1R.9
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/user/Downloads/cad/build/Mod/Idf/Idf.py", line 66, in open
process_emn(doc,filename)
File "/home/user/Downloads/cad/build/Mod/Idf/Idf.py", line 132, in process_emn
place_steps(doc,placement,board_thickness)
File "/home/user/Downloads/cad/build/Mod/Idf/Idf.py", line 330, in place_steps
model_file=pythonopen(model_tab_filename, "r")
<type 'exceptions.IOError'>: (2, 'No such file or directory', '/home/user/Downloads/cad/build/data/Mod/Idf/lib/footprints_models.csv')




OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3167 (Git)
Branch: master
Hash: bb98b5afb0890d786da88aaf8dc8bf05872c5d7a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
lorenznl
Posts: 6
Joined: Wed Feb 19, 2014 9:00 am

Re: wire-frame only parts ofter idf import

Post by lorenznl »

jmaustpc wrote:When I try to import you emn file I get the following error message, so I have file a bug reportissue #1424
Didn't catch the error in the status line, but after enabling the log file I see the errer too

Happens with 0.13 too. But the idf.py in both versions is identical anyway.

jmaustpc wrote:Have you tried to import any other emn files? Does it fail on all or just this specific file?
not yet, but checking now ...

... seems to be the same for all emn/emp I've tested so far.


I'll play around a bit tomorrow, if I can make sure it's not a format error in the emn/emp files
--

Lorenz
lorenznl
Posts: 6
Joined: Wed Feb 19, 2014 9:00 am

Re: wire-frame only parts after idf import

Post by lorenznl »

Ok, digging around I found the origin of the exeption and the solution for my original problem (the wire frame only parts):

1) the exception occures because idf.py expects footprints_models.csv to be in
  • .../data/Mod/Idf/lib
but in fact it is located in
  • .../Mod/Idf/Idflibs (0.14 git 2778)
or
  • .../Mod/Idf/lib (0.13)
respectively (at least in the installations I have available here)


2) the cure for my wire frame problem is changing line 45 in idf.py from
  • EmpDisplayMode=2 # 0='Flat Lines', 1='Shaded', 2='Wireframe', 3='Points'; recommended 2 or 0
to
  • EmpDisplayMode=0 # 0='Flat Lines', 1='Shaded', 2='Wireframe', 3='Points'; recommended 2 or 0
Barleyman
Posts: 4
Joined: Tue Mar 04, 2014 9:38 am

Re: wire-frame only parts after idf import

Post by Barleyman »

The python file should be fixed. Since you have already mantis account etc, would you file a bug about it? In ideal world of course someone should make a pull request for revised python file. Even deeper into territory of "do not have necessary stuff set up and not going to bother as I have already patched our local company version".

It seems that the FreeCAD.getResourceDir() points to installdir/data now (did it always?) and it's not possible to get from there to the correct folder (installdir/mod)

Changing these lines

Code: Select all

## path to table file (simple comma separated values)

model_tab_filename = FreeCAD.getResourceDir()+ "Mod/Idf/lib/footprints_models.csv"

## path to directory containing step models

step_path=FreeCAD.getResourceDir()+ "Mod/Idf/lib/"
Into this

Code: Select all

## path to table file (simple comma separated values)

model_tab_filename = FreeCAD.getHomePath()+ "/Mod/Idf/idflibs/footprints_models.csv"

## path to directory containing step models

step_path=FreeCAD.getHomePath()+ "/Mod/Idf/idflibs/"
fixes the problem
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: wire-frame only parts after idf import

Post by jmaustpc »

I was wrong about the items being imported as wires, they were solids, but were set to wireframe display mode. I was confused because I was not expecting each of the components to be made up from a few solids, I as expecting them to be one solid.

So should they be imported in wireframe display mode, or should the default display mode on import be set to "flatlines"? I would have thought it should be flat lines.

The error message is still there of course, I have updated the Mantis ticket to reflect the above and to link to this topic and the last post above.

http://freecadweb.org/tracker/view.php?id=1424
Barleyman
Posts: 4
Joined: Tue Mar 04, 2014 9:38 am

Re: wire-frame only parts after idf import

Post by Barleyman »

Since there were some other issues too, I made a pull request in git for the bunch.

Maybe it gets included someday.
Post Reply