MCPcopy Create free account
hub / github.com/MaximeHerpin/modular_tree / smooth_stroke

Function smooth_stroke

grease_pencil.py:27–35  ·  view source on GitHub ↗
(iterations, smooth, points)

Source from the content-addressed store, hash-verified

25
26
27def smooth_stroke(iterations, smooth, points):
28 for i in range(iterations):
29 new_points = list()
30 new_points.append(points[0])
31 for j in range(1, len(points) - 1):
32 new_points.append(smooth / 2 * (points[j - 1] + points[j + 1]) + (1 - smooth) * points[j])
33 new_points.append(points[-1])
34 points = new_points
35 return points
36
37
38def smooth_distribute_gp_layer(gp_layer, dist, smooth_iterations):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected