diff options
author | epoch <epoch@hacking.allowed.org> | 2019-02-05 21:48:29 -0600 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2019-02-05 21:48:29 -0600 |
commit | 420eeee620a287ac5bf133f8a17329a7182d5bbf (patch) | |
tree | 407cd59748e0e5ef4f88b15305dd303aa64cf8da /bin/embolden | |
parent | 848a823b1287d8804e8d6170c3ca30ccf7689784 (diff) | |
download | hackvr-420eeee620a287ac5bf133f8a17329a7182d5bbf.tar.gz hackvr-420eeee620a287ac5bf133f8a17329a7182d5bbf.zip |
forgot to add bin dir that contains a LOT of the handy stuff
Diffstat (limited to 'bin/embolden')
-rw-r--r-- | bin/embolden | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bin/embolden b/bin/embolden new file mode 100644 index 0000000..7b1d951 --- /dev/null +++ b/bin/embolden @@ -0,0 +1,42 @@ +/* + +so, we have a line. + +from 0,0 to 10,0 + +and we want it to transform into a rectangle at about... + +-1,-1 1,-1 1,11 -1,11 + +I guess we're taking each point and pushing it away from itself. + +so 0,0... we can make into a square. we need to push in a direction based on the direction of the other half of the line + +so a=points_to_angle(p1,p2) + +which is 90deg in this case from 0,0 to 10,0 +and we need to push 0,0 in two directions to create two new points +at angles... +90+135 and 90+135+90 + +a+135 and a+135+90 + +now to pick an emboldeness amount. sqrt(2) will get us to the original points I guessed at earlier. + +#define embolden(p1,p2,angle,dist) + +if(s.len == 2) { + a1=points_to_angle(p1,p2); + a2=points_to_angle(p2,p1); + d=1;//how far to embolden + //a2 = (a1 + 180) % 360 + s[0]=c3_add(s.p[0],(c3_t){sin(a2+45)*d,cos(a2+45)*d,0}) + s[1]=c3_add(s.p[0],(c3_t){sin(a2-45)*d,cos(a2-45)*d,0}) + s[2]=c3_add(s.p[1],(c3_t){sin(a1+45)*d,cos(a1+45)*d,0}) + s[3]=c3_add(s.p[1],(c3_t){sin(a1-45)*d,cos(a1-45)*d,0}) +} + +//this can be a script. it'll turn lines into rectangles. +//could be done with awk probably. +//base it on offsetshape? +//maybe just do it in python. |