return 0;
}
+static Standard_Integer checkedge(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
+{
+ if (argc < 2)
+ {
+ di<<"Call please \"checkedge edge [face]\""<<"\n";
+ return 1;
+ }
+
+ // Get edge.
+ const char* arg1 = argv[1];
+ TopoDS_Shape edge = DBRep::Get(arg1);
+ if (edge.IsNull() || edge.ShapeType() != TopAbs_EDGE)
+ {
+ di<<"A null shape or not an edge is used."<<"\n";
+ return 2;
+ }
+
+ // Get face.
+ TopoDS_Shape face;
+ if (argc == 3)
+ {
+ const char* arg2 = argv[2];
+ face = DBRep::Get(arg2);
+ if (face.IsNull() || face.ShapeType() != TopAbs_FACE)
+ {
+ di<<"A null shape or not a face is used."<<"\n";
+ return 3;
+ }
+ }
+
+ // Analysis of the edge.
+ ShapeAnalysis_Edge analyser;
+ Standard_Boolean isOk(Standard_True);
+
+ // Curve 3D.
+ if (analyser.HasCurve3d(TopoDS::Edge(edge)))
+ {
+ // Check vertices.
+ if (analyser.CheckVerticesWithCurve3d(TopoDS::Edge(edge)))
+ {
+ isOk = Standard_False;
+ di<<"Vertices of the edge don't coincide with start/end points of 3d-curve (using tolerance of the vertices).\n";
+ }
+ }
+ else
+ {
+ isOk = Standard_False;
+ di<<"Edge doesn't have a 3d-curve\n";
+ }
+
+ if (!face.IsNull())
+ {
+ // Curve 2D.
+ if (analyser.HasPCurve(TopoDS::Edge(edge), TopoDS::Face(face)))
+ {
+ // Check vertices.
+ if (analyser.CheckVerticesWithPCurve(TopoDS::Edge(edge), TopoDS::Face(face)))
+ {
+ isOk = Standard_False;
+ di<<"Vertices of the edge don't coincide with start/end points of 2d-curve (using tolerance of the vertices).\n";
+ }
+ }
+ else
+ {
+ isOk = Standard_False;
+ di<<"Edge doesn't have a 2d-curve on this face\n";
+ }
+ }
+
+ if (isOk)
+ di<<"Edge seems OK.\n";
+
+ return 0;
+}
+
//=======================================================================
//function : InitCommands
//purpose :
theCommands.Add("getareacontour","wire ",__FILE__, getareacontour, groupold);
theCommands.Add ("checkselfintersection","wire [face]", __FILE__,checkselfintersection,g);
+ theCommands.Add ("checkedge","edge [face]", __FILE__,checkedge,g);
}
if (vtx != 2) { // 1er VTX
gp_Pnt2d p1uv = c2d->Value (cf);
gp_Pnt p12d = surf->Value (p1uv.X(), p1uv.Y());
+ if (!loc.IsIdentity())
+ p12d.Transform(loc.Transformation());
// szv#4:S4163:12Mar99 optimized
if ( p1v.Distance(p12d) > (preci < 0 ? BRep_Tool::Tolerance (V1) : preci) )
myStatus |= ShapeExtend_DONE1;
if (vtx != 1) { // 2me VTX
gp_Pnt2d p2uv = c2d->Value (cl);
gp_Pnt p22d = surf->Value (p2uv.X(), p2uv.Y());
+ if (!loc.IsIdentity())
+ p22d.Transform(loc.Transformation());
// szv#4:S4163:12Mar99 optimized
if ( p2v.Distance(p22d) > (preci < 0 ? BRep_Tool::Tolerance (V2) : preci) )
myStatus |= ShapeExtend_DONE2;
--- /dev/null
+puts "============"
+puts "OCC25634"
+puts "============"
+puts ""
+######################################################
+# Checking of compliance of vertices and pcurve fails
+######################################################
+
+restore [locate_data_file bug25634_shape3.brep] s
+
+explode s e
+
+set info [checkedge s_1 s]
+
+# Resume
+puts ""
+if { [regexp {Edge seems OK.} ${info}] } {
+ puts "OK: Checking is good"
+} else {
+ puts "Error: Checking is bad"
+}