Hello! Am new to Houdini and attempting to learn VEX.
I simply wanted to ask why the geometry spreadsheet isn't showing the nearpoints array for each of my point? Is there somewhere I have to go to toggle on the display? Thanks for any answer in advance.
Geometry Spreadsheet doesn't display Array
1583 2 1- chienhuey
- Member
- 11 posts
- Joined: June 2020
- Offline
- chienhuey
- Member
- 11 posts
- Joined: June 2020
- Offline
This is another question I have regarding what is written in the pointwrangle parameter box here:
float searchrad = ch('searchrad');
int nearpnts = nearpoints (0, @P, searchrad);
foreach (int pnt; nearpnts){
int line = addprim (0, "polyline");
addvertex (0, line, @ptnum);
addvertex (0, line, pnt);
}
I've also attached an image of the scene view.
I'm quite confused about the difference between @ptnum and pnt. If my guess is correct, does it mean something like this?
pnt1 returns a nearpoint array of 2, 3, 4, 5, which are all considered @ptnum.
So first "addvertex" line means that vertices are added to each @ptnum, aka points numbered 2, 3, 4, and 5.
Whereas the second "addvertex" line adds a single vertex to pnt1.
This is merely my guess but please correct me if I have misunderstood anything.
Thank you in advance to anyone who might answer my question.
float searchrad = ch('searchrad');
int nearpnts = nearpoints (0, @P, searchrad);
foreach (int pnt; nearpnts){
int line = addprim (0, "polyline");
addvertex (0, line, @ptnum);
addvertex (0, line, pnt);
}
I've also attached an image of the scene view.
I'm quite confused about the difference between @ptnum and pnt. If my guess is correct, does it mean something like this?
pnt1 returns a nearpoint array of 2, 3, 4, 5, which are all considered @ptnum.
So first "addvertex" line means that vertices are added to each @ptnum, aka points numbered 2, 3, 4, and 5.
Whereas the second "addvertex" line adds a single vertex to pnt1.
This is merely my guess but please correct me if I have misunderstood anything.
Thank you in advance to anyone who might answer my question.
Edited by chienhuey - March 2, 2022 14:28:07
- cwhite
- Staff
- 748 posts
- Joined: Oct. 2012
- Offline
`nearpnts` is just a variable, same as `searchrad`. If you want to write it out to an attribute, then you could use something like `i@myattrib = nearpnts`.
The entire snippet is executed for each point in the original geometry - @ptnum gives you the index of that point
So for every point, it's creating a line to each nearby point within the search radius
The entire snippet is executed for each point in the original geometry - @ptnum gives you the index of that point
So for every point, it's creating a line to each nearby point within the search radius
-
- Quick Links