-
Notifications
You must be signed in to change notification settings - Fork 361
Open
Description
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
Labels
No labels