Commit faf9e4cf authored by TheNumbat's avatar TheNumbat
Browse files

fix macos build; add wrapper for erase

parent 9bc17c6e
......@@ -190,6 +190,14 @@ public:
// Student Local Operations | student/meshedit.cpp
//////////////////////////////////////////////////////////////////////////////////////////
// Note: if you erase elements in these methods, they will not be erased from the
// element lists until do_erase or validate are called. This is to facilitate checking
// for dangling references to elements that will be erased.
// The rest of the codebase will automatically call validate() after each op,
// but you may need to be aware of this when implementing global ops.
// Specifically, when you need to collapse an edge in iostropic_remesh() or simplify(),
// you should call collapse_edge_erase() instead of collapse_edge()
/*
Merge all faces incident on a given vertex, returning a
pointer to the merged face.
......@@ -260,6 +268,16 @@ public:
void bevel_face_positions(const std::vector<Vec3> &start_positions, FaceRef face,
float tangent_offset, float normal_offset);
/*
Collapse an edge, returning a pointer to the collapsed vertex
** Also deletes the erased elements **
*/
std::optional<VertexRef> collapse_edge_erase(EdgeRef e) {
auto r = collapse_edge(e);
do_erase();
return r;
}
//////////////////////////////////////////////////////////////////////////////////////////
// Student Global Operations | student/meshedit.cpp
//////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -226,7 +226,6 @@ void Model::vertex_viz(Halfedge_Mesh::VertexRef v, float &size, Mat4 &transform)
auto he = v->halfedge();
do {
Vec3 n = he->twin()->vertex()->pos;
float len = he->edge()->length();
min = std::min(min, len);
avg += len;
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment