Hallo, Achim Bornhoeft hat gesagt: // Achim Bornhoeft wrote: > I tried this but without the results I expected. > Probably it was not very clear how I explained it. > See attached patch for a better description of what I am looking for.
Attached is a version which should do what you expect. I think you were just missing the correct translations of the center of rotation: It usually is the point (0,0), so if you want to rotate around a different center, like (50, 50) in your example, you first need to translate everything to (0,0). This is done in the [pd scale] and [pd unscale] subpatches by adding rsp. substracting 50. Ciao -- Frank
#N canvas 363 170 742 378 10; #X obj 94 180 hsl 100 15 0 100 0 0 empty empty empty -2 -8 0 10 -262144 -1 -1 6700 1; #X obj 75 78 vsl 15 100 0 100 0 0 empty empty empty 0 -9 0 10 -262144 -1 -1 7200 1; #X obj 91 80 grid grid1 100 0 100 100 0 100 0 1 1 10 10 158.677 107.273 ; #X obj 235 81 grid grid1 100 0 100 100 0 100 0 1 1 10 10 307.727 148.677 ; #X text 199 126 --->; #X obj 382 81 grid grid1 100 0 100 100 0 100 0 1 1 10 10 414.323 153.727 ; #X text 342 125 --->; #X obj 537 82 grid grid1 100 0 100 100 0 100 0 1 1 10 10 564.273 114.323 ; #X text 494 126 --->; #N canvas 412 34 532 334 calc 0; #X obj 181 -13 inlet y; #X obj 286 -12 inlet x; #X obj 66 225 s 0-deg; #X obj 429 228 s 270-deg; #X obj 298 229 s 180-deg; #X obj 166 227 s 90-deg; #X obj 86 141 t b f; #X obj 67 169 pack f f; #X msg 66 197 values \$2 \$1; #X obj 165 169 pack f f; #X obj 180 94 t b f; #X obj 209 143 abs; #X obj 208 120 - 100; #X msg 166 201 values \$1 \$2; #X obj 300 173 pack f f; #X obj 268 121 abs; #X obj 267 98 - 100; #X obj 325 100 t b f; #X obj 353 145 abs; #X obj 352 122 - 100; #X msg 297 203 values \$2 \$1; #X msg 428 198 values \$1 \$2; #X obj 425 175 pack f f; #X obj 415 123 abs; #X obj 414 100 - 100; #X obj 463 101 t b f; #X connect 0 0 7 0; #X connect 0 0 9 0; #X connect 0 0 16 0; #X connect 0 0 24 0; #X connect 1 0 6 0; #X connect 1 0 10 0; #X connect 1 0 17 0; #X connect 1 0 25 0; #X connect 6 0 7 0; #X connect 6 1 7 1; #X connect 7 0 8 0; #X connect 8 0 2 0; #X connect 9 0 13 0; #X connect 10 0 9 0; #X connect 10 1 12 0; #X connect 11 0 9 1; #X connect 12 0 11 0; #X connect 13 0 5 0; #X connect 14 0 20 0; #X connect 15 0 14 0; #X connect 16 0 15 0; #X connect 17 0 14 0; #X connect 17 1 19 0; #X connect 18 0 14 1; #X connect 19 0 18 0; #X connect 20 0 4 0; #X connect 21 0 3 0; #X connect 22 0 21 0; #X connect 23 0 22 0; #X connect 24 0 23 0; #X connect 25 0 22 0; #X connect 25 1 22 1; #X restore 75 250 pd calc; #X obj 92 54 r 0-deg; #X obj 538 59 r 270-deg; #X obj 383 57 r 180-deg; #X floatatom 33 129 5 0 0 0 - - -; #X floatatom 124 204 5 0 0 0 - - -; #X floatatom 234 195 5 0 0 0 - - -; #X floatatom 328 195 5 0 0 0 - - -; #X floatatom 383 194 5 0 0 0 - - -; #X floatatom 475 194 5 0 0 0 - - -; #X floatatom 536 193 6 0 0 0 - - -; #X floatatom 629 192 5 0 0 0 - - -; #X text 130 244 inside is what I like to achieve with a formula. The formula is needed to be used in abstractions with variables.; #N canvas 0 22 780 543 Franks 0; #X text 213 57 ->; #X text 276 57 ->; #X obj 51 168 cart2pol; #X obj 74 280 +; #X obj 73 199 t f b; #X obj 50 314 pol2cart; #X floatatom 50 363 5 0 0 0 - - -; #X floatatom 72 341 8 0 0 0 - - -; #X obj 51 141 unpack; #X floatatom 109 280 5 0 0 0 - - -; #X msg 52 58 0 0; #X msg 102 58 0 100; #X msg 160 58 100 100; #X msg 236 58 100 0; #X text 81 57 ->; #X text 139 57 ->; #X msg 299 58 0 0; #X text 51 36 expect the following message as result below; #X obj 33 442 pack 0 0; #X obj 197 116 r 0-deg; #X obj 197 139 route values; #X msg 35 467 values \$1 \$2; #N canvas 67 157 450 300 scale 0; #X obj 83 47 inlet; #X obj 89 117 outlet; #X obj 160 45 inlet; #X obj 166 115 outlet; #X obj 162 81 + 50; #X obj 85 83 + 50; #X connect 0 0 5 0; #X connect 2 0 4 0; #X connect 4 0 3 0; #X connect 5 0 1 0; #X restore 33 402 pd scale; #X floatatom 106 426 5 0 0 0 - - -; #X obj 181 223 t b f; #X obj 100 252 expr $f2*$f1/180; #X floatatom 343 128 5 0 0 1 rotation - -; #N canvas 67 157 450 300 unscale 0; #X obj 85 35 inlet; #X obj 81 156 outlet; #X obj 85 83 - 50; #X obj 162 81 - 50; #X obj 86 59 unpack 0 0; #X obj 88 127 pack 0 0; #X connect 0 0 4 0; #X connect 2 0 5 0; #X connect 3 0 5 1; #X connect 4 0 2 0; #X connect 4 1 3 0; #X connect 5 0 1 0; #X restore 196 163 pd unscale; #X msg 96 227 3.14159; #X obj 379 193 grid grid1 100 0 100 100 0 100 0 1 1 10 10 439.26 216.098 ; #X floatatom 378 307 5 0 0 0 - - -; #X floatatom 472 307 5 0 0 0 - - -; #X obj 380 169 r anydeg; #X obj 36 496 s anydeg; #X connect 2 0 5 0; #X connect 2 1 4 0; #X connect 3 0 5 1; #X connect 4 0 3 0; #X connect 4 1 28 0; #X connect 5 0 6 0; #X connect 5 0 22 0; #X connect 5 1 7 0; #X connect 5 1 22 1; #X connect 8 0 2 0; #X connect 8 1 2 1; #X connect 10 0 8 0; #X connect 11 0 8 0; #X connect 12 0 8 0; #X connect 13 0 8 0; #X connect 16 0 8 0; #X connect 18 0 21 0; #X connect 19 0 20 0; #X connect 20 0 27 0; #X connect 21 0 33 0; #X connect 22 0 18 0; #X connect 22 1 18 1; #X connect 22 1 23 0; #X connect 24 0 2 0; #X connect 24 1 25 1; #X connect 25 0 3 1; #X connect 25 0 9 0; #X connect 26 0 24 0; #X connect 27 0 8 0; #X connect 28 0 25 0; #X connect 29 0 30 0; #X connect 29 1 31 0; #X connect 32 0 29 0; #X restore 86 23 pd Franks suggestion; #X obj 236 57 r 90-deg; #X connect 0 0 9 1; #X connect 0 0 14 0; #X connect 1 0 9 0; #X connect 1 0 13 0; #X connect 3 0 15 0; #X connect 3 1 16 0; #X connect 5 0 17 0; #X connect 5 1 18 0; #X connect 7 0 19 0; #X connect 7 1 20 0; #X connect 10 0 2 0; #X connect 11 0 7 0; #X connect 12 0 5 0; #X connect 23 0 3 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
