PyO3 Error temp commit
This commit is contained in:
parent
ce648db852
commit
717a389a22
19 changed files with 1011 additions and 1681 deletions
23
icon/make.py
23
icon/make.py
|
@ -1,9 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import svgwrite
|
||||
import random
|
||||
import time
|
||||
from math import factorial, sin, cos, pi
|
||||
from itertools import permutations
|
||||
from math import sin, cos, pi
|
||||
import tsp as m_tsp
|
||||
|
||||
|
||||
|
@ -45,6 +43,10 @@ def make_points(n, size, min_dist=0):
|
|||
return points
|
||||
|
||||
|
||||
def ring_step(v):
|
||||
return 10 + v * 10
|
||||
|
||||
|
||||
def generate(seed, name=None, small=False):
|
||||
sd = 1
|
||||
if small:
|
||||
|
@ -55,7 +57,6 @@ def generate(seed, name=None, small=False):
|
|||
num_points = 5
|
||||
min_dist = 10 + 10 + 20 * (max_rings + 1)
|
||||
base_r = 10
|
||||
ring_step = lambda v: 10 + v * 10
|
||||
size = 1000
|
||||
if name is None:
|
||||
name = seed
|
||||
|
@ -73,7 +74,12 @@ def generate(seed, name=None, small=False):
|
|||
x2 /= sd
|
||||
y1 /= sd
|
||||
y2 /= sd
|
||||
line = dwg.add(dwg.line((x1, y1), (x2, y2), stroke_width=w, stroke=color))
|
||||
dwg.add(dwg.line(
|
||||
(x1, y1),
|
||||
(x2, y2),
|
||||
stroke_width=w,
|
||||
stroke=color
|
||||
))
|
||||
|
||||
for (px, py) in pos:
|
||||
base_r = 3
|
||||
|
@ -110,7 +116,12 @@ def generate(seed, name=None, small=False):
|
|||
ring_col = color
|
||||
if random.random() > 0.75:
|
||||
ring_col = "#ea0"
|
||||
circ = dwg.add(dwg.circle((px, py), r=r, stroke_width=w, stroke=ring_col))
|
||||
circ = dwg.add(dwg.circle(
|
||||
(px, py),
|
||||
r=r,
|
||||
stroke_width=w,
|
||||
stroke=ring_col
|
||||
))
|
||||
circ.fill(color, opacity=0)
|
||||
d = random.random() * pi * 2
|
||||
dx = cos(d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue