Efficient way to get the number of points/prims in Python?
708
3
0
-
- raincole
- Member

- 692 posts
- Joined: Aug. 2019
- Offline
I know we can do this:
point_count = len(geo.points())
prim_count = len(geo.prims())
However, this approach will actually create a python array. If there are a lot of points, it will create a huge, huge array.
How to get the number of points/prims without creating arrays?
-
- vikus
- Member

- 247 posts
- Joined: May 2017
- Offline
I remember there was a topic on this:
g = n.geometry()
g.intrinsicValue('pointcount')
-
- raincole
- Member

- 692 posts
- Joined: Aug. 2019
- Offline
vikus
I remember there was a topic on this:
g = n.geometry()
g.intrinsicValue('pointcount')
Ah, thanks!
(For completeness, there are intrinsic values for vertex and primitive count as well:

)
Edited by raincole - March 7, 2025 05:38:28
Attachments:
Screenshot 2025-03-07 183804.jpg (38.8 KB)
-
- vikus
- Member

- 247 posts
- Joined: May 2017
- Offline