1 // AFM operating principle graphic
3 //size(x=9cm,keepAspect=true);
5 import base_afm; // for Cantilever, Substrate, ...
7 defaultpen(fontsize(size=10pt, lineskip=10pt));
9 Cantilever c = Cantilever();
10 // position base so tip touches substrate when bent
11 c.set_tip_for_dx(8pt);
13 // unbend the tip and draw it in grey
15 pair unbent_tip = c.tip;
16 filldraw(c.tip_guide(), fillpen=grey, grey);
17 draw(c.arm_guide(), grey);
18 // rebend the tip and draw it in black
19 c.set_tip_for_dx(8pt);
20 filldraw(c.tip_guide(), fillpen=black);
21 draw(c.arm_guide(), black);
22 label("Cantilever", c.base-(0,14pt), SW);
24 Substrate s = Substrate();
27 Photodiode p = Photodiode(center=(-40pt, 40pt));
29 label("Photodiode", p.center+(0,p.radius), N);
31 Laser s = Laser(start=(-5pt,40pt), dir=S, cantilever=c, photodiode=p);
33 label("Laser", s.start, N);