Skip to content

Commit

Permalink
Update the sizing field updating function
Browse files Browse the repository at this point in the history
  • Loading branch information
ipadjen committed Sep 30, 2023
1 parent 376b682 commit 298d9e9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,20 @@ typedef unspecified_type FT;
/// returning the ratio of the current edge length and the local target edge length between
/// the points of `va` and `vb` in case the current edge is too long, and `std::nullopt` otherwise.
std::optional<FT> is_too_long(const vertex_descriptor va,
const vertex_descriptor vb) const;
const vertex_descriptor vb) const;

/// a function controlling edge collapse by returning the ratio of the squared length of `h` and the
/// local target edge length if it is too short, and `std::nullopt` otherwise.
std::optional<FT> is_too_short(const halfedge_descriptor h,
const PolygonMesh& pmesh) const;
const PolygonMesh& pmesh) const;

/// a function returning the location of the split point of the edge of `h`.
Point_3 split_placement(const halfedge_descriptor h,
const PolygonMesh& pmesh) const;

/// a function that updates the sizing field value at the vertex `v`.
void update(const vertex_descriptor v, const PolygonMesh& pmesh);

/// @}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class Adaptive_sizing_field
get(m_vpmap, source(h, pmesh)));
}

void update_sizing_map(const vertex_descriptor v, const PolygonMesh& pmesh)
void update(const vertex_descriptor v, const PolygonMesh& pmesh)
{
// calculating it as the average of two vertices on other ends
// of halfedges as updating is done during an edge split
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class Uniform_sizing_field
get(m_vpmap, source(h, pmesh)));
}

void update(const vertex_descriptor v, const PolygonMesh& pmesh)
{}

private:
FT m_sq_short;
FT m_sq_long;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ namespace internal {
std::cout << " refinement point : " << refinement_point << std::endl;
#endif
//update sizing field with the new point
if constexpr (!std::is_same_v<SizingFunction, Uniform_sizing_field<PM, VertexPointMap>>)
sizing.update_sizing_map(vnew, mesh_);
sizing.update(vnew, mesh_);

//check sub-edges
//if it was more than twice the "long" threshold, insert them
Expand Down Expand Up @@ -551,8 +550,7 @@ namespace internal {
halfedge_added(hnew_opp, status(opposite(he, mesh_)));

//update sizing field with the new point
if constexpr (!std::is_same_v<SizingFunction, Uniform_sizing_field<PM, VertexPointMap>>)
sizing.update_sizing_map(vnew, mesh_);
sizing.update(vnew, mesh_);

//check sub-edges
//if it was more than twice the "long" threshold, insert them
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Sizing_field_base
virtual std::optional<FT> is_too_short(const halfedge_descriptor h,
const PolygonMesh& pmesh) const = 0;
virtual Point_3 split_placement(const halfedge_descriptor h, const PolygonMesh& pmesh) const = 0;
virtual void update(const vertex_descriptor v, const PolygonMesh& pmesh) = 0;

};

Expand Down

0 comments on commit 298d9e9

Please sign in to comment.