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 <tbb/concurrent_priority_queue.h>
12#include <tbb/concurrent_vector.h>
13#include <tbb/enumerable_thread_specific.h>
14#include <tbb/parallel_for.h>
15#include <tbb/parallel_sort.h>
16#include <fastenvelope/FastEnvelope.h>
17#include <wmtk/utils/EnableWarnings.hpp>
21#include <Eigen/Geometry>
26namespace wmtk::components::isotropic_remeshing {
40 bool m_has_envelope =
false;
47 std::vector<Eigen::Vector3d> _m_vertex_positions,
49 bool use_exact =
true);
55 const std::vector<std::array<size_t, 3>>& tris,
56 const std::vector<size_t>& frozen_verts = std::vector<size_t>(),
66 tbb::enumerable_thread_specific<PositionInfoCache> position_cache;
68 void cache_edge_positions(
const Tuple& t);
70 bool invariants(
const std::vector<Tuple>& new_tris)
override;
73 void partition_mesh();
76 void partition_mesh_morton();
78 size_t get_partition_id(
const Tuple& loc)
const
80 return vertex_attrs[loc.vid(*
this)].partition_id;
83 bool smooth_all_vertices();
85 Eigen::Vector3d smooth(
const Tuple& t);
88 Eigen::Vector3d tangential_smooth(
const Tuple& t);
96 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& tris)
const;
97 std::vector<TriMesh::Tuple> new_edges_after_swap(
const TriMesh::Tuple& t)
const;
98 std::vector<TriMesh::Tuple> replace_edges_after_split(
99 const std::vector<TriMesh::Tuple>& tris,
100 const size_t vid_threshold)
const;
101 std::vector<TriMesh::Tuple> new_sub_edges_after_split(
102 const std::vector<TriMesh::Tuple>& tris)
const;
111 double compute_edge_cost_collapse(
const TriMesh::Tuple& t,
double L)
const;
112 double compute_edge_cost_split(
const TriMesh::Tuple& t,
double L)
const;
126 bool split_remeshing(
double L);
127 bool collapse_remeshing(
double L);
128 bool swap_remeshing();
129 bool uniform_remeshing(
double L,
int interations);
130 bool write_triangle_mesh(std::string path);
Definition Envelope.hpp:56
Definition IsotropicRemeshing.h:37
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition IsotropicRemeshing.cpp:286
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition IsotropicRemeshing.cpp:88
bool split_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge split.
Definition IsotropicRemeshing.cpp:296
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:276
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:225
std::vector< double > average_len_valen()
Report statistics.
Definition IsotropicRemeshing.cpp:385
bool smooth_after(const Tuple &t) override
User specified modifications and desideras after an edge smooth.
Definition IsotropicRemeshing.cpp:319
bool smooth_before(const Tuple &t) override
User specified preparations and desideratas for an edge smooth.
Definition IsotropicRemeshing.cpp:313
bool swap_edge_after(const Tuple &t) override
User specified modifications and desideras after an edge swap.
Definition IsotropicRemeshing.cpp:234
bool split_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge split.
Definition IsotropicRemeshing.cpp:304
Definition IsotropicRemeshing.h:61
Definition IsotropicRemeshing.h:29