#1095·nannou

Ellipses aren't closed

Author: mlhetlandCreated Aug 17, 2026Updated Aug 17, 2026

It seems that the .ellipse method doesn't close the arc that's used in the non-resolution branch. That is, this results in a closed (approximated) circle:

rust
    draw.ellipse()
        .stroke_weight(100.0)
        .stroke(BLACK)
        .w_h(200.0, 200.0)
        .resolution(128.0);

While this produces an unclosed arc:

rust
    draw.ellipse()
        .stroke_weight(100.0)
        .stroke(BLACK)
        .w_h(200.0, 200.0);

I believe the fix is simply to add builder.close() before builder.build() in ellipse.rs. (Note that the match branch with a resolution does pass true to the close parameter of polygon::render_points_themed.)

See the following figure for an illustration of the problem:

Image

(A secondary point is that when one does supply a resolution, the corresponding match arm adds a point to the path for each element of the Ellipse::circumference iterator. This produces a Circumference with the given resolution, which again calls Circumference::new_inner with num_points set to resolution + 1 and a rad_step of TAU / resolution. Unless I'm mistaken, this means that the first and last points (approximately) coincide, meaning that the closing of the path yields a (close-to-)zero-length segment. Might not be worth addressing, since using num_points = resolution dosn't seem to be right for all consumers, here, and since Lyon will presumably filter out the degeneracy?)