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/utils/EnableWarnings.hpp>
17#include <Eigen/Geometry>
23namespace wmtk::components::qslim {
35 size_t partition_id = 0;
43 Eigen::Vector3d n = Eigen::Vector3d::Zero();
56 bool m_has_envelope =
false;
62 QSlimMesh(std::vector<Eigen::Vector3d> _m_vertex_positions,
int num_threads = 1);
69 const std::vector<std::array<size_t, 3>>& tris,
70 const std::vector<size_t>& frozen_verts = std::vector<size_t>(),
73 void initiate_quadrics_for_face();
75 void initiate_quadrics_for_vertices();
79 auto m_vertex_partition_id = partition_TriMesh(*
this, NUM_THREADS);
80 for (
auto i = 0; i < m_vertex_partition_id.size(); i++)
81 vertex_attrs[i].partition_id = m_vertex_partition_id[i];
85 void partition_mesh_morton();
87 size_t get_partition_id(
const Tuple& loc)
const
89 return vertex_attrs[loc.vid(*
this)].partition_id;
95 bool collapse_qslim(
int target_vertex_count);
96 bool write_triangle_mesh(std::string path);
97 bool invariants(
const std::vector<Tuple>& new_tris)
override;
107 Eigen::Vector3d vbar;
114 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& t)
const;
Definition Envelope.hpp:52
Definition QSlimMesh.h:52
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:235
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition QSlimMesh.cpp:198
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition QSlimMesh.cpp:250
Definition enumerable_thread_specific.hpp:26
Definition AttributeCollection.hpp:36
Definition QSlimMesh.h:47
Definition QSlimMesh.h:41
Definition QSlimMesh.h:104
Definition QSlimMesh.h:26
Definition QSlimMesh.h:33