## Blender Delaunay triangulate | **Based on points clouds in GN** ----- #### Problematics > When your works on mesh in blender like **"landscape"** or any other mesh need some details you can only apply an triangulate modifier. But sometimes this solution give somes bad result due to this **"Not omogenous density"** > > -You can't control density by location (if you want add more density only for **angle** or for the **corner** or simple control the **density** ) #### Solution >Integrate 2 new nodes **(Based on Blender GN)** in blender for integrate this triangulation. --- #### Benefits >- What technology you want use it ? **C++** >- Whats the benefits of using c++ ? **Fast, some GPL V3 Library open source.** >- **Simple integration** with a lot of code and a lot of modules already written in **C++** ! >- Can be used in the future for **"Fluid Simulation"**, **"Cloth Simulation"**, **"Many other simulation"**, and **High detailly mesh need displace** #### Bad points >- If the solver are not written correctly this process can be render blender extremly slow dut to high density of the points cloud choosen by the user ! --- |Node Name| | :--------: | | **Delaunay distribute points** | | Input socket| Socket type | Function| | :--------: | :--------: | :--------: | | Geometry | Geometry | Recover the mesh (Where you want create the triangulation) for create the points clouds | |Density |Float|Choose the density to distribute| |Density corner |Boolean|Distribute more points on the corner ?| |Omogenous density |Boolean|Using the density for placing the points clouds correctly and create a mediant points placement between all points with a poison disk distance (Better to activate the "density corner" option for having less error) | |Automatic adaptative density |Boolean|Disable "Distribute Points density" and "Density corner" for adjusting automatically the density | | Output socket| Socket type | Function| | :--------: | :--------: | :--------: | | Points clouds | Geometry | Recover the points clouds for adding the "Delaunay triangulate Node" | | Density | Float | Recover the density of the points clouds| | Density corner | Boolean | True = Recover density from the corner / False = don't recover it | ### Intern function for this node |Function Name | Value |Value Type|Position ID|Description| |:---:|:---:|:---:|:---:|:---:| |Distribute Points density |0.500 |Float|1|Choose the density to distribute| |Density corner |False |Boolean|2|Distribute more points on the corner ?| |Omogenous density |False |Boolean|3|Using the density for placing the points clouds correctly and create a mediant points placement between all points with a poison disk distance (Better to activate the "density corner" option for having less error) | |Automatic adaptative density |True |Boolean|4|Disable "Distribute Points density" and "Density corner" for adjusting automatically the density | >Node image > >![Delaunay Distribute points representation Node](https://hackmd.io/_uploads/ry1NnBv9a.png) --- |Node Name| | :--------: | | **Delaunay Triangulate** | | Input socket| Socket type | Function| | :--------: | :--------: | :--------: | | Points clouds | Geometry | Recover the points cloud for resolving all points and create the triangulation for creating the face from the points| | Output socket| Socket type | Function| | :--------: | :--------: | :--------: | | Mesh | Geometry | Recover the generated mesh topologyfied by the delaunay algorythm | ### Intern function for this node |Function Name | Value |Value Type|Position ID|Description| |:---:|:---:|:---:|:---:|:---:| |Compute the triangulation |---|---|Nothing in node|Creating the triangulation from the source mesh with the parameter recover from the "Delaunay distribute points" Node| >Node image > > ![Delaunay triangulate representation Node](https://hackmd.io/_uploads/H1vwaBvq6.png) ---- ## Finally we got this setup for them both new node working together > ![Final nodes](https://hackmd.io/_uploads/B1B80HwcT.png) ---- # Final words ? #### This technology is used majoritary in CAD / CAO Software and are extremly useful for simulating with precision and have more detailed surface (Fluids, smoke, strength, seams, clothing, muscle etc...) Houdini FX use it too --- #### This is an exemple where we are created some faces from wire and wire from points (It's just a solver "Delaunay") > ![Delaunay representation from points clouds](https://d3i71xaburhd42.cloudfront.net/c443f1a567df6fbdad01a396addeb1a5501bed70/1-Figure1-1.png) ---- #### This is an exemple when a mesh was created and triangulated with "Delaunay" algorythm with variable density (It's just a solver "Delaunay" too) > ![Delaunay representation density](https://pbs.twimg.com/media/F2JSfUBWkAIpVqh.jpg) ---- #### This is an exemple of this feature is really useful because isn't only exclsuive to 3D elements ! Photoshop use it too on 2D elements representation for deforming elements using "Control points". With this own tools called "Puppet Warp Tools" So basicaly if you make some 2D animation with Grease pencil and rigging this topology is also a game changer for "Correct" animation. > ![Delaunay photoshop representation density](https://www.pspourphotographes.com/wp-content/uploads/2022/04/deformation-de-la-marionnette1.jpg) ---- ### **WAIT HOLD ON** !! Do you have some links for know what is a delaunay triangulation and where he is used ? > - [What is Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation) >- [GitHub Exemple delaunay traingulation C++](https://github.com/bl4ckb0ne/delaunay-triangulation?tab=GPL-3.0-1-ov-file) >- [PDF : 3D Delaunay triangulation](https://ftp.eenet.ee/pub/cran/web/packages/delaunay/delaunay.pdf) >- [PDF : LIDAR 3D Delaunay triangulation](https://isprs-annals.copernicus.org/articles/X-3-W1-2022/141/2022/isprs-annals-X-3-W1-2022-141-2022.pdf)