-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edge Center / Edge Split node ? #1305
Comments
Btw, when you get an edge list input that comes as [[ [1,3], [3,4] ]] etc.. and read this and an input into an node, how do I get rid of the extra nestedness ? Or should I not get rid of it (in case the vectorization later on needs to rely on it?). |
the nested nature of the data makes vectorization possible, it's up to you whether you use it ..or stop looking after the first input list ( |
make it split
too :) |
i think there's a bmesh.ops now that makes this very simple |
What do you mean @zeffii ? Add two vertices on each edge? Is this for your edge net idea, btw? :) Btw, the node does not adjust the edges, simply generates vertices where the split position on each edge would be. |
Btw, is there a way to connect every vertex with every other vertex? Perhaps a combinatorial node would be nice to have. |
like edge split in 3dsmax has a mirror option, that splits the way i showed above. This is very useful for when we subdivide an edge based mesh as it allows consistent curvature/radius deformation where there
oooh. i see - never mind then, it's easy enough to write script nodes for these things.. |
kdtree edges can be used to connect everthing, but if you want pure topological 'complete' graph from all verts, then..no we don't have a node for that. |
@zeffii so you don't think a node like this is useful ? It can be made similar to the polygon center node. |
i think you are talking about two nodes here? Nodes with too many functions is something I want to avoid, because that brings a new problem of naming the node. and the node internals tend to become very messy. (unless the various modes are utterly trivial and reuse the same sockets..) just because i don't have a need for a combinatorial node doesn't mean i'm against it.. it just means i'm not going to be excited about it. |
here append is aliased to the |
@zeffii Sorry. I guess my follow up question about full connectivity created some confusion as to what node we are talking about. I was suggesting 2 nodes: one for edge centers (or more generalized edge split vertex node) similar to the polygon center nodes. The other was a node to create combinatorial operations on a set of vertices to allow two generate a complete graph type of connectivity (btw, a fully connected graph is not necessarily a complete graph). (note: your itertools example does create a complete graph though. thanks for the tip). The first node could be extended to do the type of mirroring you suggested and perhaps go beyond that and not just create the vertices on the edges, but also create the additional split edges. I’m not sure how to handle new polygons when the edges are split though and I was not going to tackle the polygons at all in this node, but it’s probably doable. The more i think about it though, an edge splitter that splits also polygons would be pretty much like a subdivide operation, except that an edge splitter that takes a splitting factor as an input can also determine where the subdivide (split) location on an edges will go. I believe blender’s subdivide op puts the split verts at the edge centers. As for the second node for combinatorics, I can’t see many uses for it either but it would be nice to have. I do need one for something I was working on (e.g. generate the Metatron’s cube lines by fully connecting vertices on a cube). The screenshot below does not have yet the completely connected graph, but i’m getting there. The purple verts/edges are not part of the Metatron’s cube, but I wanted to add them for illustration (hence my need to get the edge centers). Once I connect all the remaining vertices to form a complete graph the MC will be complete :) |
Edge Center we can use Bounding Box for every points ... or Vector
Interpolation of 2 points
--
…------------------------------------------------------------
- Jimmy Gunawan
http://blendersushi.blogspot.com.au
http://mayaspiral.blogspot.com.au
http://houdoodles.blogspot.com.au
http://puppetar.blogspot.com.au
|
I like that DolphinDream!!
--
…------------------------------------------------------------
- Jimmy Gunawan
http://blendersushi.blogspot.com.au
http://mayaspiral.blogspot.com.au
http://houdoodles.blogspot.com.au
http://puppetar.blogspot.com.au
|
Make a combinatorial node, with the few obvious modes. Itertools is your friend, spacial searches are already implemented in kdtree nodes. |
If needed i could pull request my EdgeSplit branch: |
if you move it to Modifiers / Change , then i'm happy to accept the Pull Request. |
will do.. soon. It’s been a while.. time to get back to the SV realms :) |
Dolphin Dream is back yey! I am curious how this edge thing can be used for
Origami effect.
|
I just realized (going back to my blend files using this node) that I actually failed to honor the initial title I gave to this issue “Edge Center” :) I needed the edge centers.. not just to split the edges. Any objection to adding a “Split Verts” output so that I can get access the actual vertices added during the split ? It would provide a similar functionality to the poly center node, but for edges. |
Normally to get Edge Center, I am using Vector Intepolation and 0.5 value.
|
You want the Edge Length per Edge to appear on the Edge using ViewerIndex node? Admittedly we have no convenience method for this, but i'd use something like: here's a modified version of edge-length.py (this is not a SNL script.. its a ScriptNode 1 script...) import mathutils
from mathutils import Vector
#get length of all edges
def sv_main(verts=[[]],edges=[[]]):
# in boilerplate - make your own sockets
in_sockets = [
['v', 'Vertices', verts],
['s', 'Edges', edges],
]
lengths = []
locations = []
for v,es in zip(verts,edges):
lens=[]
locs=[]
for e0,e1 in es:
edgelen = (Vector(v[e0])-Vector(v[e1])).length
lens.append([round(edgelen, 4)])
locs.append(((Vector(v[e0])+Vector(v[e1]))/2)[:])
lengths.append(lens)
locations.append(locs)
out_sockets = [
['s', 'Lengths', lengths],
['v', 'Locations', locations]
]
return in_sockets, out_sockets |
here's SNLite version.. with adjustable rounding """
in verts v
in edges s
in roundn s default=5 nested=2
out locations v
out lengths s
"""
import mathutils
from mathutils import Vector
for v, es in zip(verts, edges):
lens = []
locs = []
for e0, e1 in es:
edgelen = (Vector(v[e0])-Vector(v[e1])).length
edgemid = ((Vector(v[e0])+Vector(v[e1]))/2)[:]
lens.append([round(edgelen, roundn)])
locs.append(edgemid)
lengths.append(lens)
locations.append(locs) |
madonna! is too much! 1st: thank you very much. 2nd: XD which the difference between SN and SNL? code type? you are a CRACK. i follow you (and follow jimmy on youtube), and both are a great inspiration to my work. in fact, im still starting on blender. i installed it on january, and step by step i leaved the others softwares. |
let me respond in a dedicated thread: #1903 |
@cosmopardo |
I know there is a polygon center node (a few of them) but I can’t seem to find a way to get the center of the edges ? Should there be an Edge center node too? Is there any magic node that can give me these?
Alternatively maybe we can have an Edge Split node which allows you to split the edges anywhere inside the edge.. in the middle or in any “factor” position between 0 and 1 (closer to V1 or close to V2).
The text was updated successfully, but these errors were encountered: