algorithmic modeling for Rhino
Tags:
you have an error because line 25 is incorrect, you need use
dic_crvs[angs[i]].append(crvs[i])
instead
dic_crvs[angs[i]] = dic_crvs[angs[i]].append(crvs[i]
but you also need change the logic of your code, because when you use set, you change the order of elements in list (set doesn't have an order), therefore angles and curves in lists not corresponding with each other.
wow.. Thank you! it works.
So, if you okay, could you teach me why "dic_crvs[angs[i]] = dic_crvs[angs[i]].append(crvs[i])" is a wrong sentence?
because "dic_crvs[angs[i]]" is a key of dictionary and when you write "dict[key]=..." it's mean that u want change a value for this key, not add new item to list. for example:
dict = {a:[1,2], b:[]}
dict[a] = [3]
your dict will be {a:[3], b:[]}
besides dic_crvs[angs[i]].append(crvs[i]) is not an item, if you print this, you will see "None", because it's like an action.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by