[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12721] trunk/blender/release/scripts/ wizard_curve2tree.py: - better weighting for fill twig placement
Campbell Barton
ideasman42 at gmail.com
Thu Nov 29 15:41:34 CET 2007
Revision: 12721
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12721
Author: campbellbarton
Date: 2007-11-29 15:41:33 +0100 (Thu, 29 Nov 2007)
Log Message:
-----------
- better weighting for fill twig placement
- curve direction isnt used anymore - just make the small end the last.
Modified Paths:
--------------
trunk/blender/release/scripts/wizard_curve2tree.py
Modified: trunk/blender/release/scripts/wizard_curve2tree.py
===================================================================
--- trunk/blender/release/scripts/wizard_curve2tree.py 2007-11-29 13:57:41 UTC (rev 12720)
+++ trunk/blender/release/scripts/wizard_curve2tree.py 2007-11-29 14:41:33 UTC (rev 12721)
@@ -251,6 +251,8 @@
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 @@
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 @@
# 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
More information about the Bf-blender-cvs
mailing list