soegaard / sketching

A Racket library for creative drawings and animations. Inspired by Processing.
110 stars 10 forks source link

arc only partially drawn when (fill) isn't specified #65

Closed ericcervin closed 2 years ago

ericcervin commented 2 years ago

When I run this code, the first arc is only partially drawn. Once the (fill) is specified, the second arc is fully drawn.

`#lang sketching (define (setup) (size 360 120) (background 200) (no-loop) )

(define (draw) (ellipse 90 60 80 80) ; ok (arc 190 60 80 80 0 pi/2 'pie) ; partially drawn (fill 255) (arc 290 60 80 80 0 pi/2 'pie);ok`

arc_issue

soegaard commented 2 years ago

Hi Eric,

Thanks for the bug report. I have committed a change that I hope fixes arc.

There were a couple of cases I adjusted.

Report back if it works or not.

@all-contributors please add @ericcervin for examples.

allcontributors[bot] commented 2 years ago

@soegaard

I've put up a pull request to add @ericcervin! :tada:

ericcervin commented 2 years ago

Thanks. Yesterday's example now runs correctly.

Now what I'm seeing is that the 'open-pie default runs like 'open .

`#lang sketching (define (setup) (size 500 120) (smoothing 'smoothed) (background 200) (no-loop) )

(define (draw) (arc 50 50 80 80 0 ( 5/4 pi)) (arc 150 50 80 80 0 ( 5/4 pi) 'open-pie) (arc 250 50 80 80 0 ( 5/4 pi) 'pie) (arc 350 50 80 80 0 ( 5/4 pi) 'open) (arc 450 50 80 80 0 (* 5/4 pi) 'chord) )`

image

soegaard commented 2 years ago

Thanks for the quick response.

The initial value for the brush and the initial value for the parameter current-fill didn't match. I changed the initial value for current-fill.

I hope this fixes the issue.

ericcervin commented 2 years ago

Thanks. That was enough to fix the two cases above. It also fixes a simple example I was working on: https://github.com/ericcervin/getting-started-with-sketching/blob/main/pg018.rkt

image