3#include <wmtk/utils/PartitionMesh.h>
4#include <wmtk/utils/VectorUtils.h>
5#include <wmtk/envelope/Envelope.hpp>
6#include "wmtk/AttributeCollection.hpp"
9#include <wmtk/utils/DisableWarnings.hpp>
10#include <igl/write_triangle_mesh.h>
11#include <wmtk/threading/enumerable_thread_specific.hpp>
12#include <fastenvelope/FastEnvelope.h>
13#include <wmtk/utils/EnableWarnings.hpp>
17#include <Eigen/Geometry>
22namespace wmtk::components::isotropic_remeshing {
36 bool m_has_envelope =
false;
43 std::vector<Eigen::Vector3d> _m_vertex_positions,
45 bool use_exact =
true);
51 const std::vector<std::array<size_t, 3>>& tris,
52 const std::vector<size_t>& frozen_verts = std::vector<size_t>(),
64 void cache_edge_positions(
const Tuple& t);
66 bool invariants(
const std::vector<Tuple>& new_tris)
override;
69 void partition_mesh();
72 void partition_mesh_morton();
74 size_t get_partition_id(
const Tuple& loc)
const
76 return vertex_attrs[loc.vid(*
this)].partition_id;
79 bool smooth_all_vertices();
81 Eigen::Vector3d smooth(
const Tuple& t);
84 Eigen::Vector3d tangential_smooth(
const Tuple& t);
92 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& tris)
const;
93 std::vector<TriMesh::Tuple> new_edges_after_swap(
const TriMesh::Tuple& t)
const;
94 std::vector<TriMesh::Tuple> replace_edges_after_split(
95 const std::vector<TriMesh::Tuple>& tris,
96 const size_t vid_threshold)
const;
97 std::vector<TriMesh::Tuple> new_sub_edges_after_split(
98 const std::vector<TriMesh::Tuple>& tris)
const;
107 double compute_edge_cost_collapse(
const TriMesh::Tuple& t,
double L)
const;
108 double compute_edge_cost_split(
const TriMesh::Tuple& t,
double L)
const;
122 bool split_remeshing(
double L);
123 bool collapse_remeshing(
double L);
124 bool swap_remeshing();
125 bool uniform_remeshing(
double L,
int interations);
126 bool write_triangle_mesh(std::string path);
Definition Envelope.hpp:52
Definition IsotropicRemeshing.h:33
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition IsotropicRemeshing.cpp:210
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition IsotropicRemeshing.cpp:92
bool split_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge split.
Definition IsotropicRemeshing.cpp:220
bool collapse_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge collapse including the link check as collapse...
Definition IsotropicRemeshing.cpp:200
bool swap_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge swap including 1.can't swap on boundary edge....
Definition IsotropicRemeshing.cpp:149
std::vector< double > average_len_valen()
Report statistics.
Definition IsotropicRemeshing.cpp:313
bool smooth_after(const Tuple &t) override
User specified modifications and desideras after an edge smooth.
Definition IsotropicRemeshing.cpp:243
bool smooth_before(const Tuple &t) override
User specified preparations and desideratas for an edge smooth.
Definition IsotropicRemeshing.cpp:237
bool swap_edge_after(const Tuple &t) override
User specified modifications and desideras after an edge swap.
Definition IsotropicRemeshing.cpp:158
bool split_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge split.
Definition IsotropicRemeshing.cpp:228
Definition enumerable_thread_specific.hpp:26
Definition IsotropicRemeshing.h:57
Definition IsotropicRemeshing.h:25