-
-
Save zeffii/1a2e88e7346ee8a4c9ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sv_main(height=1.0, tail_len=0.5, tail_width=0.2, head_len=1.0): | |
in_sockets = [ | |
['s', 'height', height], | |
['s', 'tail_len', tail_len], | |
['s', 'tail_width', tail_width], | |
['s', 'head_len', head_len]] | |
a = head_len | |
b = height/2 | |
c = tail_width/2 | |
d = tail_len | |
verts = [] | |
add_vert = lambda x, y: verts.append((x, y, 0)) | |
full_arrow = [ | |
[a,0],[0,b],[0,c],[-d,c],[-d,-c],[0,-c],[0,-b]] | |
if 0.0 in (tail_width, tail_len): | |
full_arrow = [[a,0],[0,b],[0,-b]] | |
faces = [[0,1,2]] | |
else: | |
faces = [[0,6,1],[2,3,4,5]] | |
for xy in full_arrow: | |
add_vert(*xy) | |
out_sockets = [ | |
['v', 'Verts', [verts]], | |
['s', 'Faces', [faces]] | |
] | |
return in_sockets, out_sockets |
Wishlist:
- Arrow Segment
- Arrow Generation Variations, via List
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another great example. Elegant Python and Sverchok code.
Thanks so much Zeffii!