Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh_2 criteria should accept an angle #8262

Open
sloriot opened this issue Jun 6, 2024 · 10 comments
Open

Mesh_2 criteria should accept an angle #8262

sloriot opened this issue Jun 6, 2024 · 10 comments

Comments

@sloriot
Copy link
Member

sloriot commented Jun 6, 2024

https://doc.cgal.org/latest/Mesh_2/classCGAL_1_1Delaunay__mesh__size__criteria__2.html

b parameter is sin(alpha)^2 which is not obvious. At least it should be documented like that and even better an overload with directly the minimal angle should be provided

@lrineau
Copy link
Member

lrineau commented Jun 6, 2024

An overload with named parameters would be nice. And given that, we could add the angle parameter as a real angle (in degrees?).

@afabri
Copy link
Member

afabri commented Jun 7, 2024

And using Boost.Units?

@lrineau
Copy link
Member

lrineau commented Jun 7, 2024

And using Boost.Units?

Boost Units is 20 years old, and the latest improvement, according to the release notes as of now, was 14 years ago. So no.

If we were to use a C++ units library, my choice would be without a doubt @mpusz's mp-units library. Its author Mateusz Pusz is leading the work to introduce units support in C++. See cplusplus/papers#1655 and cplusplus/papers#1752 to follow the progression of that work. His library mp-units is almost certainly like what range-v3 is to C++20 ranges, and was, even years before the standardization.

@afabri
Copy link
Member

afabri commented Jun 7, 2024

So how do you imagine the overload of the constructor with yet another double ?

@lrineau
Copy link
Member

lrineau commented Jun 7, 2024

So how do you imagine the overload of the constructor with yet another double ?

That is why I said named parameters. The overload with named parameters can only take named parameters, and will "replace" the existing parameters with named one, and add the parameter "lower bound on angles, in degree".

@mpusz
Copy link

mpusz commented Jun 7, 2024

If you need any help getting started, please don't hesitate to let me know. I believe that not only strong units and quantities but also the affine space abstraction can be very useful in your project.

@lrineau
Copy link
Member

lrineau commented Jun 10, 2024

If you need any help getting started, please don't hesitate to let me know. I believe that not only strong units and quantities but also the affine space abstraction can be very useful in your project.

Thanks Mateusz (@mpusz). For now, the CGAL libraries have to be compatible with various C++ versions, starting from C++17. As mp-units requires C++20, a support for mp-units in CGAL would have to use macros, to disable that support for users requiring C++17. Do you know any C++ project using mp-units that way, conditionally with macros?

@mpusz
Copy link

mpusz commented Jun 10, 2024

I am not aware of such a project.

However, if I understand correctly, you already use fundamental unsafe types in your interfaces. If so, you can easily conditionally add additional type-safe overloads to them.

In case you already have some Simple strong-type wrappers for units, mp-units provides powerful conversation traits that give us full control of how we can interact with such interfaces.

@lrineau
Copy link
Member

lrineau commented Jun 10, 2024

I am not aware of such a project.

However, if I understand correctly, you already use fundamental unsafe types in your interfaces. If so, you can easily conditionally add additional type-safe overloads to them.

In case you already have some Simple strong-type wrappers for units, mp-units provides powerful conversation traits that give us full control of how we can interact with such interfaces.

Thanks @mpusz. Indeed, there is a chance that we could support mp-units types in addition to the support of our unsafe types (like double or types from gmpxx). I have created a new issue about that topic: #8270

@chiphogg
Copy link

There is also a high-quality production-level units library that is compatible as far back as C++14: Au (aurora-opensource/au). We've been closely collaborating with the mp-units project for several years, sharing ideas (and occasionally code) back and forth, and also collaborating on the Standard Units Library proposal. You can see how it compares on our comparison of alternatives page, which also includes other popular libraries such as boost units, nholthaus, and bernedom/SI.

If you want a modern units library that supports C++17, I think Au is your best bet. I'm definitely biased, because --- full disclosure --- I'm the primary author. 🙂 But I also think this conclusion is easy to support by objectively comparing the various C++17-compatible options.

Feel free to check it out!

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

No branches or pull requests

6 participants