parent
359502b134
commit
594297f7fb
|
@ -623,19 +623,19 @@ class Fetcher(Worker):
|
||||||
x, y = width - x, height - y
|
x, y = width - x, height - y
|
||||||
|
|
||||||
delta = (p['pressure'] - 1000.0) / 1000.0
|
delta = (p['pressure'] - 1000.0) / 1000.0
|
||||||
stoke_width = 0.4 + 0.20 * delta
|
stroke_width = 0.4 + 0.20 * delta
|
||||||
points_with_sk_width.append((x, y, stoke_width))
|
points_with_sk_width.append((x, y, stroke_width))
|
||||||
|
|
||||||
if self.handle_pressure:
|
if self.handle_pressure:
|
||||||
lines = svgwrite.container.Group(id=f'strokes_{stroke_num}', stroke='black')
|
lines = svgwrite.container.Group(id=f'strokes_{stroke_num}', stroke='black')
|
||||||
for i, (x, y, stoke_width) in enumerate(points_with_sk_width):
|
for i, (x, y, stroke_width) in enumerate(points_with_sk_width):
|
||||||
if i != 0:
|
if i != 0:
|
||||||
xp, yp, stoke_width_p = points_with_sk_width[i - 1]
|
xp, yp, stroke_width_p = points_with_sk_width[i - 1]
|
||||||
lines.add(
|
lines.add(
|
||||||
svg.line(
|
svg.line(
|
||||||
start=(xp, yp),
|
start=(xp, yp),
|
||||||
end=(x, y),
|
end=(x, y),
|
||||||
stroke_width=stoke_width,
|
stroke_width=stroke_width,
|
||||||
style='fill:none'
|
style='fill:none'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -646,7 +646,7 @@ class Fetcher(Worker):
|
||||||
stroke_width=0.2,
|
stroke_width=0.2,
|
||||||
style='fill:none'
|
style='fill:none'
|
||||||
)
|
)
|
||||||
for x, y, stoke_width in points_with_sk_width:
|
for x, y, stroke_width in points_with_sk_width:
|
||||||
lines.push(x, y)
|
lines.push(x, y)
|
||||||
|
|
||||||
g.add(lines)
|
g.add(lines)
|
||||||
|
|
Loading…
Reference in New Issue