← Back to team overview

kicad-developers team mailing list archive

Re: patch for IDFv3 component library support

 

----- Original Message -----

> From: jp charras <jp.charras@xxxxxxxxxx>
> To: Cirilo Bernardo <cirilo_bernardo@xxxxxxxxx>; "kicad-developers@xxxxxxxxxxxxxxxxxxx" <kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Cc: 
> Sent: Sunday, January 26, 2014 6:15 PM
> Subject: Re: [Kicad-developers] patch for IDFv3 component library support
> 
> Le 25/01/2014 22:28, Cirilo Bernardo a écrit :
>>  ----- Original Message -----
>> 
>>>  From: jp charras <jp.charras@xxxxxxxxxx>
>>>  To: kicad-developers@xxxxxxxxxxxxxxxxxxx; 
> "cirilo_bernardo@xxxxxxxxx >> Cirilo Bernardo" 
> <cirilo_bernardo@xxxxxxxxx>
>>>  Cc: 
>>>  Sent: Sunday, January 26, 2014 2:49 AM
>>>  Subject: Re: [Kicad-developers] patch for IDFv3 component library 
> support
>>> 
>>>  Le 25/01/2014 04:01, Cirilo Bernardo a écrit :
>>> 
>>>>   Hi folks,
>>>> 
>>>>    I have pushed a patch to my github patches project
>>>>    (git clone https://github.com/cbernardo/kicad-patches.git)
>>>> 
>>>>    The patch name is export_idf3_libs.patch and was created against 
> Rev 4632.
>>>>    The patch adds IDFv3 component library support; the addition of 
> this 
>>>  feature
>>>>    provides users with the IDF support required for interaction with 
> 
>>>  mechanical
>>>>    designers.
>>> 
>>>  <Skipped ...>
>>> 
>>>  I committed you patch.
>>>  Thanks.
>>> 
>>>  I am able to import IDF files with Top Solid.
>>> 
>>>  FreeCAD reads these files, but does not show anything.
>>> 
>>>  This is certainly a FreeCAD bug.
>>>  However, could you have a look about this.
>>>  Perhaps there is just a missing info in IDF files.
>>>  FreeCAD seems to be the only one FOSS MCAD tool which is able to read
>>>  IDF (*.emn) files.
>>>  (If you know an other FOSS MCAD tool which reads IDF files, let me 
> know)
>>> 
>>>  Thanks.
>>> 
>>>  -- 
>>>  Jean-Pierre CHARRAS
>>> 
>> 
>>  I have confirmed that it is a bug in FreeCAD:
>> 
>>  File "/home/cirilo/usr/local/Mod/Idf/Idf.py", line 245, in 
> process_emp
>>  if emprecords[0][0:4]==".END":
>> 
>>  File "/home/cirilo/usr/local/Mod/Idf/Idf.py", line 92, in 
> process_emn
>>  if emnrecords[0][0:4]==".END":
>> 
>>  An exception is thrown because each line in the *.emn and *.emp file is
>>  assumed to be at least 4 characters long. The blank lines in the IDF files
>>  generated cause the Python script to throw an exception. The IDFv3
>>  specification is silent on the topic of blank lines and the examples
>>  have no blank lines; I included the blanks to enhance human readability
>>  but I can remove them if that is preferred.
>> 
>>  The FreeCAD script has many other bugs though, for example assuming that
>>  'END' is capitals when the specification explicitly states it is 
> not
>>  case sensitive.
>> 
>>  - Cirilo
>> 
>> 
> 
> Thanks for your work.
> 
> Human readability is important. Patching Idf.py to skip blank lines is
> better.
> 
> Can you submit a bug report (or a patch) with your remarks to FreeCAD team?
> 
> 
> Thanks.
> 
> -- 
> Jean-Pierre CHARRAS
> 

I have filed a bug report for FreeCAD:

http://www.freecadweb.org/tracker/view.php?id=1366


I did not patch the code since I would probably become obsessed with checking compliance to the standard. :}

- Cirilo



References