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

Triangulate command does not work properly #264

Open
abaikin opened this issue Apr 17, 2023 · 2 comments
Open

Triangulate command does not work properly #264

abaikin opened this issue Apr 17, 2023 · 2 comments

Comments

@abaikin
Copy link

abaikin commented Apr 17, 2023

Dear FF developers,

I tried to run the following code that makes the triangulation of the set of point.

real[int] xp =  [-2.5, -2.15475054099667, -1.25, -2.380952390876986, -1.561972650353577];

real[int] yp =  [0.5, -0.9500478486996595, 0.5, 0, 0];

mesh Thxy=triangulate(xp, yp);

plot(Thxy);

But it raised the error

Assertion fail : (area > 0)
        line :303, in file ../femlib/fem.hpp

I also tried scipy and it works ok for this set of points.

@frederichecht
Copy link
Contributor

The problem is due to roundoff error objet in no convex

if the change by

`real[int] xp = [-2.5, -2.15475054099667-1e-8, -1.25, -2.380952390876986, -1.561972650353577];

real[int] yp = [0.5, -0.9500478486996595, 0.5, 0, 0];
`

it works.

@abaikin
Copy link
Author

abaikin commented Apr 17, 2023

@frederichecht Thank you for your reply!

This set of points is just an example. Is there a way to fix the issue for a general case?

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

No branches or pull requests

2 participants