Since my last post I have ended in somewhat of a rabbit hole. A good one at that. My original intentions and goals were performance and feature oriented. The past few months I have been taking a more foundational approach to implicit solid modeling in Julia, with a focus on meshing.
As part of my master’s capstone project I worked on faster meshing of both triangular surfaces, and tetrahedral solids. These are updates to Meshing.jl and the new DistMesh.jl. I will give a brief overview of DistMesh here, and will go into further discussion in a later blog post.
DistMesh.jl
DistMesh was first described by Per-Olof Persson in his thesis at MIT. It is a mechanism for using the underlying signed distance function to generate high quality tetrahedral meshes. High quality in this sense means the solid-filling tetrahedra are as close to regular as possible. This provides good integration characteristics in Finite Element Analysis. Originally I was trying to using Tetgen to generate a tetrahedralization of a mesh from Meshing, but this was far too slow since a mesh from isosurface extraction generates too many triangles (100k-1M, in my case) to run efficiently on a consumer PC. DistMesh.jl is still in development, and there a few more experiments and improvements I want to make before discussing more. However it uses Tetgen for Delaunay triangulation and runs the refinements in Julia. I leave you with a few nice histograms showing the qualities:
Meshing.jl
Prior to mid-summer my general thinking for meshing was focused on accuracy for 3D Printing (Dual Contours), and adaptivity. These are both still goals, and I have made some proof-of-concepts for each. However, I decided to focus on some low-hanging fruit in the uniform sampling approaches. In particular I made some API improvements to allow for direct function sampling. Some of this is discussed on the Julia Discourse. This approach is much more memory efficient and for simple geometries the performance is quite good. There is also nice scaling with thread counts. I suspect the performance cross-over to be quite high because Julia is able to generate good SIMD vectorized code.
Descartes.jl
There are now some basic docs! The only thing written up so far is a basic pipeline. I still need to add docstrings for the primitives and operations.
I also add support for 2D and extrusion. An example is here.
Future
There is still a lot to do on each project, but each seems to be maturing at a good clip. In January I will be starting to research topology optimization at Stony Brook and take classes. This is likely to consume a lot of my time. I am trying to focus on a few objectives over the break:
- Shake the bugs out of Meshing and get a multithreaded API ready.
- Prepare an initial release of DistMesh
- Make a DescartesLive.jl library with some sort of reload-preview workflow like OpenSCAD.