I have a csv file that encodes elevation data of a 9000x5000 resolution photo of a dam, and I want to generate an stl file that I can print on my 3d printer. The csv has 3 parameters: X, Y, and Z, where X & Y denote a pixel location on the photo and Z is the elevation of the topography at Pixel (X,Y).
I want a 3D stl file of the photo in question with the nooks, crannies, and hills denoted by the elevation data. I attempted to do this using the Python library numpy-stl, but I'm realizing that I just don't know enough about stl files to accomplish the print job.
Any information on how I can make this file, or on how stl files encode information would be remarkably helpful.
Generate stl mesh from csv
4.6k Views Asked by Robby Gottesman At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in NUMPY
- How can I serialize a numpy array while preserving matrix dimensions?
- store numpy array in mysql
- Trying to save an np array with string and floats, but getting a error
- Does numpy broadcast in *all* of its functions?
- Is there any implementation of hstack in gnumpy
- Mayavi - color vectors based on direction instead of magnitude
- How to install scipy misc package
- Numpy Vs nested dictionaries, which one is more efficient in terms of runtime and memory?
- How to count distance to the previous zero in pandas series?
- Changing the amount of points changes the result of the fft
- Succint way of handling missing observations in numpy.cov?
- Fastest Way to access and put values in matrix
- Enforcing that inputs sum to 1 and are contained in the unit interval in scikit-learn
- Cython speed vs numpy
- Best practice for using common subexpression elimination with lambdify in SymPy
Related Questions in STL-FORMAT
- How to create a binary STL file containing more than one solid?
- SlimDX low performance with many vertices
- creat 3d file importer to three.js viewer
- CSG operation with STLLoader
- Saving a binary STL file in Java
- Android : .STL 3d model (Render, Edit & Save/Update)
- Import STL file in JavaFX
- Stl-Format File Search Engine Not Preforming Searches Correctly
- Alterative to merging geometries in Three.js
- Javascript - HowTo encode a floating point in binary with IEEE 754
- STLloader/THREE.js error: "Uncaught RangeError: offset is outside the bounds of the DataView"
- Converting .stl or .vtk file to JSON
- Importing 3D CAD files in python as dask array
- How to plot a .stl file with matplotlib
- How to save an OpenGL rendering to disk
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
What you have is a collection of vertices. However, what STL encodes is a list of triangles. So what you need to do is to construct triangular mesh connecting your vertices. I assume that you want to code it yourself and I will provide you some hints on how to do it.
First, you should find out, whether your points are structured or not. By structured I mean that the x- and y-coordinates of the points form a regular grid (this is often the case when the data are obtained from airborne scanning).
If the points are structured
If the points are structured, you have a decent chance of constructing the mesh by yourself. Denote P(i,j) the point (X[i],Y[j],Z[i,j]), that is, the point whose first coordinate is the i-th number in the list of the x-coordinates, whose second coordinate is the j-th number in the list of y-coordinates and whose third coordinate is the z-coordinate corresponding to the first two. Figure 1 illustrates.
Now you need to decide the orientation of your triangles. They all should be either positively (counter-clockwise) or negatively oriented (clockwise). Assuming you decide for negative orientation, you can now create the triangle connecting the points P(i,j), P(i+1,j) and P(i+1,j+1). See Figure 2.
In the next step, you can create the neighbouring triangle with the same orientation, say P(i,j), P(i+1,j+1), P(i,j+1). See the darker triangle in Figure 3.
Proceeding the same way for all suitable i's and j's, you can obtain all the necessary triangles.
The only missing part is the normal for each triangle. This you can compute with a cross-product as suggested in this answer.
Now you are ready to write everything to your file. Following the description on Wikipedia, for each triangle you write its normal and the three vertices.
If the points aren't structured
In this situation you don't have much chance of creating your mesh without a significant study of meshing methods (you will probably need to learn about Delaunay triangulations). Fortunately, there are some libraries available. For instance, Fade2.5D is a C++ library that can help you and it is free of charge for personal non-commercial research. Maybe there is something similar available for Python as well.