Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [V1, V2] = mesh_boundaries(V, F)
- VV = zeros(size(V, 1));
- for i = 1 : size(F, 1)
- a = F(i, 1);
- b = F(i, 2);
- c = F(i, 3);
- if a > b
- VV(b, a) = VV(b, a) + 1;
- else
- VV(a, b) = VV(a, b) + 1;
- end
- if a > c
- VV(c, a) = VV(c, a) + 1;
- else
- VV(a, c) = VV(a, c) + 1;
- end
- if c > b
- VV(b, c) = VV(b, c) + 1;
- else
- VV(c, b) = VV(c, b) + 1;
- end
- end
- trisurf(F, V(:, 1), V(:, 2), V(:, 3));
- for i = 1 : size(VV, 1)
- for j = 1 : size(VV, 2)
- if VV(i, j) == 1
- hold on;
- plot3([V(i, 1); V(j, 1)], [V(i, 2); V(j, 2)], [V(i, 3); V(j, 3)], 'r');
- end
- end
- end
- hold off;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement