- better weighting for fill twig placement

- curve direction isnt used anymore - just make the small end the last.
This commit is contained in:
Campbell Barton 2007-11-29 14:41:33 +00:00
parent fbadcf1c7b
commit 6649ba74d6

@ -251,6 +251,8 @@ class tree:
if brch.bpoints:
# if all points are in the same location, this is possible
self.branches_all.append(brch)
if brch.bpoints[0].radius < brch.bpoints[-1].radius: # This means we dont have to worry about curve direction.
brch.bpoints.reverse()
brch.calcData()
# Sort from big to small, so big branches get priority
@ -1030,9 +1032,11 @@ class tree:
for pt in interior_points:
# line from the point to the seg endpoint
line_normal = seg.tailCo - pt.nextMidCo
l = line_normal.length
cross1 = CrossVecs( seg.no, line_normal )
cross2 = CrossVecs( pt.no, line_normal )
@ -1043,7 +1047,7 @@ class tree:
# angle = 66.0 # min(AngleBetweenVecs(v2_co-v1_co, leaf.co-cc), AngleBetweenVecs(v1_co-v2_co, leaf.co-cc))
# print angle, angle2
# l = (l * ((1+abs(angle-BEST_ANG))**2 )) / (1+angle_line)
l = angle_leaf_no_diff * angle_line * l
l = (1+(angle_leaf_no_diff/180)) * (1+(angle_line/180)) * l
if l < best_dist:
best_pt = pt