Draft: Fix Draft_PointArray and Draft_TwistedArray Count problems

Draft_PointArray and Draft_TwistedArray have Count problems:
1. Draft_PointArray: Count is always zero.
2. Draft_PathTwistedArray: Number of items is Count+1.
3. Draft_PathTwistedLinkArray: Count is increased whenever object is recomputed.

Also the first item in a twisted array should be unrotated.
This commit is contained in:
Roy-043
2021-06-23 11:06:47 +02:00
committed by GitHub
parent fe7f1ba1c3
commit 95428dfbe0

View File

@@ -64,8 +64,8 @@ def get_init_values(path, count=6):
edge = path.Shape.Edges[0]
edge_length = edge.Length
step = edge_length / count
inc = 360/count
step = edge_length / (count - 1)
inc = 360 / (count - 1)
return norm, edge, step, inc
@@ -91,16 +91,17 @@ def get_twisted_placements(path, count=15, rot_factor=0.25):
places = []
params = []
for number in range(count + 1):
for number in range(count):
v0, tan, rot = get_n_params(edge, number, step, norm)
increment += inc
angle = increment * rot_factor
place = App.Placement(v0, tan, angle)
place.Rotation = place.Rotation * rot
places.append(place)
params.append((v0, tan, angle, rot))
increment += inc
return places, params