-
Notifications
You must be signed in to change notification settings - Fork 116
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
Comments
and i found in function copy_Laguerre_cell_from_Delaunay line 3667 |
Hello, |
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 |
(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). |
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;
}
The text was updated successfully, but these errors were encountered: