connecting freecad and inkscape/gimp

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

connecting freecad and inkscape/gimp

Post by microelly2 »

For face painting I want to connect FreeCAD and drawing programs (inkscape and gimp).

inkscape can be used to draw vector graphics and gimp for textures.
pixel images can be used for design purposes too.
One inspiration was this video
phpBB [video]



both gimp and inkscape supprot python, so a client server connection between running instances should be possible.
That means that the change of an object in any of these programs should update the instance in the other one.

Here some results of my work.

import/link an inkscap svg file
phpBB [video]




conversion of the imported faces into sketcher format
phpBB [video]
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: connecting freecad and inkscape/gimp

Post by Kunda1 »

Very cool! Do you mind sharing the code for this?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: connecting freecad and inkscape/gimp

Post by microelly2 »

Kunda1 wrote: Wed Oct 18, 2017 5:20 pm Very cool! Do you mind sharing the code for this?
At the moment I put it all into the nurbs WB because it's for the shoelast project.
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: connecting freecad and inkscape/gimp

Post by regis »

This is epic.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: connecting freecad and inkscape/gimp

Post by microelly2 »

I think this can be the first testable version of the inkscape freecad connection
phpBB [video]
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: connecting freecad and inkscape/gimp

Post by Kunda1 »

Nicely done. Would it be possible to open a dedicated widget inside FC so there is no need run inkscape, AKA can it run headless inside of FC ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: connecting freecad and inkscape/gimp

Post by microelly2 »

Kunda1 wrote: Wed Nov 15, 2017 2:39 pm Nicely done. Would it be possible to open a dedicated widget inside FC so there is no need run inkscape, AKA can it run headless inside of FC ?
I still have no idea how this can be done.

The other possibility is to write a inkscape addon which triggers the update of the freecad data without the extra "save" method invocation.
my idea is to write a temporary file with the current content of the active inkscape window and calcucate a "preview" model in freecad until the
change in inkscape is saved. then a complete update of the freecad scene can be executed.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: connecting freecad and inkscape/gimp

Post by Kunda1 »

microelly2 wrote: Wed Nov 15, 2017 2:55 pm The other possibility is to write a inkscape addon which triggers the update of the freecad data without the extra "save" method invocation.
my idea is to write a temporary file with the current content of the active inkscape window and calcucate a "preview" model in freecad until the
change in inkscape is saved. then a complete update of the freecad scene can be executed.
I asked on #inkscape freenode

Code: Select all

[09:58] <kunda_> Mc, what about the other way, code something on the inkscape side as mentioned above ?
[09:59] <@Mc> the python addons already write the complete svg file
[09:59] <@Mc> so it's doable to also write it to a place where freecad will automatically find it
[10:07] <kunda_> Mc, what do you mean by the "python addons already write the complete svg file" which addon? An inkscape addon ?
[10:08] <@Mc> inkscape addons basicaly are simple python files that read the svg files, modify it as they please, and write it back (and it's reloaded by inkscape)
Edit: @microelly2 check out https://medium.com/@xaviju/inkscape-ext ... 72dda360fe
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: connecting freecad and inkscape/gimp

Post by microelly2 »

Kunda1 wrote: Wed Nov 15, 2017 3:32 pm
I asked on #inkscape freenode

Code: Select all


[10:08] <@Mc> inkscape addons basicaly are simple python files that read the svg files, modify it as they please, and write it back (and it's reloaded by inkscape)
:D land ahoy
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: connecting freecad and inkscape/gimp

Post by microelly2 »

bp_622.png
bp_622.png (342.22 KiB) Viewed 3999 times
If it is possible to draw faces then faces with holes should be possible too.

So there is a brezel object: create a subface with up to 3 holes on a surface by (up to 4) closed curves.

Now we can design our shoes to have a hole where the foot can slip in
and another where the water can flow out. :lol:
Post Reply