Modular Tree

add-ons

(Atom) #421

I think it could work if there was a way to have the result attach to the bottom of the trunk, instead of the top? Is that what head_2 of the extremities is about?
Untitled-1


(Atom) #422

A little more code poking around and I found root.position. If I set the module.position to the root, the growth begins at the bottom. so it seems…

def grow(root, iterations, min_radius, limit_method, branch_length, split_proba, split_angle, split_deviation,
         split_radius, radius_decrease, randomness, spin, spin_randomness, creator, selection, gravity_strength,
         pruning_strength, shape_factor, up_attraction, kill_below_0=True, is_root=False):
    density_dict = root.density_dict

    if is_root:
        extremities = []
        root.get_extremities_rec(extremities, selection)
        # Re-write extremeies module location.
        for module, head in extremities:
            module.direction[2] *= -1
            module.position = root.position
    else:
        extremities = []
        root.get_extremities_rec(extremities, selection)

However, following the Root node up with a Grow node does not work. My guess is that the roots need to be excluded from the extremities list…? Perhaps, somehow, re-forward the trunk as the result to fool the next node in the line.


(ScottTX) #423

There needs to be a way to merge two nodes (root and grow). I’m not a coder so I’m of no help.


(Atom) #424

Yep, but I’m thinking it should just return the trunk as it’s result for the next node that way splits and grows can’t happen on the generated roots.


(Atom) #425

Is there anyway to just get the curves that generate the surface as an output? Instead of the fully surfaced tree?