get all points from Wrangle (detail)
10401 7 2- Thunderbeast
- Member
- 50 posts
- Joined: Nov. 2016
- Offline
- Nima
- Member
- 471 posts
- Joined: Nov. 2013
- Offline
- Thunderbeast
- Member
- 50 posts
- Joined: Nov. 2016
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
Do want to store all point positions into an array?
int npt = npoints(0);
vector all_pos[];
resize(all_pos, npt);
for(int i = 0; i < npt; i++) {
all_pos[i] = point(0, "P", i);
}
//v@test = all_pos[45];
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Nima
- Member
- 471 posts
- Joined: Nov. 2013
- Offline
Thunderbeast
Isn't @numpt similar to int npoints? I need an array rather then the number of points so I can manipulate that data later.
Yes, it is similar to int npoints but you use a variable instead of calling a function.
npoints should use whenever you want number of points from the other inputs of wrangle node (second, third an so on).
- Thunderbeast
- Member
- 50 posts
- Joined: Nov. 2016
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Offline
There is a difference between point numbers (can change) and point IDs (stay).
If you want to store point numbers, just use a pointwrangle with
before you setup a detailwrangle.
If you want to store point numbers, just use a pointwrangle with
i@id = @ptnum;
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Thunderbeast
- Member
- 50 posts
- Joined: Nov. 2016
- Offline
Just to clarify (my noobness) you're calling point ID's the attribute numbers and point numbers the first column in the geometry spreadsheet. In that case both will have the same value unless there is node before the detail wrangle that changes the numbers.
Alsois the almost the same as what i meant to say. Adding an attribute create node set to points with value @ptnum. Sorry for not properly explaining how I add the attribute.
Also
i@id = @ptnum;
-
- Quick Links