Skip to content

Commit 53ae9ee

Browse files
authored
Merge pull request #37 from FlachyJoe/dev
Fix pd objects, improve doc and remove unused
2 parents e52161e + 877b1d8 commit 53ae9ee

20 files changed

+820
-143
lines changed

LICENSE.md

Lines changed: 675 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@ sudo apt install puredata pd-list-abs pd-iemlib pd-iemguts
6666
sudo apt install pd-pddp
6767
```
6868

69-
## License
70-
71-
Copyright 2020-2025 @flachyjoe and other contributors
72-
73-
This program is free software; you can redistribute it and/or modify
74-
it under the terms of the GNU General Public License as published by
75-
the Free Software Foundation; either version 3 of the License, or
76-
(at your option) any later version.
77-
78-
This program is distributed in the hope that it will be useful,
79-
but WITHOUT ANY WARRANTY; without even the implied warranty of
80-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81-
GNU General Public License for more details.
82-
8369
## Background / How it works ?
8470

8571
The FreeCAD workbench is codded with Python, it implements a TCP server to get FUDI message from Pure-Data.

pure-data/pdhelp/FCPD-help.pd

Lines changed: 95 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,95 @@
1-
#N canvas 779 205 551 516 12;
2-
#X obj 11 80 helplink fc_client;
3-
#X text 150 80 client/server connection with FreeCAD;
4-
#X obj 10 110 helplink fc_process;
5-
#X text 150 110 send message to FreeCAD;
6-
#X obj 10 140 helplink fc_recompute;
7-
#X text 150 140 ask FreeCAD to recompute ActiveDocument;
8-
#X text 10 50 BASE;
9-
#X text 10 190 VECTOR & PLACEMENT;
10-
#X obj 10 250 helplink fc_vectorXYZ;
11-
#X obj 0 0 cnv 15 550 50 empty empty FCPD 20 12 0 16 #e0e0e0 #404040
12-
0;
13-
#X obj 10 310 helplink fc_PlacementPosRot;
14-
#X obj 10 340 helplink fc_setPlacementPos;
15-
#X text 10 390 PROPERTIES & CONSTRAINTS;
16-
#X obj 10 420 helplink fc_getObjectProperty;
17-
#X obj 10 450 helplink fc_setObjectProperty;
18-
#X obj 10 280 helplink fc_isVector;
19-
#X obj 10 220 helplink fc_vector;
20-
#X text 120 6 a framework to connect FreeCAD and PureData \; (c)2020
21-
flachyjoe and contributors;
22-
#X obj 300 220 helplink part;
23-
#X obj 300 250 helplink draft;
24-
#X text 300 190 WORKBENCHES;
1+
#N canvas 843 43 575 930 12;
2+
#X obj 10 1740 helplink fc_process;
3+
#X obj 10 150 helplink fc_recompute;
4+
#X text 150 150 ask FreeCAD to recompute ActiveDocument;
5+
#X text 10 120 BASE;
6+
#X obj 0 0 cnv 15 550 50 empty empty FCPD 20 12 0 16 #e0e0e0 #404040 0;
7+
#X obj 10 1550 helplink part;
8+
#X obj 10 1580 helplink draft;
9+
#X text 10 1520 WORKBENCHES;
10+
#X text 120 6 a framework to connect FreeCAD and PureData \; (c)2020-2025 @FlachyJoe and contributors;
11+
#X obj 10 610 helplink XYZvector;
12+
#X text 150 610 Create a vector from its X \, Y \, Z coords;
13+
#X obj 10 640 helplink vectorXYZ;
14+
#X text 150 640 Retrieve X \, Y \, Z coords of a vector;
15+
#X obj 10 670 helplink isVector;
16+
#X text 150 670 Bang left or right if input is a vector or not;
17+
#X obj 10 990 helplink placementPosRot;
18+
#X text 150 990 Split a placement in position (vector) and rotation;
19+
#X obj 10 1020 helplink setPlacementPos;
20+
#X text 150 1020 Move a placement to the specified position;
21+
#X obj 10 1050 helplink setPlacementRot;
22+
#X text 150 1050 Rotate a placement to the specified rotation;
23+
#X obj 10 950 helplink isRotation;
24+
#X obj 10 1080 helplink translatePlacement;
25+
#X text 150 1080 Add the specified vector to the placement position;
26+
#X obj 10 1110 helplink rotatePlacement;
27+
#X text 150 1110 Combine the specified rotation to the placement;
28+
#X text 150 950 Bang left or right if input is a rotation or not;
29+
#X text 10 580 VECTOR & ROTATION & PLACEMENT;
30+
#X obj 10 890 helplink YPRrotation;
31+
#X text 150 890 Create a rotation from Yaw Pich Roll values;
32+
#X obj 10 920 helplink rotationYPR;
33+
#X text 150 920 Retrieve Yaw Pitch Roll of a rotation;
34+
#X obj 10 700 helplink vectorAdd;
35+
#X obj 10 730 helplink vectorMinus;
36+
#X obj 10 760 helplink vectorMult;
37+
#X text 150 760 Multiply a vector by a scalar;
38+
#X text 150 730 Subtract a vector to another;
39+
#X text 150 700 Add a vector to another;
40+
#X obj 10 780 helplink Ox;
41+
#X text 150 790 vector (1 \, 0 \, 0);
42+
#X obj 10 810 helplink Oy;
43+
#X obj 10 840 helplink Oz;
44+
#X text 150 850 vector (0 \, 0 \, 1);
45+
#X text 150 820 vector (0 \, 1 \, 0);
46+
#X text 10 260 SCALAR;
47+
#X obj 10 280 helplink pi;
48+
#X obj 10 320 helplink -pi;
49+
#X obj 10 350 helplink 0.5pi;
50+
#X obj 10 380 helplink -0.5pi;
51+
#X obj 10 410 helplink neg;
52+
#X text 150 410 -x;
53+
#X text 10 450 LIST;
54+
#X obj 11 480 helplink fcList;
55+
#X text 150 480 convert a PD list in a FC list;
56+
#X obj 10 510 helplink castList;
57+
#X text 150 510 convert a FC list \, vector or rotation to a PD list;
58+
#X obj 10 540 helplink isList;
59+
#X text 150 540 bang at left or right if input is a FC list or not;
60+
#X text 10 1150 OBJECT;
61+
#X obj 10 1420 helplink fc_getObjectProperty;
62+
#X obj 10 1450 helplink fc_setObjectProperty;
63+
#X text 160 1420 .;
64+
#X text 160 1450 .;
65+
#X obj 10 1180 helplink fc_addObject;
66+
#X text 160 1180 create an object in the ActiveDocument and return it;
67+
#X obj 10 1210 helplink fc_byLabel;
68+
#X text 160 1210 retrieve an object in the ActiveDocument by its label;
69+
#X obj 10 1240 helplink fc_clicknselect;
70+
#X text 160 1240 click on a FC object and its ref is return to PD;
71+
#X obj 10 1270 helplink fc_copy;
72+
#X text 160 1270 duplicate the given object \, optional its dependencies;
73+
#X obj 10 1300 helplink fc_delete;
74+
#X text 160 1300 delete the given object;
75+
#X obj 10 1330 helplink fc_isObject;
76+
#X text 160 1330 bang left/right if data is object/or not;
77+
#X obj 10 1360 helplink fc_isType;
78+
#X text 160 1360 bang left/right if object is of the given type/or not;
79+
#X obj 10 1390 helplink fc_link;
80+
#X text 160 1390 create a link of the given object in the ActiveDocument;
81+
#X obj 10 1480 helplink fc_object;
82+
#X text 160 1480 create \, modify \, delete an object;
83+
#X text 10 190 DATA FLOW;
84+
#X obj 11 220 helplink fc_controler;
85+
#X text 150 220 create a (bidirectional) data tunnel to FC;
86+
#X text 10 1650 INTERNAL;
87+
#X obj 10 1680 helplink fc_client;
88+
#X obj 10 1710 helplink fc_giveme;
89+
#X text 150 1740 send raw message to FreeCAD server;
90+
#X text 150 1710 ask for a PD binder to a python method;
91+
#X text 150 1680 communicate with FC python server;
92+
#X obj 10 1770 helplink commandline;
93+
#X text 150 1770 a place for the user to type text;
94+
#X obj 10 1610 helplink shape;
95+
#X text 27 53 Abstractions named "fc_*" are asynchronous. Data are sent to FC and the left-most outlet bang when the return values on other outlets are ready. The others are full PD and compute during a control tick.;

pure-data/pdlib.light/T-F-help.pd

Lines changed: 0 additions & 5 deletions
This file was deleted.

pure-data/pdlib.light/fc_client.pd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
#X text 30 411 door closed if already connected;
5252
#X obj 525 107 route 0;
5353
#X obj 525 77 t a b;
54-
#X text 62 221 Change switch \; to follow connection status;
55-
#X obj 460 522 closebang;
54+
#X text 62 221 Change switch \; to follow connection status;
55+
#X obj 460 522 iemguts/closebang;
5656
#X obj 599 263 list split 1;
5757
#X obj 599 324 list;
5858
#X obj 599 294 t b a, f 8;

pure-data/pdlib.light/fc_controler.pd

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#N canvas 191 267 1024 583 12;
1+
#N canvas 487 236 1024 583 12;
22
#X obj 20 490 print FreeCAD_Error;
33
#X obj 20 10 inlet;
44
#N canvas 486 173 635 742 inlet-creator 0;
55
#X obj 100 120 until;
66
#X obj 100 150 f;
77
#X obj 130 150 + 1;
88
#X obj 100 90 - 1;
9-
#X obj 90 520 sendcanvas 1;
9+
#X obj 90 520 iemguts/sendcanvas 1;
1010
#X obj 100 20 inlet;
1111
#X text 470 220 fc_process index;
1212
#X obj 100 50 t f b;
@@ -16,21 +16,19 @@
1616
#X obj 100 350 + 1;
1717
#X obj 60 240 * 200;
1818
#X obj 60 270 + 200;
19-
#X text 200 430 x inlet_number new_inlet_id new_list_id fc_process_index
20-
;
19+
#X text 200 430 x inlet_number new_inlet_id new_list_id fc_process_index;
2120
#X obj 90 430 pack f f f f f;
2221
#X obj 100 180 t f f f f b;
2322
#X obj 130 350 +;
2423
#X obj 130 240 * 2;
25-
#X msg 90 470 obj \$1 10 inlet \, obj \$1 40 list prepend ctrlr \$2
26-
\, connect \$3 0 \$4 0 \, connect \$4 0 \$5 0;
24+
#X msg 90 470 obj \$1 10 inlet \, obj \$1 40 list prepend ctrlr \$2 \, connect \$3 0 \$4 0 \, connect \$4 0 \$5 0;
2725
#X obj 190 20 inlet;
2826
#X obj 200 300 +;
2927
#X text 200 50 nb of outlet;
3028
#X text 240 270 last id + 2;
3129
#X msg 430 220 3;
3230
#X floatatom 30 70 5 0 0 0 - - - 0;
33-
#X msg 200 270 14;
31+
#X msg 200 270 15;
3432
#X connect 0 0 1 0;
3533
#X connect 1 0 2 0;
3634
#X connect 1 0 16 0;
@@ -67,19 +65,18 @@
6765
#X obj 190 410 until;
6866
#X obj 190 440 f;
6967
#X obj 220 440 + 1;
70-
#X obj 190 690 sendcanvas 1;
68+
#X obj 190 690 iemguts/sendcanvas 1;
7169
#X obj 190 10 inlet;
7270
#X obj 150 530 * 200;
7371
#X obj 190 470 t f f f f b;
7472
#X obj 230 560 +;
75-
#X obj 346 460 sendcanvas 1;
73+
#X obj 346 460 iemguts/sendcanvas 1;
7674
#X text 310 310 last id + 1;
77-
#X msg 370 140 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
78-
;
75+
#X msg 370 140 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20;
7976
#X obj 410 170 list split;
8077
#X obj 346 400 pack f f;
8178
#X obj 410 229 list trim;
82-
#X obj 410 260 sendcanvas 1;
79+
#X obj 410 260 iemguts/sendcanvas 1;
8380
#X text 280 520 last id + 2;
8481
#X obj 150 560 + 500;
8582
#X text 300 630 x outlet_number new_outlet_id route_index;
@@ -91,9 +88,9 @@
9188
#X obj 280 339 t f f;
9289
#X text 440 310 [route ERROR] index;
9390
#X msg 346 430 connect \$2 1 \$1 0;
94-
#X msg 280 310 13;
95-
#X msg 250 520 14;
96-
#X msg 410 310 12;
91+
#X msg 280 310 14;
92+
#X msg 250 520 15;
93+
#X msg 410 310 10;
9794
#X connect 0 0 1 0;
9895
#X connect 1 0 2 0;
9996
#X connect 1 0 6 0;
@@ -158,8 +155,7 @@
158155
#X obj 210 530 1;
159156
#X obj 210 160 r \$0-reset;
160157
#X obj 130 10 inlet;
161-
#X text 200 10 This patch search for the | char and return right and
162-
left element count;
158+
#X text 200 10 This patch search for the | char and return right and left element count;
163159
#X obj 210 630 outlet;
164160
#X obj 40 550 t b b;
165161
#X connect 0 0 5 0;
@@ -207,8 +203,9 @@ left element count;
207203
#X obj 30 140 t a a;
208204
#X obj 330 210 t f f;
209205
#X obj 20 250 route ERROR;
210-
#X obj 30 111 else/args;
211-
#X obj 30 81 else/lb -init;
206+
#X obj 30 116 pdcontrol;
207+
#X msg 30 92 args 0;
208+
#X obj 30 68 loadbang;
212209
#X connect 1 0 6 0;
213210
#X connect 3 0 10 0;
214211
#X connect 4 0 3 0;
@@ -222,3 +219,4 @@ left element count;
222219
#X connect 10 0 0 0;
223220
#X connect 11 0 8 0;
224221
#X connect 12 0 11 0;
222+
#X connect 13 0 12 0;

pure-data/pdlib.light/fc_giveme.pd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#X obj 10 100 route ERROR;
55
#X obj 10 210 symbol;
66
#X obj 10 11 inlet;
7-
#X obj 10 290 sendcanvas 1;
7+
#X obj 10 290 iemguts/sendcanvas 1;
88
#X obj 90 130 t a b;
99
#X obj 120 160 outlet;
1010
#X text 70 210 create and select and cut the object in this patch;

pure-data/pdlib.light/fc_isIncluded.pd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#N canvas 177 535 450 300 12;
2-
#X obj 10 10 closebang;
2+
#X obj 10 10 iemguts/closebang;
33
#X obj 10 100 fc_process;
44
#X msg 10 40 endedit;
55
#X obj 10 70 list append \$1;

pure-data/pdlib.light/fc_objObserver.pd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#X obj 20 210 fc_process;
33
#X msg 290 140 remobserver;
44
#X obj 90 270 outlet;
5-
#X obj 270 50 closebang;
5+
#X obj 270 50 iemguts/closebang;
66
#X obj 200 50 inlet;
77
#X obj 80 50 loadbang;
88
#X obj 200 100 t a b;

pure-data/pdlib.light/fc_onMove.pd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#X obj 10 200 fc_process;
33
#X msg 220 130 remobserver;
44
#X obj 70 260 outlet;
5-
#X obj 200 40 closebang;
5+
#X obj 200 40 iemguts/closebang;
66
#X obj 130 40 inlet;
77
#X obj 10 40 loadbang;
88
#X obj 130 90 t a b;

0 commit comments

Comments
 (0)