Update of /cvsroot/pure-data/externals/nusmuk/msd2D In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7646/msd2D
Modified Files: 03_imsd2Dtest.pd help-msd2D.pd main.cpp Log Message: MSD Version 0.03
Index: main.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/nusmuk/msd2D/main.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** main.cpp 20 Apr 2005 15:33:14 -0000 1.3 --- main.cpp 21 Apr 2005 14:28:54 -0000 1.4 *************** *** 31,35 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! Version 0.02 -- 15.04.2005 */
--- 31,35 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! Version 0.03 -- 21.04.2005 */
*************** *** 39,43 ****
// define constants ! #define MSD2D_VERSION 0.02 #define nb_max_link 4000 #define nb_max_mass 4000 --- 39,43 ----
// define constants ! #define MSD2D_VERSION 0.03 #define nb_max_link 4000 #define nb_max_mass 4000 *************** *** 75,79 **** t_mass *mass2; t_float K1, D1, D2; ! t_float longx, longy, longueur; t_float distance_old; } t_link; --- 75,79 ---- t_mass *mass2; t_float K1, D1, D2; ! t_float longx, longy, longueur, long_min, long_max; t_float distance_old; } t_link; *************** *** 135,143 **** distance = sqrt(pow(link[i]->mass1->posX-link[i]->mass2->posX,2) + pow(link[i]->mass1->posY-link[i]->mass2->posY,2)); // L[n] = sqrt( (x1-x2)² +(y1-y2)²) ! F = link[i]->K1 * (distance - link[i]->longueur) ; // F[n] = k1 (L[n] - L[0]) ! F += link[i]->D1 * (distance - link[i]->distance_old) ; // F[n] = F[n] + D1 (L[n] - L[n-1]) ! if (distance != 0) { ! Fx = F * (link[i]->mass1->posX - link[i]->mass2->posX)/distance; // Fx = F * Lx[n]/L[n] ! Fy = F * (link[i]->mass1->posY - link[i]->mass2->posY)/distance; // Fy = F * Ly[n]/L[n] } link[i]->mass1->forceX -= Fx; // Fx1[n] = -Fx --- 135,149 ---- distance = sqrt(pow(link[i]->mass1->posX-link[i]->mass2->posX,2) + pow(link[i]->mass1->posY-link[i]->mass2->posY,2)); // L[n] = sqrt( (x1-x2)² +(y1-y2)²) ! if (distance < link[i]->long_min || distance > link[i]->long_max) { ! Fx = 0; ! Fy = 0; ! } ! else { ! F = link[i]->K1 * (distance - link[i]->longueur) ; // F[n] = k1 (L[n] - L[0]) ! F += link[i]->D1 * (distance - link[i]->distance_old) ; // F[n] = F[n] + D1 (L[n] - L[n-1]) ! if (distance != 0) { ! Fx = F * (link[i]->mass1->posX - link[i]->mass2->posX)/distance; // Fx = F * Lx[n]/L[n] ! Fy = F * (link[i]->mass1->posY - link[i]->mass2->posY)/distance; // Fy = F * Ly[n]/L[n] ! } } link[i]->mass1->forceX -= Fx; // Fx1[n] = -Fx *************** *** 184,187 **** --- 190,196 ---- t_float M;
+ if (argc != 5) + error("mass : Id mobile mass X Y"); + mass[nb_mass] = new t_mass; // new mass mass[nb_mass]->Id = GetSymbol(argv[0]); // ID *************** *** 218,221 **** --- 227,233 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("forceX : Idmass value"); + for (i=0; i<nb_mass;i++) { *************** *** 231,234 **** --- 243,249 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("forceY : Idmass value"); + for (i=0; i<nb_mass;i++) { *************** *** 244,247 **** --- 259,265 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("posX : Idmass value"); + if (GetFloat(argv[1]) < Xmax && GetFloat(argv[1]) > Xmin) for (i=0; i<nb_mass;i++) *************** *** 258,261 **** --- 276,282 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("posY : Idmass value"); + if (GetFloat(argv[1]) < Ymax && GetFloat(argv[1]) > Ymin) for (i=0; i<nb_mass;i++) *************** *** 271,276 **** // set mass No to mobile t_int i,aux; ! aux = GetAInt(argv[0]); for (i=0; i<nb_mass;i++) { --- 292,300 ---- // set mass No to mobile t_int i,aux; + + if (argc != 1) + error("setMobile : Idmass"); ! aux = GetInt(argv[0]); for (i=0; i<nb_mass;i++) { *************** *** 286,289 **** --- 310,316 ---- t_int i,aux; + if (argc != 1) + error("setFixed : Idmass"); + aux = GetAInt(argv[0]); for (i=0; i<nb_mass;i++) *************** *** 298,330 **** { // Delete mass ! t_int i,nb_link_delete=0; ! t_atom sortie[6], aux[nb_link]; ! // Delete associated links ! for (i=0; i<nb_link;i++) { ! if (link[i]->mass1->nbr == GetInt(argv[0]) || link[i]->mass2->nbr == GetInt(argv[0])) { ! SetFloat((aux[nb_link_delete]),link[i]->nbr); ! nb_link_delete++; } - }
! for (i=0; i<nb_link_delete;i++) ! m_delete_link(1,&aux[i]);
! // delete mass ! for (i=0; i<nb_mass;i++) ! if (mass[i]->nbr == GetAInt(argv[0])) { ! SetFloat((sortie[0]),mass[i]->nbr); ! SetSymbol((sortie[1]),mass[i]->Id); ! SetFloat((sortie[2]),mass[i]->mobile); ! SetFloat((sortie[3]),1/mass[i]->invM); ! SetFloat((sortie[4]),mass[i]->posX); ! SetFloat((sortie[5]),mass[i]->posY); ! delete mass[i]; ! mass[i] = mass[nb_mass-1]; ! nb_mass--; ! ToOutAnything(1,S_Mass_deleted,6,sortie); ! break; ! } }
--- 325,360 ---- { // Delete mass ! t_int i,nb_link_delete=0; ! t_atom sortie[6], aux[nb_link]; ! ! if (argc != 1) ! error("deleteMass : Nomass"); ! // Delete associated links ! for (i=0; i<nb_link;i++) { ! if (link[i]->mass1->nbr == GetInt(argv[0]) || link[i]->mass2->nbr == GetInt(argv[0])) { ! SetFloat((aux[nb_link_delete]),link[i]->nbr); ! nb_link_delete++; ! } }
! for (i=0; i<nb_link_delete;i++) ! m_delete_link(1,&aux[i]);
! // delete mass ! for (i=0; i<nb_mass;i++) ! if (mass[i]->nbr == GetAInt(argv[0])) { ! SetFloat((sortie[0]),mass[i]->nbr); ! SetSymbol((sortie[1]),mass[i]->Id); ! SetFloat((sortie[2]),mass[i]->mobile); ! SetFloat((sortie[3]),1/mass[i]->invM); ! SetFloat((sortie[4]),mass[i]->posX); ! SetFloat((sortie[5]),mass[i]->posY); ! delete mass[i]; ! mass[i] = mass[nb_mass-1]; ! nb_mass--; ! ToOutAnything(1,S_Mass_deleted,6,sortie); ! break; ! } }
*************** *** 333,343 **** { // set X max ! Xmax = GetFloat(argv[0]); ! } ! ! void m_Ymax(int argc,t_atom *argv) ! { ! // set Y max ! Ymax = GetFloat(argv[0]); }
--- 363,369 ---- { // set X max ! if (argc != 1) ! error("Xmax : Value"); ! Xmax = GetFloat(argv[0]); }
*************** *** 345,349 **** { // set X min ! Xmin = GetFloat(argv[0]); }
--- 371,384 ---- { // set X min ! if (argc != 1) ! error("Xmin : Value"); ! Xmin = GetFloat(argv[0]); ! } ! void m_Ymax(int argc,t_atom *argv) ! { ! // set Y max ! if (argc != 1) ! error("Ymax : Value"); ! Ymax = GetFloat(argv[0]); }
*************** *** 351,355 **** { // set Y min ! Ymin = GetFloat(argv[0]); }
--- 386,392 ---- { // set Y min ! if (argc != 1) ! error("Ymin : Value"); ! Ymin = GetFloat(argv[0]); }
*************** *** 359,382 **** void m_link(int argc,t_atom *argv) // add a link ! // Id, nbr, *mass1, *mass2, K1, D1 { t_atom sortie[7], aux[2]; t_int i;
! link[nb_link] = new t_link; // new link ! link[nb_link]->Id = GetSymbol(argv[0]); for (i=0; i<nb_mass;i++) ! if (mass[i]->nbr==GetAInt(argv[1])) // pointer on mass 1 link[nb_link]->mass1 = mass[i]; ! else if(mass[i]->nbr==GetAInt(argv[2])) // pointer on mass 2 link[nb_link]->mass2 = mass[i]; link[nb_link]->K1 = GetFloat(argv[3]); // K1 link[nb_link]->D1 = GetFloat(argv[4]); // D1 link[nb_link]->D2 = GetFloat(argv[5]); // D2 ! link[nb_link]->longx = link[nb_link]->mass1->posX - link[nb_link]->mass2->posX; // Lx[0] ! link[nb_link]->longy = link[nb_link]->mass1->posY - link[nb_link]->mass2->posY; // Ly[0] ! link[nb_link]->longueur = sqrt( pow(link[nb_link]->longx,2) + pow(link[nb_link]->longy,2)); // L[0] = sq( Lx[0]²+Ly[0]²) link[nb_link]->nbr = id_link; // id number ! link[nb_link]->distance_old = link[nb_link]->longueur;// L[n-1] nb_link++; id_link++; --- 396,437 ---- void m_link(int argc,t_atom *argv) // add a link ! // Id, *mass1, *mass2, K1, D1, D2, (Lmin,Lmax) { t_atom sortie[7], aux[2]; t_int i;
! if (argc < 6 || argc > 8) ! error("link : Id Nomass1 Nomass2 K D1 D2 (Lmin Lmax)"); ! link[nb_link] = new t_link; // New pointer ! link[nb_link]->Id = GetSymbol(argv[0]); // ID for (i=0; i<nb_mass;i++) ! if (mass[i]->nbr==GetAInt(argv[1])) // pointer to mass1 link[nb_link]->mass1 = mass[i]; ! else if(mass[i]->nbr==GetAInt(argv[2])) // pointer to mass2 link[nb_link]->mass2 = mass[i]; link[nb_link]->K1 = GetFloat(argv[3]); // K1 link[nb_link]->D1 = GetFloat(argv[4]); // D1 link[nb_link]->D2 = GetFloat(argv[5]); // D2 ! link[nb_link]->longx = link[nb_link]->mass1->posX - link[nb_link]->mass2->posX; // Lx[0] ! if (link[nb_link]->longx < 0) ! link[nb_link]->longueur = -link[nb_link]->longx; ! else ! link[nb_link]->longueur = link[nb_link]->longx ;// L[0] link[nb_link]->nbr = id_link; // id number ! link[nb_link]->distance_old = link[nb_link]->longueur; // L[n-1] ! switch (argc) { ! case 6 : ! link[nb_link]->long_max = 32768; ! link[nb_link]->long_min = 0; ! break; ! case 7 : ! link[nb_link]->long_min = GetFloat(argv[6]); ! link[nb_link]->long_max = 32768; ! break; ! case 8 : ! link[nb_link]->long_min = GetFloat(argv[6]); ! link[nb_link]->long_max = GetFloat(argv[7]); ! break; ! } nb_link++; id_link++; *************** *** 384,389 **** SetFloat((sortie[0]),id_link-1); SetSymbol((sortie[1]),link[nb_link-1]->Id); ! SetFloat((sortie[2]),GetAInt(argv[1])); ! SetFloat((sortie[3]),GetAInt(argv[2])); SetFloat((sortie[4]),link[nb_link-1]->K1); SetFloat((sortie[5]),link[nb_link-1]->D1); --- 439,444 ---- SetFloat((sortie[0]),id_link-1); SetSymbol((sortie[1]),link[nb_link-1]->Id); ! SetFloat((sortie[2]),GetInt(argv[1])); ! SetFloat((sortie[3]),GetInt(argv[2])); SetFloat((sortie[4]),link[nb_link-1]->K1); SetFloat((sortie[5]),link[nb_link-1]->D1); *************** *** 394,403 **** void m_ilink(int argc,t_atom *argv) // add interactor link ! // Id, nbr, Id masses1, Id masses2, K1, D1 { ! t_atom aux[2], arglist[6]; t_int i,j, imass1[nb_mass], nbmass1=0, imass2[nb_mass], nbmass2=0; t_symbol *Id1, *Id2;
Id1 = GetSymbol(argv[1]); Id2 = GetSymbol(argv[2]); --- 449,461 ---- void m_ilink(int argc,t_atom *argv) // add interactor link ! // Id, Id masses1, Id masses2, K1, D1, D2, (Lmin, Lmax) { ! t_atom aux[2], arglist[8]; t_int i,j, imass1[nb_mass], nbmass1=0, imass2[nb_mass], nbmass2=0; t_symbol *Id1, *Id2;
+ if (argc < 6 || argc > 8) + error("ilink : Id Idmass1 Idmass2 K D1 D2 (Lmin Lmax)"); + Id1 = GetSymbol(argv[1]); Id2 = GetSymbol(argv[2]); *************** *** 424,428 **** SetFloat((arglist[4]),GetFloat(argv[4])); SetFloat((arglist[5]),GetFloat(argv[5])); ! m_link(6,arglist); } } --- 482,495 ---- SetFloat((arglist[4]),GetFloat(argv[4])); SetFloat((arglist[5]),GetFloat(argv[5])); ! switch (argc) { ! case 7 : ! SetFloat(arglist[6],GetFloat(argv[6])); ! break; ! case 8 : ! SetFloat(arglist[6],GetFloat(argv[6])); ! SetFloat(arglist[7],GetFloat(argv[7])); ! break; ! } ! m_link(argc,arglist); } } *************** *** 434,437 **** --- 501,507 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("setK : IdLink Value"); + for (i=0; i<nb_link;i++) { *************** *** 443,450 **** void m_setD(int argc,t_atom *argv) { ! // set viscosity of link(s) named Id t_int i; const t_symbol *sym = GetSymbol(argv[0]);
for (i=0; i<nb_link;i++) { --- 513,523 ---- void m_setD(int argc,t_atom *argv) { ! // set damping of link(s) named Id t_int i; const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("setD : IdLink Value"); + for (i=0; i<nb_link;i++) { *************** *** 460,463 **** --- 533,539 ---- const t_symbol *sym = GetSymbol(argv[0]);
+ if (argc != 2) + error("setD2 : IdLink Value"); + for (i=0; i<nb_link;i++) { *************** *** 470,490 **** { // Delete link ! t_int i; ! t_atom sortie[7];
! for (i=0; i<nb_link;i++) ! if (link[i]->nbr == GetInt(argv[0])) { ! SetFloat((sortie[0]),link[i]->nbr); ! SetSymbol((sortie[1]),link[i]->Id); ! SetFloat((sortie[2]),link[i]->mass1->nbr); ! SetFloat((sortie[3]),link[i]->mass2->nbr); ! SetFloat((sortie[4]),link[i]->K1); ! SetFloat((sortie[5]),link[i]->D1); ! SetFloat((sortie[6]),link[i]->D2); ! delete link[i]; ! link[i]=link[nb_link-1]; // copy last link instead ! nb_link--; ! ToOutAnything(1,S_Link_deleted,7,sortie); ! break; } } --- 546,569 ---- { // Delete link ! t_int i; ! t_atom sortie[7];
! if (argc != 1) ! error("deleteLink : NoLink"); ! ! for (i=0; i<nb_link;i++) ! if (link[i]->nbr == GetInt(argv[0])) { ! SetFloat((sortie[0]),link[i]->nbr); ! SetSymbol((sortie[1]),link[i]->Id); ! SetFloat((sortie[2]),link[i]->mass1->nbr); ! SetFloat((sortie[3]),link[i]->mass2->nbr); ! SetFloat((sortie[4]),link[i]->K1); ! SetFloat((sortie[5]),link[i]->D1); ! SetFloat((sortie[6]),link[i]->D2); ! delete link[i]; ! link[i]=link[nb_link-1]; // copy last link instead ! nb_link--; ! ToOutAnything(1,S_Link_deleted,7,sortie); ! break; } }
Index: help-msd2D.pd =================================================================== RCS file: /cvsroot/pure-data/externals/nusmuk/msd2D/help-msd2D.pd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** help-msd2D.pd 20 Apr 2005 15:33:14 -0000 1.2 --- help-msd2D.pd 21 Apr 2005 14:28:54 -0000 1.3 *************** *** 1,4 **** #N canvas 0 0 478 397 10; ! #N canvas 271 52 742 843 masses 1; #X obj 62 154 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 -66577 0; --- 1,4 ---- #N canvas 0 0 478 397 10; ! #N canvas 271 52 742 843 masses 0; #X obj 62 154 cnv 15 610 180 empty empty CREATION 20 12 0 14 -262131 -66577 0; *************** *** 74,89 **** #X connect 48 0 46 0; #X restore 221 312 pd masses; #N canvas 222 83 808 841 links 0; ! #X obj 62 250 cnv 15 610 305 empty empty CREATION 20 12 0 14 -262131 -66577 0; ! #X msg 79 279 reset; ! #X text 338 308 $1 : Id (symbol); ! #X text 250 308 Add a link; ! #X text 337 328 $2 : creation No of mass1; ! #X text 337 346 $3 : creation No of mass2; ! #X text 336 364 $4 : rigidity; ! #X text 251 280 Delete all masses and links; ! #X text 336 382 $5 : viscosity; ! #X text 336 399 $6 : damping; #X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 -262131 -66577 0; --- 74,112 ---- #X connect 48 0 46 0; #X restore 221 312 pd masses; + #X text 75 312 HELP on masses --->; + #X text 74 343 HELP on links --->; + #X text 13 117 There are 4 types of messages for msd :; + #X text 14 81 It is designed to implement particules physical model + in PD.The model is based on two elements type : mass and link.; + #X obj 13 132 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 + 0; + #X obj 13 165 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 + 0; + #X obj 13 198 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 + 0; + #X obj 13 231 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 + 0; + #X text 16 139 CREATION : To create the model masses and links.; + #X text 16 204 DYNAMIC SETTING : To set the model parameters dynamically. + ; + #X text 16 237 ATTRIBUTES : To get the model parameters.; + #X text 16 166 COMPUTATION : To compute the new model state based on + previous instant.; + #X text 94 23 MSD2D : mass - spring - damper model; + #X text 15 68 MSD2D is the 2D object of the msd objects collection. + ; #N canvas 222 83 808 841 links 0; ! #X obj 33 821 msd; ! #X obj 62 192 cnv 15 610 360 empty empty CREATION 20 12 0 14 -262131 -66577 0; ! #X msg 79 221 reset; ! #X text 402 247 $1 : Id (symbol); ! #X text 314 247 Add a link; ! #X text 401 267 $2 : creation No of mass1; ! #X text 401 285 $3 : creation No of mass2; ! #X text 400 303 $4 : rigidity; ! #X text 251 222 Delete all masses and links; ! #X text 400 321 $5 : viscosity; ! #X text 400 338 $6 : damping; #X obj 61 561 cnv 15 610 82 empty empty DYNAMIC_SETTING 20 12 0 14 -262131 -66577 0; *************** *** 101,127 **** / linksPos ); #X text 237 742 $2 : Id (symbol or creations numbers); ! #X msg 78 308 link $1 $2 $3 $4 $5 $6; ! #X msg 74 532 deleteLink $1; ! #X text 239 534 Delete a link; ! #X text 340 534 $1 : Creation No of link; #X msg 73 762 infosL; #X text 236 762 Get infos on all masses and links on outlet No 2; ! #X msg 73 423 iLink $1 $2 $3 $4 $5 $6; ! #X text 338 308 $1 : Id (symbol); ! #X text 250 308 Add a link; ! #X text 337 328 $2 : creation No of mass1; ! #X text 337 346 $3 : creation No of mass2; ! #X text 336 364 $4 : rigidity; ! #X text 336 382 $5 : viscosity; ! #X text 336 399 $6 : damping; ! #X text 410 422 $1 : Id (symbol); ! #X text 409 478 $4 : rigidity; ! #X text 409 496 $5 : viscosity; ! #X text 409 513 $6 : damping; ! #X text 410 422 $1 : Id (symbol); ! #X text 409 478 $4 : rigidity; ! #X text 409 496 $5 : viscosity; ! #X text 409 513 $6 : damping; ! #X text 248 423 Add an interactor link; #X text 94 52 LINKS :; #X text 71 91 parameters : length , rigidity , viscosity and damping. --- 124,148 ---- / linksPos ); #X text 237 742 $2 : Id (symbol or creations numbers); ! #X msg 74 533 deleteLink $1; ! #X text 239 535 Delete a link; ! #X text 340 535 $1 : Creation No of link; #X msg 73 762 infosL; #X text 236 762 Get infos on all masses and links on outlet No 2; ! #X text 402 247 $1 : Id (symbol); ! #X text 314 247 Add a link; ! #X text 401 267 $2 : creation No of mass1; ! #X text 401 285 $3 : creation No of mass2; ! #X text 400 303 $4 : rigidity; ! #X text 400 321 $5 : viscosity; ! #X text 400 338 $6 : damping; ! #X text 463 392 $1 : Id (symbol); ! #X text 462 448 $4 : rigidity; ! #X text 462 466 $5 : viscosity; ! #X text 462 483 $6 : damping; ! #X text 463 392 $1 : Id (symbol); ! #X text 462 448 $4 : rigidity; ! #X text 462 466 $5 : viscosity; ! #X text 462 483 $6 : damping; ! #X text 301 393 Add an interactor link; #X text 94 52 LINKS :; #X text 71 91 parameters : length , rigidity , viscosity and damping. *************** *** 132,139 **** #X text 71 120 message. The lenght is initialised to the distance between ; ! #X text 71 106 Rigidity , viscosity and damping are defined by the creation; - #X text 409 442 $2 : Id (symbol) of masses type 1; - #X text 409 460 $3 : Id (symbol) of masses type 2; #X text 70 148 Interactor links are links between mutiples masses , instead; --- 153,158 ---- #X text 71 120 message. The lenght is initialised to the distance between ; ! #X text 71 107 Rigidity , viscosity and damping are defined by the creation; #X text 70 148 Interactor links are links between mutiples masses , instead; *************** *** 141,173 **** with; #X text 69 175 their Id.; ! #X obj 33 821 msd2D; ! #X connect 1 0 56 0; ! #X connect 14 0 56 0; ! #X connect 18 0 56 0; ! #X connect 22 0 56 0; ! #X connect 23 0 56 0; ! #X connect 26 0 56 0; ! #X connect 28 0 56 0; ! #X restore 223 342 pd links; ! #X text 75 312 HELP on masses --->; ! #X text 74 343 HELP on links --->; ! #X text 13 117 There are 4 types of messages for msd :; ! #X text 14 81 It is designed to implement particules physical model ! in PD.The model is based on two elements type : mass and link.; ! #X obj 13 132 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 ! 0; ! #X obj 13 165 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 ! 0; ! #X obj 13 198 cnv 15 420 30 empty empty empty 20 12 0 14 -262131 -66577 ! 0; ! #X obj 13 231 cnv 15 420 30 empty empty empty 20 12 0 14 -261689 -66577 ! 0; ! #X text 16 139 CREATION : To create the model masses and links.; ! #X text 16 204 DYNAMIC SETTING : To set the model parameters dynamically. ! ; ! #X text 16 237 ATTRIBUTES : To get the model parameters.; ! #X text 16 166 COMPUTATION : To compute the new model state based on ! previous instant.; ! #X text 94 23 MSD2D : mass - spring - damper model; ! #X text 15 68 MSD2D is the 2D object of the msd objects collection. ! ; --- 160,177 ---- with; #X text 69 175 their Id.; ! #X text 397 356 ($7) : minimum lenght of link; ! #X text 397 373 ($8) : maximum lenght of link; ! #X msg 78 247 link $1 $2 $3 $4 $5 $6 ($7 $8); ! #X text 462 412 $2 : Id (symbol) of masses 1; ! #X text 462 430 $3 : Id (symbol) of masses 2; ! #X msg 73 393 iLink $1 $2 $3 $4 $5 $6 ($7 $8); ! #X text 458 500 ($7) : minimum lenght of links; ! #X text 458 517 ($8) : maximum lenght of links; ! #X connect 2 0 0 0; ! #X connect 15 0 0 0; ! #X connect 19 0 0 0; ! #X connect 23 0 0 0; ! #X connect 26 0 0 0; ! #X connect 55 0 0 0; ! #X connect 58 0 0 0; ! #X restore 224 340 pd links;
Index: 03_imsd2Dtest.pd =================================================================== RCS file: /cvsroot/pure-data/externals/nusmuk/msd2D/03_imsd2Dtest.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 03_imsd2Dtest.pd 12 Apr 2005 16:34:04 -0000 1.1 --- 03_imsd2Dtest.pd 21 Apr 2005 14:28:54 -0000 1.2 *************** *** 25,32 **** 0; #X msg 82 442 forceX mob 100; - #X msg 85 383 setD souple 0.01; - #X msg 216 384 setK souple 1; - #X msg 85 403 setD souple 1; - #X msg 216 404 setK souple 2; #X msg 208 443 forceY mob 100; #X text 351 396 SET RIGIDITY AND VISCOSITY OF LINKS; --- 25,28 ---- *************** *** 151,191 **** #X text 292 313 COMPUTE AND GET ALL LINKS POSITIONS; #X text 260 572 DISPLAY LINKS WITH GEM; ! #X connect 0 0 40 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; ! #X connect 7 0 46 0; #X connect 7 1 1 0; #X connect 9 0 7 0; ! #X connect 10 0 40 0; #X connect 11 0 9 0; ! #X connect 13 0 34 1; #X connect 14 0 9 0; #X connect 15 0 9 0; #X connect 17 0 18 0; ! #X connect 18 0 47 0; #X connect 20 0 7 0; #X connect 21 0 7 0; ! #X connect 22 0 7 0; ! #X connect 23 0 7 0; ! #X connect 24 0 7 0; ! #X connect 25 0 7 0; ! #X connect 34 0 36 0; ! #X connect 34 0 37 0; ! #X connect 35 0 34 0; ! #X connect 36 0 7 0; ! #X connect 37 0 7 0; ! #X connect 39 0 9 0; ! #X connect 40 0 41 0; ! #X connect 40 1 44 0; ! #X connect 40 2 13 0; ! #X connect 40 2 15 0; ! #X connect 40 3 42 0; ! #X connect 40 4 14 0; ! #X connect 40 5 11 0; ! #X connect 41 0 9 0; ! #X connect 42 0 39 0; ! #X connect 44 0 9 0; ! #X connect 45 0 5 1; ! #X connect 46 0 30 0; #X connect 47 0 7 0; --- 147,191 ---- #X text 292 313 COMPUTE AND GET ALL LINKS POSITIONS; #X text 260 572 DISPLAY LINKS WITH GEM; ! #X msg 85 383 setD inter 0; ! #X msg 84 403 setD2 inter 0; ! #X msg 216 384 setK inter 1; ! #X msg 216 404 setK inter 2; ! #X connect 0 0 36 0; #X connect 3 0 2 0; #X connect 4 0 5 0; #X connect 6 0 2 0; ! #X connect 7 0 42 0; #X connect 7 1 1 0; #X connect 9 0 7 0; ! #X connect 10 0 36 0; #X connect 11 0 9 0; ! #X connect 13 0 30 1; #X connect 14 0 9 0; #X connect 15 0 9 0; #X connect 17 0 18 0; ! #X connect 18 0 43 0; #X connect 20 0 7 0; #X connect 21 0 7 0; ! #X connect 30 0 32 0; ! #X connect 30 0 33 0; ! #X connect 31 0 30 0; ! #X connect 32 0 7 0; ! #X connect 33 0 7 0; ! #X connect 35 0 9 0; ! #X connect 36 0 37 0; ! #X connect 36 1 40 0; ! #X connect 36 2 13 0; ! #X connect 36 2 15 0; ! #X connect 36 3 38 0; ! #X connect 36 4 14 0; ! #X connect 36 5 11 0; ! #X connect 37 0 9 0; ! #X connect 38 0 35 0; ! #X connect 40 0 9 0; ! #X connect 41 0 5 1; ! #X connect 42 0 26 0; ! #X connect 43 0 7 0; ! #X connect 46 0 7 0; #X connect 47 0 7 0; + #X connect 48 0 7 0; + #X connect 49 0 7 0;