Skip to content

ShapeElementList only supports 170 num_segments? Too little #2794

@philox12358

Description

@philox12358

Problem

ShapeElementList, as an efficient method for drawing batches, only supports 170 num_segments, which is too few or there may be some bugs.

Source code example

This is the official code for create_ellipse_filled, num_segments is a important argument, no problem.

def create_ellipse_filled(
    center_x: float,
    center_y: float,
    width: float,
    height: float,
    color: RGBA255,
    tilt_angle: float = 0,
    num_segments: int = 128,
) -> Shape:

    Args:
        center_x: X position of the center of the ellipse
        center_y: Y position of the center of the ellipse
        width: Width of the ellipse
        height: Height of the ellipse
        color: A color such as a :py:class:`~arcade.types.Color`
        tilt_angle: Angle to tilt the ellipse
        num_segments: Number of segments to use to draw the ellipse

Problem occurred

But, if num_segments>170, ShapeElementList (ellipse_list) will disappear, ShapeElementList.draw() will draw nothing
As shown in the following code:

ellipse_list = ShapeElementList()
ellipse = create_ellipse_filled(0, 0, 500, 500, arcade.color.SPANISH_VIOLET, 0, num_segments=170)
ellipse_list.append(ellipse)
ellipse_list.draw()                     # if num_segments>170, ShapeElementList will disappear

Analyze

Repeated experiments have yielded the number 170, which is a very strange number. This should be a bug, theoretically ShapeElementList should accommodate a much larger quantity of num_segments than this 170.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions