Skip to content
Snippets Groups Projects
Commit 512c67ca authored by Amaury Johnen's avatar Amaury Johnen
Browse files

fix low accuracy in computation of point parameter on edges. Why would you...

fix low accuracy in computation of point parameter on edges. Why would you skip computation with relax=1 since it gives the 'exact' parameter value for straight GEdges?
parent 177f6917
Branches
Tags
No related merge requests found
......@@ -477,7 +477,7 @@ bool GEdge::XYZToU(const double X, const double Y, const double Z,
double uMin = uu.low();
double uMax = uu.high();
SVector3 Q(X, Y, Z), P;
const SVector3 Q(X, Y, Z);
double init[NumInitGuess];
......@@ -490,6 +490,7 @@ bool GEdge::XYZToU(const double X, const double Y, const double Z,
//err2 = 1.0;
iter = 1;
SVector3 P = position(u);
SVector3 dPQ = P - Q;
err = dPQ.norm();
......@@ -512,12 +513,12 @@ bool GEdge::XYZToU(const double X, const double Y, const double Z,
if(relax > 1.e-2) {
// Msg::Info("point %g %g %g on edge %d : Relaxation factor = %g",
// Q.x(), Q.y(), Q.z(), 0.75 * relax);
return XYZToU(Q.x(), Q.y(), Q.z(), u, 0.75 * relax);
// X, Y, Z, 0.75 * relax);
return XYZToU(X, Y, Z, u, 0.75 * relax);
}
// Msg::Error("Could not converge reparametrisation of point (%e,%e,%e) on edge %d",
// Q.x(), Q.y(), Q.z(), tag());
// X, Y, Z, tag());
return false;
}
......
......@@ -184,7 +184,7 @@ class GEdge : public GEntity{
// compute the parameter U from a point XYZ
virtual bool XYZToU(const double X, const double Y, const double Z,
double &U, const double relax=0.5) const;
double &U, const double relax=1) const;
// compound
void setCompound(GEdgeCompound *gec) { compound = gec; }
......
......@@ -332,7 +332,7 @@ class GEntity {
void setAllElementsVisible(bool val){ _allElementsVisible = val ? 1 : 0; }
// get the number of mesh vertices in the entity
unsigned int getNumMeshVertices() { return (int)mesh_vertices.size(); }
unsigned int getNumMeshVertices() { return mesh_vertices.size(); }
// get the mesh vertex at the given index
MVertex *getMeshVertex(unsigned int index) { return mesh_vertices[index]; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment