Changeset View
Changeset View
Standalone View
Standalone View
add_curve_sapling/utils.py
| Context not available. | |||||
| elif r >= custom[2]: | elif r >= custom[2]: | ||||
| pos = (r - custom[2]) / (1 - custom[2]) | pos = (r - custom[2]) / (1 - custom[2]) | ||||
| #if (custom[0] >= custom[1] <= custom[3]) or (custom[0] <= custom[1] >= custom[3]): | #if (custom[0] >= custom[1] <= custom[3]) or (custom[0] <= custom[1] >= custom[3]): | ||||
| pos = pos * pos | pos *= pos | ||||
| v = (pos * (custom[3] - custom[1])) + custom[1] | v = (pos * (custom[3] - custom[1])) + custom[1] | ||||
| else: | else: | ||||
| pos = r / custom[2] | pos = r / custom[2] | ||||
| Context not available. | |||||
| #length taperCrown | #length taperCrown | ||||
| if n == 0: | if n == 0: | ||||
| dec = declination(dir) / 180 | dec = declination(dir) / 180 | ||||
| dec = dec ** 2 | dec **= 2 | ||||
| tf = 1 - (dec * taperCrown * 30) | tf = 1 - (dec * taperCrown * 30) | ||||
| tf = max(.1, tf) | tf = max(.1, tf) | ||||
| else: | else: | ||||
| Context not available. | |||||
| f = offset | f = offset | ||||
| if leafScaleT < 0: | if leafScaleT < 0: | ||||
| leafScale = leafScale * (1 - (1 - f) * -leafScaleT) | leafScale *= 1 - (1 - f) * -leafScaleT | ||||
| else: | else: | ||||
| leafScale = leafScale * (1 - f * leafScaleT) | leafScale *= 1 - f * leafScaleT | ||||
| leafScale = leafScale * uniform(1 - leafScaleV, 1 + leafScaleV) | leafScale = leafScale * uniform(1 - leafScaleV, 1 + leafScaleV) | ||||
| if leafShape == 'dFace': | if leafShape == 'dFace': | ||||
| leafScale = leafScale * .1 | leafScale *= .1 | ||||
| # If the bending of the leaves is used we need to rotate them differently | # If the bending of the leaves is used we need to rotate them differently | ||||
| if (bend != 0.0) and (leaves >= 0): | if (bend != 0.0) and (leaves >= 0): | ||||
| Context not available. | |||||
| #split bias | #split bias | ||||
| splitValue = segSplits[n] | splitValue = segSplits[n] | ||||
| if n == 0: | if n == 0: | ||||
| splitValue = ((2 * splitBias) * (kp - .5) + 1) * splitValue | splitValue *= ((2 * splitBias) * (kp - .5) + 1) | ||||
| splitValue = max(splitValue, 0.0) | splitValue = max(splitValue, 0.0) | ||||
| # For each of the splines in this list set the number of splits and then grow it | # For each of the splines in this list set the number of splits and then grow it | ||||
| Context not available. | |||||