How to associate edges of a triangles in a triangulation with numerical values?

5 visualizaciones (últimos 30 días)
I am trying to associate numerical values with the edges of each triangle of a triangulated mesh (Delaunay Triangulation) and I want to ensure that the sum of the associated values is equal to a fixed number. For Ex- Each triangle in the mesh is composed of two different types of materials (material 1 and material 2) such that there are 2 edges made of material 1 and the other made of material 2. I want to give a numerical value of 1 to material 1 and 0 to material 2, and thus constraint the sum of the edges of each triangle to be = 0+1+1=2.
  2 comentarios
Fifteen12
Fifteen12 el 20 de Sept. de 2023
Can you provide information about how your data is encoded? Are you working with coordinate points?
SABYASACHI DASH
SABYASACHI DASH el 20 de Sept. de 2023
I have co-ordinates representing the vertices of a polygon, and few other co-ordinates representing points inside the polygon. I am using Delaunay's Triangulation to triagulate all the points, and I am extracting the triangle connectivity using DT.ConnectivityList. I also have the indices of the edges of the triangles using DT.edges.

Iniciar sesión para comentar.

Respuestas (1)

Karan Singh
Karan Singh el 31 de En. de 2025
Editada: Karan Singh el 31 de En. de 2025
Hi Sabyasachi,
The points would be required to check if, after the triangulation, the constant sum is possible or not. So, more data would help. I have tried it with a random dataset; however, I was not able to find an example that satisfies the condition. Can you specify if you wish to have a condition to check or something else? Here is one of my attempts:
I have assigned the values at random, but there should also be a condition that checks if this assignment is correct or not.
% Define points (example polygon and inner points)
points = [0 0; 1 0; 2 0; 0 1; 1 1; 2 1; 0 2; 1 2; 2 2];
% Compute Delaunay triangulation
DT = delaunayTriangulation(points);
% Get triangle connectivity list
triangles = DT.ConnectivityList;
% Get edges of the triangulation
edges = edges(DT);
% Initialize edge values (0 for material 2, 1 for material 1)
edgeValues = zeros(size(edges, 1), 1);
% Define a function to check material type (for illustration)
% Assume material 1 for first two edges of each triangle and material 2 for the third
for i = 1:size(triangles, 1)
tri_edges = [triangles(i, [1,2]); triangles(i, [2,3]); triangles(i, [3,1])]; % Triangle edges
% Find index of edges in the edge list
for j = 1:3
edgeIndex = find(ismember(edges, tri_edges(j, :), 'rows') | ismember(edges, flip(tri_edges(j, :)), 'rows'));
if j <= 2
edgeValues(edgeIndex) = 1; % Material 1
else
edgeValues(edgeIndex) = 0; % Material 2
end
end
end
% Display results
disp('Edges and assigned values:');
Edges and assigned values:
disp([edges, edgeValues]);
1 2 1 1 4 0 2 3 1 2 4 0 2 5 0 3 5 1 3 6 1 4 5 1 4 7 0 5 6 0 5 7 1 5 8 1 6 8 1 6 9 1 7 8 0 8 9 0

Categorías

Más información sobre Delaunay Triangulation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by