New fingerHoleRectangle() function

This commit is contained in:
Florian Festi 2020-05-10 15:26:34 +02:00
parent 928be1620b
commit 27264f8c08
1 changed files with 12 additions and 0 deletions

View File

@ -1494,6 +1494,18 @@ class Boxes:
self.polyline(*army)
self.ctx.stroke()
@restore
def fingerHoleRectangle(self, dx, dy, x=0., y=0., angle=0., outside=False):
self.moveTo(x, y, angle)
d = 0.5*self.thickness
if outside:
d = -d
self.fingerHolesAt(dx/2+d, -dy/2, dy, 90)
self.fingerHolesAt(-dx/2-d, -dy/2, dy, 90)
self.fingerHolesAt(-dx/2, -dy/2-d, dx, 0)
self.fingerHolesAt(-dx/2, dy/2+d, dx, 0)
##################################################
### parts
##################################################