Graphical scripting : FreeCAD/PureData connection

Show off your FreeCAD projects here!
User avatar
Kunda1
Veteran
Posts: 11139
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD/PureData connection

Post by Kunda1 »

Shall we add it to the Addon Manager ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: FreeCAD/PureData connection

Post by flachyjoe »

Kunda1 wrote: Fri Dec 18, 2020 2:19 pm Shall we add it to the Addon Manager ?
I didn't look yet how the Addon Manager works. If it's a link to the repository and not a snapshot of this certainly buggy draft, I'm ok.
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
User avatar
Kunda1
Veteran
Posts: 11139
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD/PureData connection

Post by Kunda1 »

flachyjoe wrote: Fri Dec 18, 2020 4:00 pm
Kunda1 wrote: Fri Dec 18, 2020 2:19 pm Shall we add it to the Addon Manager ?
I didn't look yet how the Addon Manager works. If it's a link to the repository and not a snapshot of this certainly buggy draft, I'm ok.
Yes, it's a link to the repo not a snapshot. It may look like a snapshot but the underlying logic always references the most up to date version of the main branch of the addon.

Edit: You'll need to add a metadata file that references all the dependencies the workbench relies on.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: FreeCAD/PureData connection

Post by flachyjoe »

Kunda1 wrote: Fri Dec 18, 2020 4:17 pm You'll need to add a metadata file that references all the dependencies the workbench relies on.
Where is the doc about this metadata file ? Does it list all dependencies or only FreeCAD workbenches ?
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: FreeCAD/PureData connection

Post by flachyjoe »

FreeCAD can now controls Pure-Data throw 2 objects :
  • [fc_selObserver] get real-time selection information
  • [fc_objObserver] bang when the mouse hovers the defined FC object
Lets' rock ! :lol:

Update to the last FCPDWorkbench to get them. Piano is available in FCPDWorkbench_Samples
No video yet, I only get GIF record working :(
No video yet, I only get GIF record working :(
Capture d’écran_2021-01-31_13-09-48.png (91.67 KiB) Viewed 2360 times
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: FreeCAD/PureData connection

Post by flachyjoe »

Hi,
I found a way to autogenerate Pure-Data patch linked to a python function (see the dev_tools directory). NB : there are no PD embedded help yet but inlets are commented when you open patches.

So all Draft.make_* are know available in FCPD, see you soon for Part.make* ones. Done !

Edit : demo for draft, part and parametric objects was added to FCPDWorkbench_Samples git
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: Graphical scripting : FreeCAD/PureData connection

Post by flachyjoe »

Hi !
I wrote a new object : [fc_controler] is quite similar to DynamicData_Workbench but with an external link to Pure-Data.
So you can use Pure-Data flow as input for an expression (and vice-versa set Pure-Data flow from expression).
It's an easiest way to control your models.
Capture d’écran_2021-09-12_21-58-21.png
Capture d’écran_2021-09-12_21-58-21.png (76.23 KiB) Viewed 1882 times

On Pure-Data side, [fc_controler] inlets are connected to IncommingData properties and outlets to OutgoingData ones.
Capture d’écran_2021-09-12_22-16-39.png
Capture d’écran_2021-09-12_22-16-39.png (56.69 KiB) Viewed 1882 times
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
bleber
Posts: 78
Joined: Thu Jun 30, 2016 5:12 pm

Re: Graphical scripting : FreeCAD/PureData connection

Post by bleber »

I like to test PD workbench, can give me some instructions to install/confiugre and first steps?
Thanks.
User avatar
flachyjoe
Veteran
Posts: 1057
Joined: Sat Mar 31, 2012 12:00 pm
Location: Limoges, France

Re: Graphical scripting : FreeCAD/PureData connection

Post by flachyjoe »

bleber wrote: Sun Sep 12, 2021 11:10 pm I like to test PD workbench, can give me some instructions to install/confiugre and first steps?
Thanks.
Hi !
Install
  1. Clone the git repository in your FreeCAD Mod path
  2. Install Pure-Data and required external libraries or Purr-Data which includes them.
  3. Launch FreeCAD
  4. Load the FCPD workbench
  5. Set your Pure-Data binary path in the workbench preference page
First steps
  1. Open a FreeCAD document
  2. Load the FCPD workbench
  3. Start Pure-Data and internal FreeCAD server by clicking Launch Pure-Data in the FCPD menu or toolbar
  4. The opening client.pd window implements the connection to FC, don't close it.
  5. Create a new patch from PD File menu
  6. Add your needed [fc_…] objects, they are automatically connected to FreeCAD
Take a look in the fcpd-workbench/pdlib/ directory for available objects. Some of them are pd-documented (RMB/Help in PD) and/or listed in the FCPD-help.pd file.
- Flachy Joe -
"Puisqu’on ne peut changer la direction du vent, il faut apprendre à orienter les voiles." Anonyme

:ugeek: Modélisations et Macros à la demande, contactez-moi en MP. :ugeek:
bleber
Posts: 78
Joined: Thu Jun 30, 2016 5:12 pm

Re: Graphical scripting : FreeCAD/PureData connection

Post by bleber »

I follow the instructions and test examples not working, I have errors .
I attached screenshot.
In these example I can make the cube but error when drag to move.
Attachments
Captura.JPG
Captura.JPG (391.98 KiB) Viewed 1689 times
Post Reply