2#include <wmtk/utils/PartitionMesh.h>
3#include <wmtk/utils/VectorUtils.h>
4#include <wmtk/AttributeCollection.hpp>
7#include <wmtk/utils/DisableWarnings.hpp>
8#include <igl/write_triangle_mesh.h>
9#include <wmtk/threading/enumerable_thread_specific.hpp>
10#include <fastenvelope/FastEnvelope.h>
11#include <wmtk/utils/EnableWarnings.hpp>
15#include <Eigen/Geometry>
21#include <wmtk/envelope/Envelope.hpp>
23namespace wmtk::components::shortest_edge_collapse {
28 size_t partition_id = 0;
36 bool m_has_envelope =
false;
41 std::vector<Eigen::Vector3d> _m_vertex_positions,
43 bool use_exact_envelope =
true);
45 void freeze_boundary();
49 const std::vector<std::array<size_t, 3>>& tris,
50 const std::vector<size_t>& frozen_verts = {},
55 void partition_mesh();
57 size_t get_partition_id(
const Tuple& loc)
const
59 return vertex_attrs[loc.vid(*
this)].partition_id;
62 void write_vtu(
const std::string& path);
67 bool collapse_shortest(
int target_vertex_count);
68 bool write_triangle_mesh(std::string path);
69 bool invariants(
const std::vector<Tuple>& new_tris)
override;
77 bool v1_frozen =
false;
78 bool v2_frozen =
false;
82 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& t)
const;
Definition Envelope.hpp:52
Definition ShortestEdgeCollapse.h:33
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition ShortestEdgeCollapse.cpp:75
bool collapse_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge collapse including the link check as collapse...
Definition ShortestEdgeCollapse.cpp:140
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition ShortestEdgeCollapse.cpp:177
Definition enumerable_thread_specific.hpp:26
Definition AttributeCollection.hpp:36
Definition ShortestEdgeCollapse.h:73
Definition ShortestEdgeCollapse.h:26