Krion Posted December 1, 2019 Share Posted December 1, 2019 Hi guys, At this moment I could really use some guidance: I have found nearby points on my scattered grid and connected them in a certain way. As you can see in the screenshot by the overlapping point numbers, a lot of duplicate lines are made. I tried to prevent this by making an attribute that denotes if a connection is made on a point, but this didn't change anything. And on sidefx.com I saw this post where people say a wrangle isn't able to read the attribute values already added by that same wrangle, which kind of explains why my code didn't work. But how is this sort of thing done then? Thanks. (: Quote Link to comment Share on other sites More sharing options...
Noobini Posted December 1, 2019 Share Posted December 1, 2019 would fuse and polypath work ? would help if you upload your file, doesn't have to be everything, just a few bits of the overlapping lines might help ppl solving the problem. 1 Quote Link to comment Share on other sites More sharing options...
Krion Posted December 2, 2019 Author Share Posted December 2, 2019 (edited) For this problem that works indeed, thanks. I guess I posted it because I intended to ask a more general question about how you can deal with wanting to acces the ‘updated’ attributes of a wrangle and I just assumed that this would be a thing of importance to a broad range of possible 'future' problems.. But yeah; maybe the solution is just to think simple and to don’t forget SOPs are still there, even when you try to be super technical. Edited December 2, 2019 by Krion Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted December 2, 2019 Share Posted December 2, 2019 Hi Dave, nearpoints() always returns the current point first, so I usually remove the first item from the array: removeindex(pts, 0); To avoid creating double lines you would only connect to point numbers that are larger than the current point: if(i@ptnum > pt) 1 1 Quote Link to comment Share on other sites More sharing options...
ThomasPara Posted December 2, 2019 Share Posted December 2, 2019 (edited) You can make new primitives based on the points you already have. Connect them all and then compare if you have duplicates. Sometimes you have to do operations over several wrangles. NoDuplicates_01.hip Edited December 2, 2019 by ThomasPara 1 Quote Link to comment Share on other sites More sharing options...
Krion Posted December 8, 2019 Author Share Posted December 8, 2019 (edited) Really handy to know indeed that nearpoints() includes the point itself too.. That ptnum>trick is also a handy way to cut in half the connections. I was looking already for a way to reduce or increase the number of connections. Add a little int channel to it and I have a slider for it. int plus = chi("connectionPlus"); foreach(int pt; closePTS){ if(@ptnum>pt+plus) Will have to look into what you did with that string stuff, Thomas, but it looks interesting. Thanks guys. Edited December 8, 2019 by Krion Quote Link to comment Share on other sites More sharing options...
Krion Posted December 8, 2019 Author Share Posted December 8, 2019 @konstantin magnus Hi konstantin. Would you also know how to remove the first index when using a point cloud instead of nearpoints()? I got this far but the second line needs to be for index, not removal of the point... int firstPTcloudnum = pcimportbyidxi(PTcloud, "point.number", 0); removepoint(0,firstPTcloudnum); 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.