Comments (2)
This is a good suggestion, I'll try to add a column to lib comparison once I verify the callback support.
That being said, I am curious about your use case - I assume that you have some process that generates a lot of points and you wish to store them as .ply files? I had a bunch of ideas about changing msh_ply, so understanding this usecase better would be very useful. For example, do you know the number of point ahead of time or not?
Given that .ply is straight forward format (text header + binary or text data blob), you could set your writing like this?
Note that this is just pseudocode.
FILE* fp = fopen(filename, "wb")
ply_header_t header = setup_header_from_descriptors(descriptors, descriptor_count);
write_header(fp, &header)
while(true)
{
vertex_t v = generate_vertex(...);
write_vertex(fp, v);
if (done_generating_vertices(...))
{
break;
}
}
fclose(fp);
from ply_io_benchmark.
I assume that you have some process that generates a lot of points and you wish to store them as .ply files?
Yes. The thing producing the points does so in batches. So far I've just hand-coded an ASCII writer - so it looks something like this (pseudocode-ish):
writePLYHeader();
data->setPointProcessingFunc( [&]( const std::vector<PointRecord> &inList ) {
for ( const auto &cPoint : inList )
{
if ( filterPoint( cPoint ) )
{
continue;
}
// write parts of cPoint we are interested in to PLY file
}
} );
data->process(); // processes all data, calling point processing func for each batch
Where PointRecord
is a struct with x, y, z, r, g, b, and some other data about a point.
It works fine (it's essentially what you have outlined in pseudocode - just with a callback), but I'd like a binary option and I also need to add the reading side, so I thought I'd look for a battle-tested, simple library to hook in here.
With a PLY library using a callback system, I think I can just connect the callback system above to it and avoid using extra storage or having to do extra processing.
do you know the number of point ahead of time or not?
I do not because of the filtering being done.
from ply_io_benchmark.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ply_io_benchmark.