Skip to content

CGAL cdt with triangle's api#1811

Merged
alecjacobson merged 9 commits intomainfrom
cgal-triangulate
May 24, 2021
Merged

CGAL cdt with triangle's api#1811
alecjacobson merged 9 commits intomainfrom
cgal-triangulate

Conversation

@alecjacobson
Copy link
Copy Markdown
Contributor

Future work is to implement more of the triangle api and to overload a version that doesn't use the triangle string flags (and keep this version to call it for easy switching).

Checklist

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • This is a minor change.

Copy link
Copy Markdown
Collaborator

@jdumas jdumas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's a good idea to introduce a new function using the std::string flags, if we know we want to move away from that in the future. trianglelite uses a simple config struct, which would be less error prone and easier to use. We could have a utility function Config::from_string() that converts a triangle cli switch to a struct filled with the appropriate content to facilitate code update...

// in_domain = false. start should not yet be visited.
const auto remove_cc = [&](Face_handle start)
{
std::list<Face_handle> queue;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't use a std::list for that. std::queue under the hood uses a std::dequeue, which should offer better performances.

@jdumas jdumas added the feature label May 24, 2021
@jdumas jdumas added this to the v3.0.0 milestone May 24, 2021
@alecjacobson
Copy link
Copy Markdown
Contributor Author

Agreed. That's what I'm referring to as future work. For now, it's good to have the same API.

@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented May 24, 2021

"future work" just sound like an easy way for the task to be added to the backlog and never be completed. Why not do it as part of this PR?

@alecjacobson
Copy link
Copy Markdown
Contributor Author

alecjacobson commented May 24, 2021 via email

@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented May 24, 2021

Sure, I can add it to my own backlog. But let's hold on merging this in the meantime. The last thing I want is to introduce more broken windows for the sake of expediency.

@alecjacobson alecjacobson merged commit e9ff3a9 into main May 24, 2021
@alecjacobson alecjacobson deleted the cgal-triangulate branch May 24, 2021 22:29
// Insert all edges
for(Eigen::Index e = 0;e<E.rows();e++)
{
cdt.insert_constraint(points[E(e,0)],points[E(e,1)]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to use this function to get better performances. As far as I see, you can use boost::transform_iterator together with a lambda to create pairs on the fly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants