Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Poisson Function - Error Precondition Violation

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Poisson Function - Error Precondition Violation


Chronological Thread 
  • From: Michael Jeulin-L <>
  • To:
  • Subject: Re: [cgal-discuss] Poisson Function - Error Precondition Violation
  • Date: Mon, 18 Jan 2010 16:24:09 +0200

Laurent Saboret wrote:


Michael Jeulin-L wrote:
Laurent Saboret wrote:


Michael Jeulin-L wrote:
Laurent Saboret wrote:


Michael Jeulin-L wrote:
Laurent Saboret wrote:
Hi Michael,

The assertion below might occur when the Poisson reconstruction parameters are out of the recommended range.
See "Contouring parameters" paragraph at http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Surface_reconstruction_points_3/Chapter_main.html#Subsection_45.6.1

You may reconstruct your objects with various parameters with the examples provided with CGAL:
- poisson_reconstruction in examples/Surface_reconstruction_points_3 (command line)
- Point_set_demo in demo/Surface_reconstruction_points_3 (Qt GUI)
I recommend you to try first with the default parameters, then with the parameters you used in your code.

Best regards,
Laurent Saboret


Michael Jeulin-L wrote:
Hello everybody,

Excuse me to disturb, but I have a problem with Poisson function and I cannot
find the solution to fix the problem.

From this example :
http://www.cgal.org/Manual/3.5/doc_html/cgal_manual/Surface_reconstruction_points_3/Chapter_main.html

I try to compute several object with a loop, for some of them all is working
fine and I have the output I expect. However, for others my application crash
with the following error :

CGAL error: precondition violation!
Expression : tester(d)
File : CGAL/Triangulation_3.h
Line: 643
Explanation:
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html

when I try to compute, I think : "function.compute_implicit_function()"
When I look in the file triangularization_3.h, it seems to be caused by a
conflict with cell. How could I resolved the problem before my application bug
?

Thank you very much for every answer.

Thank you very much.

But I mean, I try to compute the surface for very different kind of objects.
So, is there a way to know before computing until the crash if the conditions are matched or not.
It`s the same problem for the normals computations.

No way to make a preprocessing in order to detect wrong objects ?

Actually I don`t think so, but still ask the question just in case.

Thank.
Kind Regards.


Hi Michael,

The examples provided with CGAL (see above and also examples/Point_set_processing_3 for normals computation) compute appropriate parameters for any input object.

Best regards,
Laurent Saboret

Hi,

Indeed, It is the case for normals computation but not for polyhedrons one.
So, I still have the problem to prevent/avoid the assertions when the Poisson reconstruction parameters are out of the recommended range.

Is there any way to do that or should I change directly CGAL source code ?

Thank you very much.
Best Regards.

Hi Michael,

I am not sure that I understand your question. The examples above compute appropriate parameters for the reconstruction function make_surface_mesh(). This should be enough to reconstruct your data.
Am I missing something?

Best regards,
Laurent Saboret

Hi,
The problem is that`s not. Cause when I compute the parameters I have in some cases assertion error.
It could be to compute average_spacing, bounding_sphere... and if I have understand well Poisson Construction (

// Defines the implicit surface: requires defining a
// conservative bounding sphere centered at inner point.

), I need this parameters to compute the implicit surface.

So, in function of my options :

// Poisson options
FT sm_angle = 20.0; // Min triangle angle in degrees.
FT sm_radius = 30; // Max triangle size w.r.t. point set average spacing.
FT sm_distance = 0.375; // Surface Approximation error w.r.t. point set average spacing.

+

FT average_spacing = CGAL::compute_average_spacing (points.begin(), points.end(),
6 /* knn = 1 ring */);

My autommatic reconstruction works better or worse but still bug at a moment.
I just try to be able to prevents this bug cause by out of range parameters for Poisson Reconstruction.


Thank you to interest to my problem.
Kind Regards.

Hi Michael,

Please post the code and an input file that triggers your problem.

Best regards,
Laurent Saboret


Ce courrier électronique et toutes les pièces éventuellement jointes qu’il contient sont CONFIDENTIELS et destinés exclusivement à l’usage de leur destinataire. Si une erreur de transmission ou une adresse erronée a mal dirigée ce courrier, merci d’en informer l’expéditeur en lui faisant une réponse par courrier électronique dès réception. Si vous n’êtes pas le destinataire de ce courrier, vous ne devez pas l’utiliser, le conserver, en faire état, le distribuer, le copier, l’imprimer ou en révéler le contenu à une tierce partie.
Ce courrier électronique est à usage strictement informatif et ne saurait engager de quelque manière que ce soit INFOTERRA France SAS, ni ses filiales.

This e-mail and any attachments hereto are CONFIDENTIAL and intended solely for the use of the addressee. If you have received this e-mail in error please send it back to the person that sent it to you.
If you have received it in error, please notify the sender by return email. If you are not the addressee of this email, you must not use, keep, disseminate, copy, print or otherwise deal with it.
This email is for information only and will not bind INFOTERRA France SAS in any contract or obligation, nor its subsidiaries.


My cause which cause problem is more or less exactly the same that we can find as exemple on the last manual documentation of CGAL :

/void PBuilding::ComputeImplSurfaces(double Angle, double Radius, double Distance, int NbNeighbors)
{
int index=0;

_completion=0 ;
int size=_pointsNormals.size();
global_bar->setMaximum(size) ;

// Poisson options
double angle = Angle , // Min triangle angle in degrees.
radius = Radius , // Max triangle size w.r.t. point set average spacing.
distance = Distance, // Surface Approximation error w.r.t. point set average spacing.
average_spacing , // Average Spacing between Points
sphere_radius ,
dichotomy_error ; // Must be << than distance

Point inner_point;
Sphere bSphere;
Polyhedron Building;

for(PointVecList::iterator house=_pointsNormals.begin(); house!=_pointsNormals.end(); ++house)
{ global_bar->setValue(_completion++);

STr tr; // 3D Delaunay triangulation for surface generation
C2t3 c2t3(tr); // 2D Complexe in 3D Delaunay trinangulation
Poisson_Reconstruction_Function function(
house->begin(), house->end(),
CGAL::First_of_pair_property_map<PointVectorPair>(),
CGAL::Second_of_pair_property_map<PointVectorPair>());

if (!function.compute_implicit_function()) continue;

average_spacing = CGAL::compute_average_spacing(house->begin(), house->end(), CGAL::First_of_pair_property_map<PointVectorPair>(), NbNeighbors);
inner_point = function.get_inner_point();
bSphere = function.bounding_sphere();
radius = sqrt(bSphere.squared_radius());
sphere_radius = 5.0*radius;
dichotomy_error = distance*average_spacing/1000.0;

Surface_3 surface(function,
Sphere(inner_point, sphere_radius*sphere_radius),
dichotomy_error/sphere_radius);

CGAL::Surface_mesh_default_criteria_3<STr> criteria(angle, radius*average_spacing, distance*average_spacing);
CGAL::make_surface_mesh(c2t3, // reconstructed mesh
surface, // implicit surface criteria, // meshing criteria CGAL::Manifold_with_boundary_tag()); // require manifold mesh
CGAL::output_surface_facets_to_polyhedron(c2t3, Building);

string file = "PoissonRecon\\Bat" + boost::lexical_cast<std::string>(index++) + ".off";
ofstream out(file.c_str());
out << Building;

_polyhedronsDl.push_back(Building);
Building.clear();
}

global_bar->setValue(size);
global_bar->reset();
}

/And the problem can come for different part of the parameters computation.
For instance the last one was :

CGAL error: precondition violation!
Expression : tester(d)
File : CGAL/Triangulation_3.h
Line: 643
Explanation:
Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html

But it could an other assertion just like I was saying.
Do you know how can I prevent that (density calculation, number of points.... to be able to say : This Normalized Points will be out of range for Poisson Reconstruction).

Thanks.
Kind Regards.

--
--------------------------------------------
Michael Jeulin-L, ComputaMaps

Private Bag X20, Constantia 7848, South Africa
tel: +27.21.700 8140, fax: +27.21.701 9520, cell: +27.72.8588181
e-mail:


Manufacturers of digital maps and imagery
http://www.computamaps.com
--------------------------------------------




Archive powered by MHonArc 2.6.16.

Top of Page