PlatinumFishy Posted December 21, 2017 Share Posted December 21, 2017 I have tried using the Connect Adjacent Pieces sop but it does not seem to be working (or I could just not be using it right). The documentation on the sop is also cryptic. Is there a way to achieve this without using this sop? I know when you use addpoint(0, @P) in a primitive wrangle that it will create a point in the center of the polygon but that point has no attribute and no way to inherent any attributes from the primitive that it is created from. There also does not seem to be a vex function that fetches the adjacent pieces of a polygon. Any help would be appreciated. Quote Link to comment Share on other sites More sharing options...
tamagochy Posted December 21, 2017 Share Posted December 21, 2017 After addpoint you can use setpointattribute to set all needed attributes. Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 21, 2017 Share Posted December 21, 2017 you can also promote all the primitive attributes to point attributes (after using a fuse set to unique), use: //run over primitives int pt = addpoint(0, primpoint(0, @primnum, 0)); setpointattrib(0, "P", pt, v@P);//set the point location to the center primitives this way the point should inherit at least all point attribs from the source. you also may want to try the "compute dual" function on a divide SOP to create lines between the prim centroids. Quote Link to comment Share on other sites More sharing options...
PlatinumFishy Posted December 21, 2017 Author Share Posted December 21, 2017 (edited) Okay! So the Compute Dual function did exactly what I was looking for, thank you! Edit: Does not work completely. Edited December 21, 2017 by PlatinumFishy Not properly tested Quote Link to comment Share on other sites More sharing options...
Noobini Posted December 21, 2017 Share Posted December 21, 2017 (edited) i don't think compute dual method is absolutely 100% correct...consider your diagram above...see the 3 left most points...they are not connected to each other coz the connection would cross more than 1 blue edge...using div, compute dual...you may get these unwanted connections....unless you DO want them ? Edited December 21, 2017 by Noobini Quote Link to comment Share on other sites More sharing options...
acey195 Posted December 21, 2017 Share Posted December 21, 2017 I didn't say the solution would be perfect :P.. that said, you could convert every edge to a primitive (using the carve sop with internal breakpoints for example) after that you would be able to use an intersection analysis node and remove every primitive that has more than 1 intersection, to get rid of the edges marked by noobini. Quote Link to comment Share on other sites More sharing options...
PlatinumFishy Posted December 21, 2017 Author Share Posted December 21, 2017 (edited) @Noobini You're correct. I was only using a grid that was remeshed (with varying density) as my sample geometry. I guess the only problem with using the divide sop is that it must triangulate everything. Also, this inner lattice is more for determining which primitives are next to one another rather than actually being used in the final graphics. The idea is to use this lattice along with the neighbors function. In the photo you posted the one with the arrow on the right would be okay but not the arrow on the left, unless there is a tiny shared edge i am not seeing. While doing some researching I came across this thread: And while it seems to be what I am trying to achieve, I cannot seem to understanding of most of it. Edited December 21, 2017 by PlatinumFishy Quote Link to comment Share on other sites More sharing options...
f1480187 Posted December 21, 2017 Share Posted December 21, 2017 What's wrong with Divide sop? It should do exactly what you are asking for, unless there is some bug occur. Upload a scene. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.