41 lines
887 B
Python
Executable File
41 lines
887 B
Python
Executable File
import sys
|
|
import os
|
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), '..'))
|
|
from Command import *
|
|
from Program import *
|
|
import math
|
|
|
|
class K18650:
|
|
|
|
def __init__(self):
|
|
self.out='IN;SP1;'
|
|
def hpgl(self,n,di):
|
|
|
|
h=40*65
|
|
da=40*9
|
|
zbreite=2*math.pi*da/n
|
|
self.out+=('PU0,'+str(da)+';')
|
|
for i in range(n):
|
|
self.out+=('PD'+str(i*zbreite+zbreite/2)+',0;')
|
|
self.out+=('PD'+str(i*zbreite+zbreite)+','+str(da)+';')
|
|
|
|
self.out+=('PU0,'+str(h+da)+';')
|
|
for i in range(n):
|
|
self.out+=('PD'+str(i*zbreite+zbreite/2)+','+str(h+2*da)+';')
|
|
self.out+=('PD'+str(i*zbreite+zbreite)+','+str(h+da)+';')
|
|
|
|
self.out+=('PU0,'+str(di)+';')
|
|
self.out+=('PD'+str(n*zbreite)+','+str(di)+';')
|
|
self.out+=('PD'+str(n*zbreite)+','+str(2*da+h-di)+';')
|
|
self.out+=('PD0,'+str(2*da+h-di)+';')
|
|
self.out+=('PD0,'+str(di)+';')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|