Jump to content

Prevent duplicate lines while connecting nearpoints()


Krion

Recommended Posts

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. (:

5de430800cd45_Screenshot2019-12-01at22_14_36.thumb.png.5afd3cfed6083773d8714052ea24bcb7.png

Link to comment
Share on other sites

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. :lol:

Edited by Krion
Link to comment
Share on other sites

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. :D 

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 by Krion
Link to comment
Share on other sites

@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);

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...