DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
tetralizer.h
1 //
2 // Deformabel Simplicial Complex (DSC) method
3 // Copyright (C) 2013 Technical University of Denmark
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // See licence.txt for a copy of the GNU General Public License.
16 
17 #pragma once
18 
19 #include "util.h"
20 #include "geometry.h"
21 
23 {
24  static void tetralize_cube1(int i, int j, int k, int Ni, int Nj, int Nk, std::vector<int>& tets);
25 
26  static void tetralize_cube2(int i, int j, int k, int Ni, int Nj, int Nk, std::vector<int>& tets);
27 
28  static void create_tets(int Ni, int Nj, int Nk, std::vector<int>& tets);
29 
30  static void create_points(const vec3& origin, const vec3& voxel_size, int Ni, int Nj, int Nk, std::vector<vec3>& points);
31 
32  static void tetrahedralize_inside(const std::vector<double>& points_interface, const std::vector<int>& faces_interface, std::vector<double>& points_inside, std::vector<int>& tets_inside);
33 
34  static void tetrahedralize_outside(const std::vector<double>& points_interface, const std::vector<int>& faces_interface, std::vector<double>& points_boundary, std::vector<int>& faces_boundary, std::vector<double>& points_outside, std::vector<int>& tets_outside, const vec3& inside_pts);
35 
36  static void merge_inside_outside(const std::vector<double>& points_interface, const std::vector<int>& faces_interface, std::vector<double>& points_inside, std::vector<int>& tets_inside, std::vector<double>& points_outside, std::vector<int>& tets_outside, std::vector<double>& output_points, std::vector<int>& output_tets, std::vector<int>& output_tet_flags);
37 
38 public:
39 
40  static void build_boundary_mesh(std::vector<double>& points_boundary, double avg_edge_length, std::vector<int>& faces_boundary, const vec3& min, const vec3& max);
41 
42  static void tetralize(double padding, double avg_edge_length, const std::vector<vec3>& points_interface, const std::vector<int>& faces_interface, std::vector<vec3>& points, std::vector<int>& tets, std::vector<int>& tet_labels);
43 
44  static void tetralize(const vec3& origin, const vec3& voxel_size, int Ni, int Nj, int Nk, const std::vector<int>& voxel_labels, std::vector<vec3>& points, std::vector<int>& tets, std::vector<int>& tet_labels);
45 
46  static void tetralize(const vec3& origin, const vec3& size, double avg_edge_length, std::vector<unsigned int>& labels, std::vector<std::shared_ptr<is_mesh::Geometry>>& geometries, std::vector<vec3>& points, std::vector<int>& tets, std::vector<int>& tet_labels);
47 };
A 3D double vector.
Definition: Vec3d.h:26
Definition: tetralizer.h:22