-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Small triangles in mesh generated #259
Comments
@Girishchandra-Yendargaye, you are right that it is important to try to create meshes without unnecessarily small triangles. We use the triangle package http://www.cs.cmu.edu/~quake/triangle.html to create meshes via the The mesh is setup by defining a boundary polygon, breaklines and interior regions. If the segments of these polygons and polylines are too small, or if vertices from one polygon or polyline is too close to another then the resulting triangulation will include very small triangles. The Triangle procedure will maintain the vertices in these defining structures. The best strategy is to identify the location of the smallest triangles and try to change the defining polygons or polylines in those locations to avoid the creation of the small triangles. Typical situations are when the boundary polygon are created manually, two vertices may be created very close, indeed so close that the two vertices cannot be visually separated. When working with building polygons, created via some third party process, often there are extra very close vertices created. So it is worth investigating your polygon definitions to ensure no small segments. Another problem, often with building polygons, is when the vertex of one building polygon is very close to another building vertex. So it is sensible to test the minimum distance between any pair of vertices that define the geometry of the mesh to avoid as much as possible the subsequent creation of small triangles. Another subtle situation is when the vertex v1 of one structure is very close to the segment [v2, v3] of a structure. This involves a more expensive test, of distance between a line segment and a point. Counter intuitively, this problem can often be resolved by breaking the segment, with a new vertex so [v2, v3] becomes [v2, v4], [v4, v3] and replacing the old vertex v1 with the new vertex v4. Creating a good mesh is probably one of the most time consuming components of the setup of an anuga model. |
@stoiver Thank you for your quick reply..Ok we will try to identify the location of smallest triangles and test the minimum distance between any pair of vertices...Is there any api for finding such triangles. |
@Girishchandra-Yendargaye at least you should check out some of the basic statistics of the domain using
If you use
This produces
So we can see via either the plot or the statistics that there are some very small triangles. Then that should lead you to look at the boundary polygon points for strange positioning. With breaklines and riverwalls we do have a procedure to try to pin down problems. The procedure is |
@stoiver Yes we are already doing this but for 20 million of triangle we are trying to find exact location of such triangles...ok we will try once again this way if no other option |
@Girishchandra-Yendargaye probably should have asked earlier, how do you create your domain? Via create_domain_from_regions? domain.areas Points to the triangle areas. domain centroid_coordinates the centroids of the triangles. They are numpy arrays and so you can argsort to find the smallest areas and then find the corresponding location via the coordinates. |
@stoiver we call create_domain_from_file for generating domain from Mesh. |
@Girishchandra-Yendargaye, how do you create the mesh file in the first place? |
@stoiver We use .. anuga.create_mesh_from_regions(bounding_polygon, |
First In the call to Typical problems are very small segments in the individual definitions of the The procedure |
Can we remove small triangles generated.
The text was updated successfully, but these errors were encountered: