414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
|
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
arg_count++;
if ( (arg_count-arrow)==1 )
{
#Save up bond coords - no arrow and more segments than a stroke has.
# Allows for bent bonds - but just write out the relevant coordinates
if ( (!arrow)&& (NF>2*stroke_coords+1) ) {
i_bond++;
a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF);
if (a_end==1) {
bonds[i_bond] = sprintf("%s %s %s %s %s %s", \
$2, $3, $4, $5, $(NF-1), $(NF));
}
else {
bonds[i_bond] = sprintf("%s %s %s %s %s %s", \
$2, $3, $(NF-3),$(NF-2),$(NF-1),$NF);
}
if ( (!arrow)&& (NF>2*stroke_coords+1) ) {
i_bond++;
a_end = arrow_end($2,$3,$4,$5,$(NF-3),$(NF-2),$(NF-1),$NF);
if (a_end==1) {
arrow_end_vector_x = $6-$4;
arrow_end_vector_y = $7-$5;
other_end_vector_x = $(NF-1)-$(NF-3);
other_end_vector_y = $(NF)-$(NF-2);
bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \
$2, $3, $4, $5, $(NF-1), $(NF),
arrow_end_vector_x,
arrow_end_vector_y,
other_end_vector_x,
other_end_vector_y);
}
else {
other_end_vector_x = $4-$2;
other_end_vector_y = $5-$3;
arrow_end_vector_x = $(NF-3)-$(NF-5);
arrow_end_vector_y = $(NF-2)-$(NF-4);
bonds[i_bond] = sprintf("%s %s %s %s %s %s %s %s %s %s", \
$2, $3, $(NF-3),$(NF-2),$(NF-1),$NF,
arrow_end_vector_x,
arrow_end_vector_y,
other_end_vector_x,
other_end_vector_y);
}
}
#Save up arrow coords
if ( (arrow)&&(NF==(2*arrow_coords+1)) ) {
i_arrow++;
arrows[i_arrow] = sprintf("%s %s %s %s", $2, $3, $4, $5);
}
|