Discussion:
Eagle + generate_3D_data.ulp -> IDF -> FreeCad -> Many 3D formats
(too old to reply)
Barry Walker
2013-12-18 18:34:20 UTC
Permalink
The generate_3d_data script has fallen into disrepair and hasn't seen
any improvements in over two and a half years. 

I needed to generate 3D board data for a customer, so I took the
opportunity to make some fixes.  In my research I found that FreeCAD
(exactly what it sounds like) has an IDF import function.  Unfortunately
that module (idf.py) is not installed in the default Windows
distribution, but it is easy to copy and paste.

The old version of generate_3d_data had many issues that were
incompatible with the FreeCAD import filter.  With some guessing and
testing I made it work.  I think the rest of the operation of
generate_3d_data is unchanged.  It may still have some pre-existing
bugs, and I may have introduced new bugs.  For my purposes it seems to
be working very well.

What I don't know know is if this new version is compatible with other
3D CAD packages.  I have a friend testing SolidWorks, but I don't have
access to any of the other packages.  I would appreciate help testing if
you have other systems available.

From FreeCAD you can generate STEP, IGES, and many other formats after
the IDF file is imported.

The new version 0.90 ulp is attached.

Merry Christmas!

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/97686

Attachments:
generate_3d_data_v090.ulp.zip
Lorenz
2013-12-19 07:02:22 UTC
Permalink
Post by Barry Walker
The generate_3d_data script has fallen into disrepair and hasn't seen
any improvements in over two and a half years. 
I needed to generate 3D board data for a customer, so I took the
opportunity to make some fixes.  In my research I found that FreeCAD
(exactly what it sounds like) has an IDF import function.  Unfortunately
that module (idf.py) is not installed in the default Windows
distribution, but it is easy to copy and paste.
The old version of generate_3d_data had many issues that were
incompatible with the FreeCAD import filter.  With some guessing and
testing I made it work.  I think the rest of the operation of
generate_3d_data is unchanged.  It may still have some pre-existing
bugs, and I may have introduced new bugs.  For my purposes it seems to
be working very well.
What I don't know know is if this new version is compatible with other
3D CAD packages.  I have a friend testing SolidWorks, but I don't have
access to any of the other packages.  I would appreciate help testing if
you have other systems available.
From FreeCAD you can generate STEP, IGES, and many other formats after
the IDF file is imported.
The new version 0.90 ulp is attached.
there is a thread regarding generate_3d_data vs. eagle V6

http://www.eaglecentral.ca/forums/index.php/m/150121/6377607912ccb8b76588a5b350a10e2a/?srch=generate_3d_data#msg_150121

maybe Mr. Zaffran will chime in anyway, but if not you could contact
him to obtain a copy of the updated ULP and combine it with your
changes.
--
Lorenz
Lorenz
2013-12-19 09:54:13 UTC
Permalink
Hi Barry,
Post by Barry Walker
The generate_3d_data script has fallen into disrepair and hasn't seen
any improvements in over two and a half years. 
[...]
The new version 0.90 ulp is attached.
I was not aware about Freecads import capability for idf.

It took me some time (because I'm not familiar with Phyton) but I
managed to obtain the mod/idf code from githup.

The idf file generated with your version of the generate_3d_data.ulp
loads in Freecad (0.13) without issuing an error (unlike Mr. Zaffrans
1.3 Version which throws an exception 'both points are equal'), but
...

1) parts are only wireframe
2) bottom parts are placed on top
3) I have two 4mm vias (GND for test clips), but only one of them
shows up in the import
4) the mounting holes (arcs in the dimension layer of a package, that
is: coutouts no drills) don't show up at all


... waiting for the Solid2013 import to finish ...


ok, let's see:

1) in solid the parts are solid 8-)
2) bottom parts on top too
3) none of the 4mm vias shows up
4) mounting holes missing too


HTH
--
Lorenz
Lorenz
2013-12-19 12:03:07 UTC
Permalink
Post by Lorenz
Hi Barry,
Post by Barry Walker
The generate_3d_data script has fallen into disrepair and hasn't seen
any improvements in over two and a half years. 
[...]
The new version 0.90 ulp is attached.
while trying-out the board-outlines-and-cutouts workaround* with your
script I found that your script version no longer runs on a
stand-alone board file with packages.

Peeking into the ulp it seems you access the schematic it there a
packages in the board.

(don't get me wrong, I'm not complaining, only reporting my findings)


* board coutouts don't show up in the idf if drawn in layer 50
directly in the board.
--
Lorenz
Barry Walker
2013-12-19 19:58:13 UTC
Permalink
Post by Lorenz
I was not aware about Freecads import capability for idf.
It took me some time (because I'm not familiar with Phyton) but I
managed to obtain the mod/idf code from githup.
The idf file generated with your version of the generate_3d_data.ulp
loads in Freecad (0.13) without issuing an error (unlike Mr.
Zaffrans
1.3 Version which throws an exception 'both points are equal'), but
...
1) parts are only wireframe
2) bottom parts are placed on top
3) I have two 4mm vias (GND for test clips), but only one of them
shows up in the import
4) the mounting holes (arcs in the dimension layer of a package, that
is: coutouts no drills) don't show up at all
1) in solid the parts are solid 8-)
2) bottom parts on top too
3) none of the 4mm vias shows up
4) mounting holes missing too
Lorenz,

Thanks for testing the script and reporting the details of your results.

The first problem with the old versions was the "both points are equal"
error in FreeCAD.  The old versions basically repeated all the points
twice in the .emn and .emp files.  This may be legal in IDF, but the
FreeCAD importer did not care for it.  I fixed this and another error
that appears after you fix that one.

The parts in wire frame issue I don't think is fixable with the script. 
It may be a setting in FreeCAD.  Was FreeCAD in wireframe mode?  I am
not a FreeCAD expert at all.  I do not get wireframe parts, but the IDF
format doesn't really specify solids or wire frames, just points.

I confess I found the misplaced bottom parts issue shortly after my post
yesterday.  It was only a problem with multi-outline parts placed on the
bottom, but for me it is fixed with the v091 file attached.

Odd only one of two vias would show up.  I don't have an explanation for
that one.  I have 4 large vias for mounting holes on my board, all 4
show up.  It is pretty easy to open the .emn file with a text editor and
look at the hole call outs.  That would tell you if the script isn't
finding the hole, or if the importer isn't importing the hole.  I did
set the via limit too low once and it caught all my signal vias.  The
script handled it well enough, but FreeCAD always crashed before loading
the entire design.

Pretty sure the .ulp does not look at the dimension layer in packages. 
If it isn't on layer 50,  57,  58, or a through hole pad it might as
well not exist for this version. 

I don't use any cutouts on the board I am testing, so I have no
results.  As I recall from using the old version a few years ago, there
were issues with the cutouts.  I didn't touch any of the code in that
section.  If I remember correctly, when I made components with cutouts
on layer 50 and it handled those better than using cutouts directly on
layer 50 of the board.

The new script does rely on components in the schematic so it can find
the original library part dimensions and angles.  The IDF format uses
library parts then placement of those library parts, much like Eagle. 
The old version of the generate_3d .ulp made a new part for every
rotation and mounting side of each part found on the board.  I changed
that.  Possibly this is not helpful for board only designs.

I also appreciate  your comment that you are reporting not complaining. 
Very kind.

--
To view any images and attachments in this post, visit:
http://www.element14.com/community/message/97845

Attachments:
generate_3d_data_v091.ulp.zip
Lorenz
2013-12-20 13:57:02 UTC
Permalink
Post by Barry Walker
[...]
Odd only one of two vias would show up.  I don't have an explanation for
that one.  I have 4 large vias for mounting holes on my board, all 4
show up. [...]
I tracked down the missing drill.
Looking into to emn file revealed all drills to be present.
So I had a look into idf.py and I think there is a bug in the line
that handles the drills.
Post by Barry Walker
drills.append([float(emnrecords[0])*emn_unit,float(emnrecords[1])*emn_unit,float(emnrecords[2])*emn_unit])
changing 'section_counter>2' to 'section_counter>1' produced the
missing drill.
--
Lorenz
Florian Mitnacht
2019-04-02 13:16:52 UTC
Permalink
Hi Barry,
there's still a problem with packages, that have 3D data on the bottom ECAD layer 50 "bCAD". Here's an example of a THT female connector. In the tCAD layer 57 there are the beginnings of the pins and in the bCAD layer 58 there are the endings of the pins. generate_3d_data_v091.ulp generates wrong angle data, if your package is places in other angles than 0° or 180°. You see in the picture on the left side packes placed in 0° and 180°. No problem here. The pins on the bCAD layer are at the same x/y-Coordinate as on the tCAD. On the right side you see packages rotated to 90° or 270°. The bCAD-pins are rotated in the wrong direction.
[faulty ECAD data in the case of THT package and angles other than 0° or 180°]
Data in *.emn:
{code:class=jive_macro_code _jivemacro_uid_15542108771533383 jive_text_macro|data-renderedposition=550_8_1481_176|jivemacro_uid=_15542108771533383}[..]
AMTEK-5PS2RDB63-207_BR38.1 AMTEK-5PS2RDB63-207_BR38_SMD-FM.1 X2.1
22.00 11.00 0 90.00 TOP PLACED
AMTEK-5PS2RDB63-207_BR38.2 AMTEK-5PS2RDB63-207_BR38_SMD-FM.2 X2.2
22.00 11.00 0 90.00 TOP PLACED
[...]
AMTEK-5PS2RDB63-207_BR38.9 AMTEK-5PS2RDB63-207_BR38_SMD-FM.9 X2.9
22.00 11.00 0 90.00 BOTTOM PLACED
AMTEK-5PS2RDB63-207_BR38.10 AMTEK-5PS2RDB63-207_BR38_SMD-FM.10 X2.10
22.00 11.00 0 90.00 BOTTOM PLACED
[...]{code}

Should be:
{code:modifiedtitle=true|class=jive_macro_code _jivemacro_uid_15542108879449571 jive_text_macro|data-renderedposition=768_8_1481_176|jivemacro_uid=_15542108879449571}[..]
AMTEK-5PS2RDB63-207_BR38.1 AMTEK-5PS2RDB63-207_BR38_SMD-FM.1 X2.1
22.00 11.00 0 90.00 TOP PLACED
AMTEK-5PS2RDB63-207_BR38.2 AMTEK-5PS2RDB63-207_BR38_SMD-FM.2 X2.2
22.00 11.00 0 90.00 TOP PLACED
[...]
AMTEK-5PS2RDB63-207_BR38.9 AMTEK-5PS2RDB63-207_BR38_SMD-FM.9 X2.9
22.00 11.00 0 -90.00 BOTTOM PLACED
AMTEK-5PS2RDB63-207_BR38.10 AMTEK-5PS2RDB63-207_BR38_SMD-FM.10 X2.10
22.00 11.00 0 -90.00 BOTTOM PLACED
[...]{code}

--
To view any images and attachments in this post, visit:
https://www.element14.com/community/message/273909

Loading...