I was playing around with a custom fdarc procedure (which moves a specified distance along an arc of some angle), when I noticed that it doesn't work very well with filled, since it draws some extra strokes.
Examples:
; Two disconnected lines both going in the same direction
filled "black [ fd 100 pu bk 100 rt 90 fd 100 pd lt 90 fd 100 ]
; Two circle arcs going in opposite directions
cs filled "black [ arc 90 100 pu rt 45 bk 100 rt 45/2 pd arc -45 185 ]
; Eight circle arcs forming something similar to a compass rose
TO pi
if not name? "_pi [ make "_pi (radarctan 0 1) * 2 ]
output :_pi
END
TO fdarc :d :a
localmake "r :d / ( :a * pi / 180 )
if :r > 2000 [ fd :d lt :a stop ]
if :r < -2000 [ fd :d lt :a stop ]
ifelse pendown? [
pu rt 90 bk :r pd ifelse :r > 0 [ arc -:a :r ] [ rt 180 arc -:a -:r rt 180 ] pu lt :a fd :r lt 90 pd
] [
rt 90 bk :r lt :a fd :r lt 90
]
END
filled "black [ repeat 8 [ fdarc 100 45 rt 180 ] ]
Without filled
Without this PR
With PR
Note that the final example works fine even with the current implementation if one uses penup right at the end of filled. The second example is still messy in that case, though.
I was playing around with a custom
fdarc
procedure (which moves a specified distance along an arc of some angle), when I noticed that it doesn't work very well withfilled
, since it draws some extra strokes.Examples:
filled
Note that the final example works fine even with the current implementation if one uses
penup
right at the end offilled
. The second example is still messy in that case, though.