This code is a reproduction of the paper "Poisson-Based Continuous Surface Generation for Goal-Based Caustics" by Yue et al. 2014.
Dependecies:
The code is provided in the file 'c.py'. The user needs to provide the location of an input image file, of size exactly 512x512, in either jpg or gif format. This can be done by directly updating the img_location parameter in the c.py file. The various functions in the code have been explained in Appendix A of the report already sent. Once it starts running, it will write status updates to the command line, but will not require any new inputs. Upon completion, the user will see a support folder which create various files, listed below:
h_{i}.txt: This is the height profile calculated at the i-th iteration. Its an array of 512x512 and gives the height of the surface at each point, in mm.
areas_dst.txt: This file gives the areas around each point on the target screen. Its a single array containing 512*512 entries.
D_{i}.txt: This files contains the difference matrix calculated at the i-th iteration. Its an array of size 512x512.
delT.txt: This file gives the values of delT calculated during computation.
div_{i}.txt: This file gives the divergence of the normals used during surface computation. Its an array of size 512x512.
iter_{i}.jpg: This file shows the mesh at each iteration. Its a picture file. Note: Pictures will appear rotated by 90 deg. This is due to how numpy handles rewrapping arrays in different sizes.
phi_{i}.txt: This if the pressure field phi at each iteration. Its an array of 512x512.
source_{i}.txt: This file contains the location of mesh points as a single array of length 512*512.
Other miscellaneous files generated by KeyShot during rendering.
After the support files are generated, the user can use the create_surface.py script to generate an stl object of the 3d surface. The script requires the open3d library to be installed which can be done with
pip(or pip3) install open3d
This file uses the h_15.txt and source_13.txt files from the support folder to generate bpa_mesh.stl object file which can then be imported in various 3d graphics renderers to render the surface.
The directory also contains a samples folder which includes 6 examples for which the script has already been run and surfaces have been rendered.
Lastly, my futile attempts to implement the galerkin method are captured in the file gallerkin.py. It requires a difference matrix to work which can be provided directly in the code. It also requires the scikits.umfpack in order to solve the system of linear equations. It outputs three files: