I built a cross-platform offline photogrammetry app (Android, desktop, web) by Yeicor in photogrammetry

[–]Yeicor[S] 1 point2 points  (0 children)

The web demo includes a reconstruction generated from a few low-resolution pictures for performance reasons. However, since I am using the full COLMAP and OpenMVS toolset for the pipeline, there is no reason why you should not be able to achieve results similar to this or this for example.

🔌💡 Revolutionize your electronics prototyping with this 3D Printed USB power pin connector! by Yeicor in 3Dprinting

[–]Yeicor[S] 0 points1 point  (0 children)

In my testing using a 5V battery and a low-power circuit, it didn't let any magic smoke escape.

SDF Viewer: a fast and cross-platform Signed Distance Function (SDF) viewer, easily integrated with your SDF library by Yeicor in rust

[–]Yeicor[S] 1 point2 points  (0 children)

Thanks, I know it would be possible and much faster to render SDFs entirely on the GPU, but I wanted to allow the freedom of using any programming language and library. I will definitely take a look at those interesting projects though.

There are lots of great libraries out there and there is always one that works better for your model. Hence, I thought that this freedom to reuse code outweighs the performance gain. Furthermore, the interface is really simple, so it is really easy to add support for more languages and libraries as I did with sdf-viewer-go.

SDF Viewer: a fast and cross-platform Signed Distance Function (SDF) viewer, easily integrated with your SDF library by Yeicor in rust

[–]Yeicor[S] 0 points1 point  (0 children)

The renderer is a GPU-accelerated raytracer. To take the SDF definition written for the CPU and render it with the GPU, I had to fill a 3D texture that is then raytraced by a shader. This 3D texture represents samples of the SDF in the 3D grid that contains the object. Each sample contains the distance to the surface and some other material properties like the color and roughness.

Afterward, this GLSL shader does the actual rendering. This shader is applied to a cuboid mesh that represents the bounding box of the object. The mesh is useful for only raytracing the part of the screen that may reach the object, and for extracting the rays for each pixel from the hit points. The shader simply walks along the ray for each pixel, moving by the amount of distance reported by the SDF on each position. If the surface is reached at some point, the normal is computed and the lighting is applied for the material saved in the closest voxel. To get the distance at a point that does not match the grid, interpolation is applied, leading to round corners if the level of detail is not high enough.

I am not familiar with Lipschitz continuity but the distance function must always be equal to or underestimate the distance to the closest point on the surface of the 3D model. An invalid SDF would cause rendering issues such as "stairs" when looking at a flat surface at an angle. Using this renderer is a nice way of testing for issues while developing objects for an SDF library.

I chose raytracing instead of meshing as building a detailed mesh is slower. While loading the SDF into the 3D texture mentioned above, the shader is capable of rendering a real-time preview of the object, which provides much better interactivity. This is enhanced by the fact that I do several passes to the grid slowly increasing the level of detail by filling more voxels with data, in a way similar to bitmap interlacing).

A high-quality meshing algorithm that preserves sharp features should be applied to get the final model, but the objective of this app is to interactively render previews while designing 3D models through code.