IDFv3 support - upgrade code

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
easyw-fc
Posts: 2690
Joined: Thu Jul 09, 2015 9:34 am

IDFv3 support - upgrade code

Postby easyw-fc » Mon Dec 21, 2015 10:54 pm

Hi,
this is a thread following this post
viewtopic.php?f=10&t=13480&p=108658#p108658
I went a bit further in upgrading the Idf Importer rearranging the Geometry and PartNumber as before, but adding a double control on Part and Geometry to match a 3D emp model when placing parts.
In this way I managed to conserve a better (fully) compatibility to old version, but I managed to read also IDF format coming from kicad idf exporter
Moreover I added also the ability to load the .emp file, let the user to load the library models in FreeCAD, each by each
If this could be of some interest I could post the latest code...
anyway I'm adding this upgrade / FreeCAD WB to my kicad StepUp project
http://sourceforge.net/projects/kicadstepup/
to let kicad users to fully import exported IDF files in FreeCAD

I added the following features:
1. displaying Flat Mode models instead of wireframe as default view
viewtopic.php?t=5848
2. adding a double control on PartNumber and Geometry to match a 3D emp model
3. supporting Z position of emp models
4. skipping PROP in emp file to avoid aborting
5. adding color to shapes with internal code option IDF_colorize
6. adding .emp module model/library load option

attached the images of the kicad pic_programmer exported as IDF file and imported by old and new version
pic_programmer.emn, pic_programmer.emp
picprog-idf-standard.png
picprog-idf-standard.png (115.23 KiB) Viewed 1747 times
picprog-idfimporter.png
picprog-idfimporter.png (118.26 KiB) Viewed 1747 times
picprog-library-idfimporter.png
picprog-library-idfimporter.png (90.79 KiB) Viewed 1747 times
Attachments
IDFV3sample.png
IDFV3sample.png (93.6 KiB) Viewed 1747 times
User avatar
sgrogan
Posts: 5468
Joined: Wed Oct 22, 2014 5:02 pm

Re: IDFv3 support - upgrade code

Postby sgrogan » Mon Dec 21, 2015 11:22 pm

easyw-fc wrote:If this could be of some interest I could post the latest code...
anyway I'm adding this upgrade / FreeCAD WB to my kicad StepUp project
http://sourceforge.net/projects/kicadstepup/
to let kicad users to fully import exported IDF files in FreeCAD
Looks cool easyw-fc. You want this updated on https://launchpad.net/~freecad-communit ... ubuntu/ppa or testing first?
If you push the code to SF we could enable auto-build.
User avatar
easyw-fc
Posts: 2690
Joined: Thu Jul 09, 2015 9:34 am

Re: IDFv3 support - upgrade code

Postby easyw-fc » Mon Dec 21, 2015 11:38 pm

You want this updated on https://launchpad.net/~freecad-communit ... ubuntu/ppa or testing first?
I'm just doing some more testing, but if you want to update the code to the community archive I'm fine...
If you push the code to SF we could enable auto-build.
I'm a mainly a windows user, so could you advice me in pushing the code to SF?

thanks
Maurice
User avatar
sgrogan
Posts: 5468
Joined: Wed Oct 22, 2014 5:02 pm

Re: IDFv3 support - upgrade code

Postby sgrogan » Mon Dec 21, 2015 11:41 pm

I'm on Win too :D . I'm used to github but I will look into SF and advise. Thanks for your interest!
EDIT: Quick start is here:http://sourceforge.net/p/forge/documentation/Git/
If you get stuck, ask for help here. Your work is interesting.
EDIT: These changes are bigger. I need to test with Win before I can update linux.
User avatar
easyw-fc
Posts: 2690
Joined: Thu Jul 09, 2015 9:34 am

Re: IDFv3 support - upgrade code

Postby easyw-fc » Tue Dec 22, 2015 9:12 am

Hi @sgrogan
if I would make a repo on github for the IdfImporter it would be fine, instead the one in SF?
https://github.com/easyw
that would be easier for me :)
PS IdfImporter can coexist with Idf standard WB in FreeCAD...

Maurice
User avatar
sgrogan
Posts: 5468
Joined: Wed Oct 22, 2014 5:02 pm

Re: IDFv3 support - upgrade code

Postby sgrogan » Tue Dec 22, 2015 12:31 pm

That would be great!
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: IDFv3 support - upgrade code

Postby abdullah » Tue Dec 22, 2015 7:20 pm

I think it is an awesome work. It looks awesome. Most of your tools are great ideas that link KiCAD EDA with FreeCAD MCAD and improvements are more than welcome :D

Just for reference, easyw-fc has 3 tools for FreeCAD, kicadstepup that is currently NOT in the PPA, pending some work he is doing now, kicadstepup-tool that is in the (Community extras) PPA, some tools to generate MCAD models of electronic components, currently also not in the PPA (I did not have time to give a deep enough look yet).

I really really really would welcome to see improvements in a repository. I personally favour GitHub for this.

I (mis)understood from your first post that you wanted to improve the stock IDF support of FreeCAD (I have seen the 7z files which seem modifications to the FreeCAD stock code). If this were intended, I would advice to fork FreeCAD's Github repository, create a development branch, and put the changes there so that they can be easily identified. This would facilitate the code review and merge. I am not sure who is taking care of IDF support in FreeCAD... yorik?

Now I (maybe mis)-understand that you are using a separate Macro/WB and you are providing this extra support there. If you are doing it so, and in order to facilitate packaging, I would advice you to work on a development branch and only merging into "master" a version that you regard as working and you would like to have it tested. If you would work in this way, fully automated builds will be possible and the code will be ready for testing in Ubuntu the next day. I would be delighted to package the code for Ubuntu, if more building engines take off in the future, like opensuse's one, it is likely that it will be included there. I guess MicroElly may also be interested in adding it to his plugin-manager.

Keep us posted of your work!!!! :D

EDIT: If you do not feel at ease with Git, feel free to ask questions here in the forum. I am not myself an expert, I just generally manage to get the job done, but there are Git "gurus" in this community.
User avatar
easyw-fc
Posts: 2690
Joined: Thu Jul 09, 2015 9:34 am

Re: IDFv3 support - upgrade code

Postby easyw-fc » Tue Dec 22, 2015 10:27 pm

Hi,
I've just uploaded @ github the IdfImporter WB
https://github.com/easyw/freecad-IDF-importer
I (mis)understood from your first post that you wanted to improve the stock IDF support of FreeCAD (I have seen the 7z files which seem modifications to the FreeCAD stock code). If this were intended, I would advice to fork FreeCAD's Github repository, create a development branch, and put the changes there so that they can be easily identified.
I would like to have my version as an improve subst of the stock IDF one, but I've created a different WB, so it is possible to play with both WBs side by side to see the difference / compatibility

mainly I've added the WB to my kicad StepUp scripts @ SF (http://sourceforge.net/projects/kicadstepup/)
to allow kicad users to easily load IDF exported from kicad in FreeCAD

I don't think there should be difference in loading emn/emp files except for:
- removing step search associations (too old models, not even used)
- displaying Flat Mode models (instead of wireframes)
- supporting Z position (missing in stock version)
- skipping PROP in emp file (missing in stock version, will abort importing)
- adding color to shapes (missing in stock version)
- adding emp library/single model load support (missing in stock version)
- join IDF shape to both Geom and PartNBR (for better compatibility with kicad IDF out)

please have a try to the WB and let me know :)
video-idf-importer.png
video-idf-importer.png (98.27 KiB) Viewed 1649 times
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: IDFv3 support - upgrade code

Postby abdullah » Wed Dec 23, 2015 8:39 am

easyw-fc wrote:I've just uploaded @ github the IdfImporter WB
https://github.com/easyw/freecad-IDF-importer
Thank you very much. :D

Now we should be able to package it for Ubuntu. When you update your repo, then new packages will be generated.

@sgrogan

I am out of my office (on travel with a crappy laptop). If you have time, could you please import this git branch, create a packaging bazaar branch and a building recipe? Just if you have time. I may be able to do the git import tomorrow, but I do not have my private RSA key to upload the packaging branch.

Thanks!
abdullah
Posts: 3174
Joined: Sun May 04, 2014 3:16 pm

Re: IDFv3 support - upgrade code

Postby abdullah » Wed Dec 23, 2015 7:49 pm

abdullah wrote: @sgrogan

I am out of my office (on travel with a crappy laptop). If you have time, could you please import this git branch, create a packaging bazaar branch and a building recipe? Just if you have time. I may be able to do the git import tomorrow, but I do not have my private RSA key to upload the packaging branch.

Thanks!
I have created the GitHub import:
https://code.launchpad.net/~freecad-com ... F-Importer