Faces given as triangles (3, m) of vertex numbers (1-based); the edges are their sides (each once).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Polyhedron), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | vertices(:,:) |
(3, n), frame coordinates |
||
| integer, | intent(in) | :: | triangles(:,:) |
(3, m) |
subroutine set_triangles(self, vertices, triangles) class(Polyhedron), intent(inout) :: self real(wp), intent(in) :: vertices(:,:) !! (3, n), frame coordinates integer, intent(in) :: triangles(:,:) !! (3, m) self%v = vertices self%tri = triangles self%edge = unique_edges(reshape([triangles(1:2, :), triangles(2:3, :), triangles(3:1:-2, :)], & [2, 3 * size(triangles, 2)]), size(vertices, 2)) call drop_colors(self) call make_polyhedron(self) end subroutine set_triangles