2#include <igl/per_face_normals.h>
3#include <wmtk/TriMesh.h>
4#include <wmtk/utils/PartitionMesh.h>
5#include <wmtk/utils/VectorUtils.h>
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 <wmtk/envelope/Envelope.hpp>
13#include <wmtk/envelope/BoundaryEnvelope.hpp>
14#include <wmtk/utils/EnableWarnings.hpp>
18#include <Eigen/Geometry>
24namespace wmtk::components::qslim {
36 size_t partition_id = 0;
48 Eigen::Vector3d n = Eigen::Vector3d::Zero();
63 bool m_has_envelope =
false;
73 std::vector<Eigen::Vector3d> _m_vertex_positions,
75 bool use_exact =
true);
99 const std::vector<std::array<size_t, 3>>& tris,
100 const std::vector<size_t>& frozen_verts = std::vector<size_t>(),
102 double boundary_eps = 0);
104 void initiate_quadrics_for_face();
106 void initiate_quadrics_for_vertices();
108 void partition_mesh()
110 auto m_vertex_partition_id = partition_TriMesh(*
this, NUM_THREADS);
111 for (
auto i = 0; i < m_vertex_partition_id.size(); i++)
112 vertex_attrs[i].partition_id = m_vertex_partition_id[i];
116 void partition_mesh_morton();
118 size_t get_partition_id(
const Tuple& loc)
const
120 return vertex_attrs[loc.vid(*
this)].partition_id;
126 bool collapse_qslim(
int target_vertex_count);
127 bool write_triangle_mesh(std::string path);
128 bool invariants(
const std::vector<Tuple>& new_tris)
override;
138 Eigen::Vector3d vbar;
142 bool input_boundary =
false;
146 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& t)
const;
A tube around the open boundary of a triangle mesh, for operations allowed to move it.
Definition BoundaryEnvelope.hpp:43
Definition Envelope.hpp:19
Definition QSlimMesh.h:57
void create_mesh(size_t n_vertices, const std::vector< std::array< size_t, 3 > > &tris, const std::vector< size_t > &frozen_verts=std::vector< size_t >(), double eps=0, double boundary_eps=0)
Definition QSlimMesh.cpp:44
bool collapse_edge_before(const Tuple &t) override
User specified preparations and desideratas for an edge collapse including the link check as collapse...
Definition QSlimMesh.cpp:281
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition QSlimMesh.cpp:240
wmtk::Envelope m_envelope
Definition QSlimMesh.h:62
wmtk::BoundaryEnvelope m_boundary_envelope
Definition QSlimMesh.h:66
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition QSlimMesh.cpp:298
Definition enumerable_thread_specific.hpp:37
Definition AttributeCollection.hpp:46
Definition QSlimMesh.h:52
Definition QSlimMesh.h:46
Definition QSlimMesh.h:135
Definition QSlimMesh.h:27
Definition QSlimMesh.h:34
bool input_boundary
Definition QSlimMesh.h:42