|
| std::shared_ptr< Envelope > | surface_envelope_for_edge (const std::array< size_t, 2 > &vids, const EdgeAttributes &attr) const override |
| |
| std::shared_ptr< Envelope > | smoothing_energy_envelope (const size_t vid) const override |
| |
|
| TriWildMesh (Parameters &_m_params, double envelope_eps, int _num_threads=0) |
| |
| void | init_mesh (const MatrixXd &V, const std::vector< Vector2r > &V_rational, const MatrixXi &F, const MatrixXi &E, const std::vector< std::string > &tag_names, const MatrixXd &V_env, const MatrixXi &E_env, const std::vector< int > *E_orientation=nullptr, const std::vector< size_t > &free_point_vids={}, const std::vector< int > *E_env_input=nullptr, const std::vector< InputSet > *E_input_set=nullptr) |
| | Init mesh from IGL-style matrices.
|
| |
|
void | init_surfaces_and_boundaries () |
| |
|
void | init_envelope (const MatrixXd &V, const MatrixXi &F) |
| |
| size_t | refine_sizing_around_worst (double max_energy) override |
| | The old global sizing-field update (KNN R-ball around every low-quality triangle). Superseded by refine_sizing_around_worst, but kept compiled and callable so the two can be compared – tetwild and simwild keep theirs for the same reason.
|
| |
|
void | write_vtu (const std::string &path, MeshMap *output=nullptr) const |
| |
| void | compute_winding_numbers (const std::vector< MatrixXd > &Vs, const std::vector< MatrixXi > &Es) |
| | Tag every face with the inputs it lies inside, by winding number.
|
| |
|
void | filter_with_input_winding_number () |
| | Remove the faces that lie inside no input (needs compute_winding_numbers).
|
| |
| void | compute_tracked_winding_number () |
| | Winding number of every face's centroid w.r.t. the tracked curves, oriented as the input was (m_tracks_orientation must be set), into FaceAttributes::m_winding_number.
|
| |
|
void | filter_with_tracked_winding_number () |
| | Remove the faces whose tracked winding number is at most 1/2.
|
| |
|
void | filter_with_flood_fill () |
| | Remove the flood-fill region that dominates the mesh boundary (needs flood_fill).
|
| |
|
int | flood_fill () |
| |
| std::vector< std::array< size_t, 2 > > | oriented_tracked_edges () const |
| |
|
std::vector< std::pair< size_t, int > > | tracked_curve_boundary () const |
| | Vertices where the oriented tracked curves have a boundary (in minus out != 0), each with that sum. Empty for closed input curves; the operations preserve it.
|
| |
| | TriOptimizerMesh (OptimizerParameters ¶ms) |
| |
|
size_t | get_partition_id (const Tuple &loc) const |
| |
|
void | partition_mesh () |
| |
|
void | partition_mesh_morton () |
| |
|
double | get_length2 (const Tuple &l) const |
| |
| bool | is_inverted (const std::array< size_t, 3 > &vs) const |
| | Orientation check, exact for the coordinates the vertices actually carry.
|
| |
|
bool | is_inverted (const Tuple &loc) const |
| |
|
bool | is_inverted (const size_t fid) const |
| |
|
bool | is_inverted_f (const Tuple &loc) const |
| | Inversion check using only the double positions.
|
| |
|
bool | is_inverted_f (const size_t fid) const |
| |
|
double | get_quality (const std::array< size_t, 3 > &vs) const |
| |
|
double | get_quality (const Tuple &loc) const |
| |
|
double | get_quality (const size_t fid) const |
| |
|
std::tuple< double, double > | get_max_avg_energy () |
| |
| virtual void | update_attributes () |
| | Update the attributes of the mesh after an iteration of operations.
|
| |
|
void | mesh_improvement (int max_its=80) |
| |
|
std::tuple< double, double > | local_operations (const std::array< int, 4 > &ops, bool collapse_limit_length=true) |
| |
| bool | storage_grows_on_demand () const override |
| |
| bool | split_edge_is_due (const Tuple &e) const |
| |
|
bool | is_force_split_edge (const size_t v1, const size_t v2) const |
| |
|
void | split_all_edges () |
| |
| bool | split_edge_before (const Tuple &t) override |
| | User specified preparations and desideratas for an edge split.
|
| |
| bool | split_edge_after (const Tuple &loc) override |
| | User specified modifications and desideratas after an edge split.
|
| |
|
void | collapse_all_edges (bool is_limit_length=true) |
| |
| bool | collapse_edge_before (const Tuple &t) override |
| | User specified preparations and desideratas for an edge collapse including the link check as collapse prerequisite.
|
| |
| bool | collapse_edge_after (const Tuple &t) override |
| | User specified modifications and desideratas after an edge collapse.
|
| |
| size_t | coarsen_mesh () |
| | Coarsen the mesh without letting the max energy rise.
|
| |
| bool | coarsen_collapse_edge (const Tuple &e, std::vector< Tuple > &new_tris) |
| | One collapse under the coarsening rules, outside a coarsening pass.
|
| |
| size_t | swap_all_edges () |
| | Run TriWild's quality-improving interior edge-flip pass.
|
| |
|
double | swap_weight (const Tuple &t) const |
| |
| 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. 2. when swap edge between v1, v2, there can't exist edges between the two opposite vertices v3, v4.
|
| |
| bool | swap_edge_after (const Tuple &t) override |
| | User specified modifications and desideras after an edge swap.
|
| |
| void | smooth_all_vertices (size_t n_iters=1) |
| | Run TriWild's vertex-smoothing pass.
|
| |
|
bool | use_colored_smoothing () const |
| | Whether this pass smooths by color class (see OptimizerParameters::colored_smoothing).
|
| |
|
void | smooth_vertices_colored (const std::vector< std::pair< std::string, Tuple > > &ops) |
| | One smoothing sweep over ops (all "vertex_smooth"), one color class at a time.
|
| |
| bool | smooth_before (const Tuple &t) override |
| | The smoothing hooks. A derived class overriding them – or invariants(), which a smooth also runs – must read every attribute outside the smoothed vertex's star (other vertices, and the edges and triangles not incident to the vertex) through const access, e.g. std::as_const(m_vertex_attribute)[u].
|
| |
| bool | smooth_after (const Tuple &t) override |
| | User specified modifications and desideras after an edge smooth.
|
| |
|
Vector2d | smoothing_position (size_t vid) const |
| |
|
void | set_smoothing_position (size_t vid, const Vector2d &p) |
| |
| virtual bool | smoothing_position_is_allowed (const size_t vid, const Vector2d &p) const |
| |
| virtual std::shared_ptr< Envelope > | smoothing_containment_envelope (const size_t, const std::array< size_t, 2 > &edge, const EdgeAttributes &attr) const |
| |
| virtual std::shared_ptr< polysolve::nonlinear::Problem > | smoothing_extra_energy (const size_t vid) const |
| | An extra term the application adds to this vertex's smoothing objective, or null.
|
| |
| virtual double | smoothing_cell_energy (const size_t, const double quality) const |
| | The number the shared smoother compares for one face, given the face's quality at the position being tested: the projected step's candidate test and the quality veto take the max of this over the ring. The quality itself by default, so TriWild and SimWild compare exactly what they compared before. The 3D twin is TetOptimizerMesh::smoothing_cell_energy.
|
| |
|
double | active_quality_threshold () const |
| |
|
virtual std::vector< size_t > | active_vertices () const |
| |
| virtual double | quality_rel (const size_t fid) const |
| | A face's quality relative to the quality it is required to reach; <= 1 means it meets it.
|
| |
| bool | round (const Tuple &v) |
| | Round a vertex position to floating point, if that inverts no incident face.
|
| |
|
bool | is_edge_on_surface (const Tuple &loc) const |
| |
| bool | is_tracked_edge (const Tuple &e) const override |
| |
| std::vector< size_t > | tracked_feature_points () const override |
| |
| void | record_curve_history (const std::string &metadata, const CurveSources &sources={}) |
| |
| std::optional< history::CurveHistory > | finish_curve_history (const history::CurveHistory *input=nullptr) |
| | Check the recorded curves against the tracked edges, stop recording, log what the history holds and return it, for the application to save (io::ComponentIO::save_history). None if not recording.
|
| |
|
bool | is_edge_on_surface (const std::array< size_t, 2 > &vids) const |
| |
|
bool | is_edge_on_bbox (const Tuple &loc) const |
| |
|
bool | is_edge_on_bbox (const std::array< size_t, 2 > &vids) const |
| |
| bool | vertex_is_on_surface (const size_t vid) const override |
| | Is a vertex part of the substructure.
|
| |
| bool | edge_is_on_surface (const std::array< size_t, 2 > &vids) const override |
| | Is an edge part of the substructure.
|
| |
| bool | surface_segment_is_outside (const size_t a, const size_t b, const EdgeAttributes &attr) const |
| |
|
std::vector< std::array< size_t, 2 > > | get_edges_by_condition (std::function< bool(const EdgeAttributes &)> cond) const |
| |
| void | gradation_smooth_sizing (double grade, const std::vector< size_t > &seeds) |
| | Monotone (only-decreasing) gradation smoothing of the sizing field.
|
| |
| void | throw_if_in_operation_pass (const char *call) const |
| |
| void | enable_feature_point_tracking (const bool preserve) |
| | Turn on feature-point tracking, and the policy when preserve.
|
| |
| bool | collapse_breaks_feature_point (const size_t v1_id, const size_t v2_id) const |
| |
| bool | feature_point_ball_contains (const size_t vid, const Vector2d &p) const |
| | May vertex vid sit at p as far as its anchor goes?
|
| |
| std::pair< size_t, size_t > | feature_retention (double *worst_ratio=nullptr) const |
| | {feature points still represented within m_feature_eps, total feature points}.
|
| |
| void | init (size_t n_vertices, const std::vector< std::array< size_t, 3 > > &tris) |
| |
| void | init (const MatrixXi &F) |
| | Generate the connectivity of the mesh from an IGL-style F matrix.
|
| |
| std::vector< Tuple > | get_vertices () const |
| |
| std::vector< Tuple > | get_edges () const |
| |
| std::vector< Tuple > | get_faces () const |
| |
| Tuple | tuple_from_edge (size_t vid1, size_t vid2, size_t fid) const |
| |
|
Tuple | tuple_from_vids (size_t vid0, size_t vid1, size_t vid2) const |
| |
|
simplex::Vertex | simplex_from_vertex (const Tuple &t) const |
| |
|
simplex::Edge | simplex_from_edge (const Tuple &t) const |
| |
|
simplex::Face | simplex_from_face (const Tuple &t) const |
| |
|
simplex::Face | simplex_from_face (const size_t fid) const |
| |
|
Tuple | tuple_from_simplex (const simplex::Face &s) const |
| |
|
simplex::SimplexCollection | simplex_incident_triangles (const simplex::Vertex &v) const |
| |
|
simplex::SimplexCollection | simplex_incident_triangles (const simplex::Edge &e) const |
| |
|
simplex::SimplexCollection | simplex_link_vertices (const simplex::Vertex &v) const |
| |
|
simplex::SimplexCollection | simplex_link_vertices (const simplex::Edge &e) const |
| |
|
simplex::SimplexCollection | simplex_link_edges (const simplex::Vertex &v) const |
| |
|
void | set_preallocation_factor (double factor) |
| | Preallocation factor: init/consolidate reserve capacity = max(floor, ceil(factor * live_count)) so operations can grab fresh slots without resizing the storage. When a pass exhausts the reserved capacity the affected operations fail (retried later after a consolidate). Values < 1 are clamped to 1.
|
| |
|
double | preallocation_factor () const |
| |
|
bool | slots_exhausted () const |
| |
|
void | clear_slots_exhausted () |
| |
|
size_t | request_tri_slots (size_t n) |
| |
|
size_t | request_vert_slots (size_t n) |
| |
| virtual bool | invariants (const std::vector< Tuple > &) |
| | User specified invariants that can't be violated.
|
| |
| virtual bool | split_face_before (const Tuple &t) |
| | User specified preparations and desideratas for a face split.
|
| |
| virtual bool | split_face_after (const Tuple &t) |
| | User specified modifications and desideratas after a face split.
|
| |
| size_t | tri_capacity () const |
| | get the current largest global fid
|
| |
| size_t | vert_capacity () const |
| | get the current largest global vid
|
| |
| void | consolidate_mesh () |
| | removing the elements that are removed
|
| |
| std::shared_ptr< history::Recorder > | start_history (std::function< Eigen::Vector3d(size_t)> position) |
| | Record every operation this mesh commits from now on (see wmtk/history).
|
| |
|
void | stop_history () |
| | Stop recording. The recorder keeps the edits it has.
|
| |
| std::shared_ptr< history::TrackedCurveRecorder > | start_curve_history (std::function< Eigen::Vector3d(size_t)> position) |
| | Record every change to the tracked curves from now on (see wmtk/history/TrackedRecorder.hpp).
|
| |
|
void | stop_curve_history () |
| | Stop recording curves. The recorder keeps what it has.
|
| |
| size_t | resync_curve_history (const std::vector< std::array< size_t, 2 > > &edges) |
| |
|
std::vector< std::array< size_t, 2 > > | tracked_edges () const |
| | Every tracked edge, each with its smaller vertex first.
|
| |
| void | remove_tris_by_ids (const std::vector< size_t > &fids) |
| | Mark the given triangles, and any vertex left without an incident triangle, as removed.
|
| |
|
Tuple | switch_vertex (const Tuple &t) const |
| | a duplicate of Tuple::switch_vertex funciton
|
| |
|
Tuple | switch_edge (const Tuple &t) const |
| | a duplicate of Tuple::switch_edge funciton
|
| |
| std::optional< Tuple > | switch_face (const Tuple &t) const |
| | a duplicate of Tuple::switch_face funciton
|
| |
| bool | check_link_condition (const Tuple &t) const |
| | prerequisite for collapse
|
| |
| void | set_use_link_condition (bool use_it) |
| | Should collapse_edge_before enforce the link condition?
|
| |
|
bool | use_link_condition () const |
| |
| bool | check_mesh_connectivity_validity () const |
| | verify the connectivity validity of the mesh
|
| |
|
bool | check_edge_manifold () const |
| | verify the edge manifoldness of the mesh
|
| |
| size_t | edge_valence (const TriMesh::Tuple &t) const |
| | Number of triangles incident to the edge the Tuple points at.
|
| |
| bool | is_boundary_edge (const TriMesh::Tuple &t) const |
| | Does exactly one triangle share this edge?
|
| |
| bool | is_manifold_edge (const TriMesh::Tuple &t) const |
| | Do exactly two triangles share this edge?
|
| |
| size_t | vertex_component_count (const size_t vid) const |
| | Number of edge-connected components in the fan of a vertex.
|
| |
|
size_t | vertex_component_count (const TriMesh::Tuple &t) const |
| |
|
bool | is_manifold_vertex (const size_t vid) const |
| |
| std::optional< Tuple > | switch_component (const TriMesh::Tuple &t) const |
| | Jump to the next edge-connected component of the fan of the Tuple's vertex.
|
| |
| bool | is_boundary_vertex (const TriMesh::Tuple &t) const |
| | check if the vertex that's represented by a Tuple is at the boundary of the mesh
|
| |
| bool | split_edge (const Tuple &t, std::vector< Tuple > &new_t) |
| |
| virtual bool | collapse_edge (const Tuple &t, std::vector< Tuple > &new_t) |
| |
| void | collapse_edge_conn (const Tuple &loc0, std::vector< Tuple > &new_tris, Tuple &return_t, size_t &new_vid, std::vector< std::pair< size_t, TriangleConnectivity > > &old_tris, std::vector< std::pair< size_t, VertexConnectivity > > &old_vertices, std::vector< std::pair< size_t, size_t > > &same_edge_vid_fid, std::vector< size_t > &n12_intersect_fids) |
| |
| void | collapse_edge_rollback (size_t &new_vid, std::vector< std::pair< size_t, TriangleConnectivity > > &old_tris, std::vector< std::pair< size_t, VertexConnectivity > > &old_vertices, std::vector< std::pair< size_t, size_t > > &same_edge_vid_fid, std::vector< size_t > &n12_intersect_fids) |
| |
| bool | swap_edge (const Tuple &t, std::vector< Tuple > &new_t) |
| |
| bool | smooth_vertex (const Tuple &t) |
| |
| bool | split_face (const Tuple &t, std::vector< Tuple > &new_t) |
| | Split a face in 3 faces.
|
| |
| size_t | get_valence_for_vertex (const Tuple &t) const |
| | Count the number of the one ring tris for a vertex.
|
| |
| size_t | vertex_valence (const size_t vid) const |
| | Number of triangles incident to a vertex, by id.
|
| |
| std::vector< Tuple > | get_one_ring_tris_for_vertex (const Tuple &t) const |
| | Get the one ring tris for a vertex.
|
| |
|
const std::vector< size_t > & | get_one_ring_fids_for_vertex (const Tuple &t) const |
| |
|
const std::vector< size_t > & | get_one_ring_fids_for_vertex (const size_t vid) const |
| |
| std::vector< size_t > | get_one_ring_vids_for_vertex_duplicate (const size_t &t) const |
| | Get the vids of the incident one ring tris for a vertex.
|
| |
|
void | get_one_ring_vids_for_vertex_duplicate (const size_t &t, std::vector< size_t > &one_ring) const |
| |
|
std::vector< size_t > | get_incident_fids_for_edge (const Tuple &t) const |
| |
|
std::vector< size_t > | get_incident_fids_for_edge (const size_t vid0, const size_t vid1) const |
| |
| std::vector< Tuple > | get_one_ring_edges_for_vertex (const Tuple &t) const |
| | Get all edges that are incident to the vertex of Tuple t.
|
| |
|
std::vector< Tuple > | get_one_ring_edges_for_vertex (const size_t vid) const |
| |
| std::array< Tuple, 3 > | oriented_tri_vertices (const Tuple &t) const |
| | Get the incident vertices for a triangle.
|
| |
| std::array< size_t, 3 > | oriented_tri_vids (const Tuple &t) const |
| | Get the incident vertices for a triangle.
|
| |
|
std::array< size_t, 3 > | oriented_tri_vids (const size_t i) const |
| |
|
std::array< Tuple, 2 > | get_edge_vertices (const Tuple &t) const |
| |
|
std::array< size_t, 2 > | get_edge_vids (const Tuple &t) const |
| |
| Tuple | tuple_from_tri (size_t fid) const |
| |
| Tuple | tuple_from_vertex (size_t vid) const |
| |
| Tuple | tuple_from_edge (size_t fid, size_t local_eid) const |
| |
|
std::tuple< Tuple, size_t > | tuple_from_edge (const std::array< size_t, 2 > &vids) const |
| |
| std::optional< std::tuple< Tuple, size_t > > | try_tuple_from_edge (const std::array< size_t, 2 > &vids) const |
| | tuple_from_edge for callers where a missing edge is an answer, not a bug.
|
| |
|
void | start_protect_attributes () |
| | Start the phase where the attributes that will be modified can be recorded.
|
| |
|
void | release_protect_attributes () |
| | End the modification phase.
|
| |
|
void | rollback_protected_attributes () |
| | rollback the attributes that are modified if any condition failed
|
| |
|
int | release_vertex_mutex_in_stack () |
| |
| int | release_vertex_mutex_to (size_t mark) |
| | Release the mutexes taken since the release stack held mark entries.
|
| |
| bool | try_set_vertex_mutex_n_ring (const Tuple &v, int threadid, int n) |
| | Lock every vertex within graph distance n of v, the seed included.
|
| |
|
bool | try_set_vertex_mutex_n_ring (size_t vid, int threadid, int n) |
| |
|
bool | try_set_edge_mutex_n_ring (const Tuple &e, int threadid, int n) |
| | try_set_vertex_mutex_n_ring seeded from both ends of an edge.
|
| |
| bool | try_set_face_mutex_one_ring (const Tuple &f, int threadid) |
| | try lock the one-ring neighboring triangles' incident vertices.
|
| |
|
void | for_each_face (const std::function< void(const Tuple &)> &) |
| | perform the given function for each face
|
| |
|
void | for_each_edge (const std::function< void(const Tuple &)> &) |
| | perform the given function for each edge
|
| |
|
void | for_each_vertex (const std::function< void(const Tuple &)> &) |
| | perform the given function for each vertex
|
| |
| simplex::SimplexCollection | get_surface_edges_for_vertex (const size_t vid) const |
| | Get all edges on the surface that are incident to vid.
|
| |
| size_t | get_order_of_edge (const std::array< size_t, 2 > &vids) const |
| | Compute the order of an edge.
|
| |
| size_t | get_order_of_vertex (const size_t vid) const |
| | Get the order of a vertex.
|
| |
| bool | substructure_link_condition (const Tuple &e_tuple) const |
| | Link condition that also considers substructures.
|
| |
|
size_t | tri_storage_capacity () const |
| |
|
size_t | vert_storage_capacity () const |
| |
|
bool | try_set_vertex_mutex_two_ring (const Tuple &v, int threadid) |
| | Lock v's one-ring and, partially, its two-ring. See the note above.
|
| |
|
bool | try_set_edge_mutex_two_ring (const Tuple &e, int threadid) |
| | Lock the edge's one-ring and, partially, its two-ring. See the note above.
|
| |
|
bool | try_set_vertex_mutex_one_ring (const Tuple &v, int threadid) |
| | Lock v and its one-ring. Complete, unlike the two-ring pair.
|
| |
|
size_t | cell_capacity () const |
| |
|
size_t | cell_storage_capacity () const |
| |
|
Tuple | tuple_from_cell (size_t cid) const |
| |
| size_t | cell_slot_bound (const Tuple &t) const |
| |
| void | reserve_free_slots (size_t cells, size_t verts) |
| |
| size_t | round_all_vertices () |
| | Try to round every un-rounded vertex; returns the number reclaimed.
|
| |
| bool | round_and_check_all_rounded () |
| | Run the sweep, then report whether the mesh is now fully rounded.
|
| |