Path Properties

drawBot.strokeWidth(value)

Sets stroke width.

# set no fill
fill(None)
# set black as the stroke color
stroke(0)
# loop over a range of 10
for i in range(10):
    # in each loop set the stroke width
    strokeWidth(i)
    # draw a line
    line((100, 100), (200, 200))
    # and translate the canvas
    translate(15, 0)
drawBot.miterLimit(value)

Set a miter limit. Used on corner points.

# create a path
path = BezierPath()

# move to a point
path.moveTo((100, 100))
# line to a point
path.lineTo((100, 200))
path.lineTo((120, 100))

# set stroke color to black
stroke(0)
# set no fill
fill(None)
# set the width of the stroke
strokeWidth(10)

# draw the path
drawPath(path)

# move the canvas
translate(100, 0)

# set a miter limit
miterLimit(50)

# draw the same path again
drawPath(path)
drawBot.lineJoin(value)

Set a line join.

Possible values are miter, round and bevel.

# set no fill
fill(None)
# set the strok color to black
stroke(0)
# set a stroke width
strokeWidth(10)
# set a miter limit
miterLimit(30)

# create a bezier path
path = BezierPath()
# move to a point
path.moveTo((100, 100))
# line to a point
path.lineTo((100, 200))
path.lineTo((110, 100))

# set a line join style
lineJoin("miter")
# draw the path
drawPath(path)
# translate the canvas
translate(100, 0)

# set a line join style
lineJoin("round")
# draw the path
drawPath(path)
# translate the canvas
translate(100, 0)

# set a line join style
lineJoin("bevel")
# draw the path
drawPath(path)
# translate the canvas
translate(100, 0)
drawBot.lineCap(value)

Set a line cap.

Possible values are butt, square and round.

# set stroke color to black
stroke(0)
# set a strok width
strokeWidth(10)

# translate the canvas
translate(100, 100)

# set a line cap style
lineCap("butt")
# draw a line
line((0, 30), (0, 200))

# rotate the canvas
rotate(-30)
# set a line cap style
lineCap("square")
# draw a line
line((0, 30), (0, 200))

# rotate the canvase
rotate(-30)
# set a line cap style
lineCap("round")
# draw a line
line((0, 30), (0, 200))
drawBot.lineDash(*value)

Set a line dash with any given amount of lenghts. Uneven lenghts will have a visible stroke, even lenghts will be invisible.

# create a path
path = BezierPath()

# move to a point
path.moveTo((100, 100))
# line to a point
path.lineTo((100, 200))

# set stroke color to black
stroke(0)
# set no fill
fill(None)
# set the width of the stroke
strokeWidth(10)

# set a line dash
lineDash(5, 2)

# draw the path
drawPath(path)

# move the canvas
translate(100, 0)

# set a different line dash
lineDash(5, 2, 3, 10, 1)

# draw the same path again
drawPath(path)