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 <tbb/enumerable_thread_specific.h>
12#include <tbb/parallel_for.h>
13#include <tbb/parallel_sort.h>
14#include <tbb/task_arena.h>
15#include <wmtk/envelope/Envelope.hpp>
16#include <wmtk/utils/EnableWarnings.hpp>
20#include <Eigen/Geometry>
26namespace wmtk::components::qslim {
38 size_t partition_id = 0;
46 Eigen::Vector3d n = Eigen::Vector3d::Zero();
59 bool m_has_envelope =
false;
65 QSlimMesh(std::vector<Eigen::Vector3d> _m_vertex_positions,
int num_threads = 1);
72 const std::vector<std::array<size_t, 3>>& tris,
73 const std::vector<size_t>& frozen_verts = std::vector<size_t>(),
76 void initiate_quadrics_for_face();
78 void initiate_quadrics_for_vertices();
82 auto m_vertex_partition_id = partition_TriMesh(*
this, NUM_THREADS);
83 for (
auto i = 0; i < m_vertex_partition_id.size(); i++)
84 vertex_attrs[i].partition_id = m_vertex_partition_id[i];
88 void partition_mesh_morton();
90 size_t get_partition_id(
const Tuple& loc)
const
92 return vertex_attrs[loc.vid(*
this)].partition_id;
98 bool collapse_qslim(
int target_vertex_count);
99 bool write_triangle_mesh(std::string path);
100 bool invariants(
const std::vector<Tuple>& new_tris)
override;
110 Eigen::Vector3d vbar;
115 tbb::enumerable_thread_specific<InfoCache> cache;
117 std::vector<TriMesh::Tuple> new_edges_after(
const std::vector<TriMesh::Tuple>& t)
const;
Definition Envelope.hpp:56
Definition QSlimMesh.h:55
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:303
bool invariants(const std::vector< Tuple > &new_tris) override
User specified invariants that can't be violated.
Definition QSlimMesh.cpp:266
bool collapse_edge_after(const Tuple &t) override
User specified modifications and desideratas after an edge collapse.
Definition QSlimMesh.cpp:318
Definition AttributeCollection.hpp:37
Definition QSlimMesh.h:50
Definition QSlimMesh.h:44
Definition QSlimMesh.h:107
Definition QSlimMesh.h:29
Definition QSlimMesh.h:36