pee*_*eer 2 haskell haskell-diagrams
我想制作一条宽度等于圆直径的圆形线.经过多次试验和错误后,这似乎产生了想要的输出.
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
main = mainWith example
path = fromVertices [p2 (0,0), p2 (3,0)] # lw 80
example :: Diagram B
example = atPoints [p2 (0,0)] n
<> (path # lineCap LineCapRound . lineJoin LineJoinRound)
<> atPoints [p2 (3,0)] n
<> square 10 # lw none # fc white
where
n =[circle 1 # fc green # lw none]
Run Code Online (Sandbox Code Playgroud)
但感觉不对.我希望lw 2对应circle 1因为2是半径的两倍,但肯定不是lw 80?!
为什么它适用于80?假设我错过了一些东西,怎么做一个像圆一样宽的圆形线?