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

How to compute the power Diagram ? I got the error when follow the tutorial in the repos #114

Open
liu411417492 opened this issue Nov 5, 2023 · 5 comments

Comments

@liu411417492
Copy link

I want to compute Power Diagram in my project, and I follow the tutorial in your repos,but when i run this code
"delaunay_->copy_Laguerre_cell_from_Delaunay(i, C, W_);"
i got the Error:
“Abnormal program termination: received signal 11 (SIGSEGV)”

And i notice that when i comment out the code :
"delaunay_->set_weights(weights_vec.data());"
then everything is ok .So i want to know is there anything to pay attention to when set the weight vector?

——————————————————————————————————————————————————————————

Here is the code

function(){

using namespace GEO;

GEO::initialize();

Stopwatch Wtot("Total time");

if (InitPara) {
CmdLine::import_arg_group("standard");
CmdLine::import_arg_group("algo");
GEO::CmdLine::import_arg_group("co3ne");
GEO::CmdLine::import_arg_group("pre");
GEO::CmdLine::import_arg_group("post");
GEO::CmdLine::import_arg_group("remesh");
GEO::CmdLine::import_arg_group("opt");
GEO::CmdLine::import_arg_group("tet");
}

GEO::Mesh gm_pts;
mesh_load("sample-10000.xyz", gm_pts); // read 1w points
gm_pts.facets.clear();

PeriodicDelaunay3d::IncidentTetrahedra W_;
SmartPointer delaunay_ = new PeriodicDelaunay3d(false, 1.0);

delaunay_->set_vertices(gm_pts.vertices.nb(), gm_pts.vertices.point_ptr(0));
delaunay_->set_keeps_infinite(true);

GEO::vector weights_vec;
for (auto i = 0; i < gm_pts.vertices.nb(); i++) {

double* p = gm_pts.vertices.point_ptr(i);

weights_vec.push_back(std::abs(p[2]));

}

delaunay_->set_weights(weights_vec.data());

delaunay_->compute();

ConvexCell C;
//delaunay_->copy_Laguerre_cell_from_Delaunay(0, C);

delaunay_->copy_Laguerre_cell_from_Delaunay(0, C, W_);

return;
}

@liu411417492
Copy link
Author

and i found in function copy_Laguerre_cell_from_Delaunay line 3667
called funtion get_incident_tets(i,W);
in this function and in line 3568
code : t = index_t(v_to_cell_[v]);
running assert geo_debug_assert(i < size());
and then report error

@BrunoLevy
Copy link
Owner

Hello,
I'll try to help you,
To start, a little question: as far as I understand, you are using the z coordinate of the points as the weights ? why ?

@liu411417492
Copy link
Author

Hello, I'll try to help you, To start, a little question: as far as I understand, you are using the z coordinate of the points as the weights ? why ?

oh i have a algorithm to compute the weights and it is too long so i didn't copy the code

the weights i used in the project is vary from [0,C] and C is the constant value; so i use the z coordinate of the points as the weight for example

@liu411417492
Copy link
Author

by the way ,my partner found that v_to_cell_ in delaunay_->compute() didn't update for the all time ,because the multiple thread0 is always return ,but when i comment out the return ,it didnt report error, but the result is also wrong. TAT
Uploading 13b547fa1fe4ede6cb86d7c041f507f.png…

@BrunoLevy
Copy link
Owner

(I'm sorry I am a bit slow to answer, need to finish a batch of changes / bugfixes then I'll come back to you right after).

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