Seperate each scan line from pointcloud data - point-clouds

I have many frames of pointcloud data and would like to separate each scan line to do further processing on it. Any fast ways to get each scan lines from the pointcloud data.

Related

Rotate a block in DXF file format

I am creating a DXF file using XSLT to transform my raw data.
I can create a working DXF file with a block and insert it into my drawing.
The issue is I want to create one block that is used many times but is translated and rotated each time it is inserted. Looking up the reference document for DXF, the INSERT group only contains ‘50’ (which is rotation group code). I need to rotate the block upon each insertion around it’s X and Y axis. (OCS, not WCS).
I cannot see a way to do this, but the concept of blocks is to be referenced multiple times in many different orientations, so I find it hard to believe there is not a way to do this.
A long work around is to create a block for each transform but this defeats the purpose and involves me calculating each coordinate, not to mention dramatically increases the file size.
There is also the extrusion group code (210,220,230) but I cannot figure out if I could achieve what I want using this, as these work around the WCS.

Rendering large STL files in threejs

I have this stl model that has >3 million vertices and have to render it on screen. Right now, loading the model using a Threejs STL loader crashes the browser. Based on some research, I'm considering doing some of the following:
Stream the STL file to the client and have the STL loader load the model in 1mb chunks
Every time a chunk gets loaded, I can create a buffer geometry and construct a mesh from it. I can do this for every chunk and add all the meshes to the scene. Thus the scene will have multiple meshes in it, but look like it's the original model.
I have a pretty good idea of how to do step 2, but is the first part possible? Can a three.js STL loader load an STL in chunks (assuming it's being delivered to the client in chunks) as I've described?
The Three.js STL loader won't do that for you (it will always load the whole file and then parse).
You'd have to load and parse the file in chunks yourself. It is a pretty straightforward file format (https://en.wikipedia.org/wiki/STL_(file_format) ), you'd have to handle the case where a STL triangle structure spans chunks, however.
Another option, if it makes sense for your application, is to read and preprocess the file into a format that can be read in chunks in the browser.

Generating a multipoint topojson file

I am trying to create a map layer using D3 and leaflet for displaying a large number of unique GPS data points. I created it using geoJSON and Leaflet but the performance was poor. I finally got Topojson installed and working, but I cannot get it to produce a Multipoint geometry, only Point geometry which does not shrink the file much. I have passed in a CSV with all the points and used to geoJson file but only get 70,000 point geometries instead of one Multipoint. What am I missing? Do I need to write the Topojson myself? Want to avoid this if possible.
TopoJSON won't help you in this case. To quote the website:
Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs.
As you have no line segments, there's no point in using TopoJSON -- it won't reduce the size of the file.
+1 What Lars said. Your best bet is probably to load the point data as a CSV using d3.csv()instead of a GeoJSON or TopoJSON, as it is much more compact. You can then loop over the data, adding each point to a layer group.
That said, 70,000 is a lot and your map is still probably going to be very slow. You might want to think about using something like PostGIS (or CartoDB for that matter) and request only those points that are visible in a given map state.

Transition a chart dependent on another chart

I am new to d3.js but have managed to make two individual charts as in introduction.
I have a map chart, which has dots representing monitoring stations.
I also have a line chart which has multiple timeseries (data from json) from one monitoring station.
What I would like to do. Have the two charts on one page. When you mouseover or click on a station on the map the data is loaded and displayed on the line chart. When a new station is selected on the map, the data transitions on the line chart
The question I have is one of style. With the two separate charts what is the best way to combine them?
With the transition, I have searched but have not found any simple examples that has two charting elements where interacting with one effects the other. Should I combine all the timeseries data into one json file (say 4 timeseries times 50 stations) or have 50 json files?
Thanks
Unless your timeseries data is very large, I would just put everything in one JSON file to make things simpler and so that changing stations can take place entirely client side.

"Live" graph d3.js with simulated data

I have created a simple line graph with data from a mySQL database using PHP to return the data in JSON format.
https://gist.github.com/5fc4cd5f41a6ddf2df23
I would like to simulate "live" updating something similar to this example, but less complicated:
http://bl.ocks.org/2657838
I've been searching for examples on how to achieve this simply as new to D3 - to no avail.
I've looked at Mike Bostock's http://bost.ocks.org/mike/path/ path transitions, but not sure how to implement this using json data.
Can anyone help with either an example or some direction on how I could accomplish this?
Doing that kind of line transformations is tricky in SVG because moving large number of points just a little and rerendering the complete line can hurt performance.
For the case when interactivity with each data point is not paramount and the time series can grow to contain arbitrary number of points, consider using Cubism. It is a library based on d3 but meant specially for visualizing time-series data efficiently. To prevent rerendings of SVG, it draws the points on a canvas, allowing for cheap pixel by pixel transitions as new data arrives.

Resources