Comments (7)
Ok. Then it may be a bug. I will investigate it and let you know.
I'll keep the issue open as a personal reminder :)
from cinolib.
Hi @Mengesh, thanks for appreciating the project!
In the example you mention the dual mesh also contains clipped (boundary) cells. Are the problems you are mentioning involving boundary faces of those clipped elements?
This is the only issue that comes to my mind, because that primal mesh is Delaunay, hence its dual should be a plain Voronoi diagram with all planar faces
from cinolib.
Unfortunately no.
from cinolib.
I've had some time to investigate this issue. It seems that the reason why dual faces are not planar is because in the dualization code I take the centroid of each primal element, whereas to reproduce the Voronoi diagram starting from a Delaunay mesh I should take the center of the sphere passing through the four vertices of the tetrahedron (i.e. its circumcenter).
Note that dual_mesh
is more general, and it's not meant to be a tool to pass from Voronoi to Dealunay, or vice-versa. As such, it does not make any assumption on the primal mesh, which is not required to be a Delaunay mesh. Not even to be a tetmesh, actually.
For your specific case, to obtain the desired result I suggest you first make a dual mesh as usual, and then update the vertices of the each dual vertex with the circumcenter of the primal element they correspond to. The first NP vertices in the dual mesh are in 1:1 relation with the polyhedra in the prima mesh. I have created a new function, called tetrahedron_circumcenter
, which you can find inside <cinolib/geometry/tetrahedron_utils.h>
. You can use it to compute the circumcenter.
from cinolib.
Thank you very much! I did it like this
for (int i=0; i<m_tet.num_polys(); ++i)
{
std::vector<vec3d> tetraverts = m_tet.poly_verts(i);
m_poly.vert(i) = tetrahedron_circumcenter(tetraverts.at(0),
tetraverts.at(1),
tetraverts.at(2),
tetraverts.at(3));
};
and it seems to work for non-boundary edges. However, the results for boundary edges are wild :) The faces are not only non-planar, but sometimes also scattered, as you can see on the image below. The arrows are there just so I can check if face normal and edge are parallel.
I guess this happens because of the clipping mechanism. Do you have any suggestion how to fix this?
from cinolib.
Correct, this is due to clipped cells, for which there are no guarantees that the dual faces will be planar.
For the scattering, I am not sure I understand what you are doing/mean, but if you are restricting your processing to non clipped cells only, there may certainly be gaps (e.g. when two opposite clipped cells are adjacent to one another).
To my knowledge and understanding, the only meshing algorithm that will give you what you are looking for is VoroCrust. They have had a simple yet great idea: rather than clipping cells, they carefully position Voronoi seeds so that the cells will conform to the target geometry. In this case there will be no clipped cells at all. This ensures that the mesh natively meets the orthogonality condition, which is important in CFD. Is this your field?
from cinolib.
Yes, partially.
I actually found about VoroCrust before cinolib, but I was unable to get in touch with Mohamed Ebeida. I see their website went through some serious update, so I'll try to contact them again. Thank you for the reminder 🙂
from cinolib.
Related Issues (20)
- Undefined reference to `orient2d' / `orient3d' HOT 1
- how to use the hex_transition_install function? HOT 1
- transform and bake_rotation_matrix undefined in hex_transition_orient.cpp HOT 1
- Is it possible to offset a mesh preserving its sharp edges? HOT 6
- How to generate a cinolib? HOT 2
- Cut a volume mesh based on embedded level set HOT 15
- no member named 'update_hex_quality' HOT 3
- OpenGL rendering: soft shadows HOT 3
- How to use remesh_Botsch_Kobbelt_2004 without gl HOT 3
- Orient a closed surface mesh HOT 4
- Custom data in Tetmesh HOT 1
- All-hexahedral meshing? HOT 1
- Shadow casting question HOT 5
- Embed a polyline into a mesh HOT 4
- error when run sliced_CLI_loader HOT 1
- CMD + click ,What button is cmd in surface_painter project HOT 1
- Link errors HOT 1
- information HOT 8
- Imgui control hidden HOT 2
- How to implement algorithms such as QEM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cinolib.