Skip to content

Commit

Permalink
Fixed bug in rendering of 3D primitives
Browse files Browse the repository at this point in the history
The Geometry class does not have children attribute which caused error in draw_shape() function
  • Loading branch information
arihantparsoya committed Apr 7, 2020
1 parent 1b233fd commit 56fd90d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions p5/core/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..pmath.utils import SINCOS

from .shape import PShape
from .geometry import Geometry

from . import p5

Expand Down Expand Up @@ -579,6 +580,10 @@ def draw_shape(shape, pos=(0, 0, 0)):
"""
p5.renderer.render(shape)

if isinstance(shape, Geometry):
return

for child_shape in shape.children:
draw_shape(child_shape)

Expand Down

0 comments on commit 56fd90d

Please sign in to comment.