logix1390 Posted November 27, 2020 Share Posted November 27, 2020 Hello I have a bit of an interesting problem. I have a bunch of small point clouds and I want to create a line from each point to the center point. Each point cloud has its own id. The center point has a matching id . I thought using an addprim function would do the trick but its not working... I have something like this: if(i@id==i@idt){ int prm = addprim(0, "polyline", i@id, i@idt); int vtx = addvertex(0, prm, @ptnum); } I will attach my file for anyone that wants to take a look. Thanks create_line_point_cloud.hip Quote Link to comment Share on other sites More sharing options...
vicvvsh Posted November 27, 2020 Share Posted November 27, 2020 Hi, your id and idt attributes do nothing, you forgot to define them. But it can work even now if you do two things: 1. Change order of inputs on the merge6 node - from CENTER first and from PT_CLOUD second. 2. Past into "create_lines_..." wrangle this code: int count = findattribvalcount(0, "point", "sourcept", @ptnum); if(count > 0) { int pts[] = findattribval(0, "point", "sourcept", @ptnum); foreach(int pt; pts) { int prm = addprim(0, "polyline", @ptnum, pt); } } After these changes it should work 1 Quote Link to comment Share on other sites More sharing options...
logix1390 Posted November 27, 2020 Author Share Posted November 27, 2020 @vicvvshThis is great, thanks a lot. I broke down your code line by line and it makes complete sense now. appreciate the help 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.