You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a class mesh, which (pre-)allocates it's own memory for storing up to n vertices. I cannot modify this class.
Can I instruct TinyPly to use the preallocate memory instead of it allocating its own memory and having to copy the vertices?
The text was updated successfully, but these errors were encountered:
Can you explain you use-case a little bit more? It's the first time someone has requested this feature so I'm curious to know more. It's challenging namely because it's unclear (as an application developer) how much memory you need to preallocate and then what happens if the library needs to allocate more. Lots of things to consider :)
The use case is pretty simple: Avoid unnecessary allocations and copies for big sets of data.
The storage size for per-element properties can be calculated pretty easily, thus preallocation can occur after the header was parsed. For lists, I agree, that's a real pain in the back, requiring you to iterate through each row and reading the element count.
I'm also interested in this feature. I'm using tinply as a loader in a python library which returns NumPy arrays. I'm often using this loader for massive meshes which take up a lot of memory. I would like to have tinyply load directly into the buffer allocated for the NumPy array rather than make a copy.
Hey there!
Given a class
mesh
, which (pre-)allocates it's own memory for storing up ton
vertices. I cannot modify this class.Can I instruct TinyPly to use the preallocate memory instead of it allocating its own memory and having to copy the vertices?
The text was updated successfully, but these errors were encountered: