Skip to content

Instantly share code, notes, and snippets.

@5agado
Created February 1, 2019 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 5agado/7b699b486c19d2499362db72eab3b840 to your computer and use it in GitHub Desktop.
Save 5agado/7b699b486c19d2499362db72eab3b840 to your computer and use it in GitHub Desktop.
def draw_line(gp_frame, p0: tuple, p1: tuple):
# Init new stroke
gp_stroke = gp_frame.strokes.new()
gp_stroke.display_mode = '3DSPACE' # allows for editing
# Define stroke geometry
gp_stroke.points.add(count=2)
gp_stroke.points[0].co = p0
gp_stroke.points[1].co = p1
return gp_stroke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment