圆弧平滑度

Arc stroke smoothness

我目前正在用 quil 和 Daniel Shiffman's video tutorial 制作一个时钟,但是我在绘制时遇到了问题 arc 弧线绘制的笔画比 line 差一点。

我不知道出了什么问题,或者我的代码有误,或者创建了一个 arc,所以,这是我的代码。

(defn draw-state [state]
  ; Clear the sketch by filling it with light-grey color.
  (q/background 150)

  (let [max-scale-h (- 1 (/ 1 12))
        max-scale-m (- 1 (/ 1 60))
        max-scale-s (- 1 (/ 1 60))]
    (let
      [
        h (q/map-range
           (if (> (q/hour) 12) (- (q/hour) 12) (q/hour)) 0 11 0 max-scale-h)
        m (q/map-range (q/minute) 0 59 0 max-scale-m)
        s (q/map-range (q/seconds) 0 59 0 max-scale-s)

        half-width (/ (q/width) 2)
        half-height (/ (q/height) 2)
        ]

      ;; let body
      (q/translate half-width half-height)
      (q/rotate (* -1 q/HALF-PI))

      (q/stroke-weight 8)
      (q/no-fill)

      (let [angle (* q/TWO-PI h)]
        (q/stroke 255 100 150)
        (q/arc 0 0 300 300 0 angle)

        (q/push-style)
        (q/rotate angle)
        (q/line 0 0 60 0)
        (q/pop-style))

      (let [angle (* q/TWO-PI m)]
        (q/stroke 150 100 255)
        (q/arc 0 0 280 280 0 angle)

        (q/push-style)
        (q/rotate angle)
        (q/line 0 0 70 0)
        (q/pop-style))

      (let [angle (* q/TWO-PI s)]
        (q/stroke 150 255 100)
        (q/arc 0 0 260 260 0 angle)

        (q/push-style)
        (q/rotate angle)
        (q/line 0 0 128 0)
        (q/pop-style)
        ))))

更新

我在设置中添加了 (q/smooth) 作为 this Whosebug post,但它还是一样。

(defn setup []
  (q/smooth)
  (q/frame-rate 30)
  (q/color-mode :rgb)
  )

更新 我尝试在 processing 中使用 smooth,它可以工作,但与网络版本没有任何变化。

左边用于网络,右边用于处理

更新

Sad Developer 在 github 中创建一个问题以关注 the problem

升级到 quil 3.0.0 将解决此问题。 Quil 现在使用 p5js 而不是 processing.js,它没有锯齿线的问题。参见 http://quil.info/sketches/show/snippet_arc