View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0031319 | Community | OCCT:Modeling Algorithms | public | 2020-01-24 12:34 | 2023-08-01 15:08 |
Reporter | BenjaminBihler | Assigned To | |||
Priority | normal | Severity | minor | ||
Status | new | Resolution | open | ||
Platform | A | OS | L | ||
Product Version | 7.4.0 | ||||
Target Version | Unscheduled | ||||
Summary | 0031319: Modeling Algorithms - BRepExtrema_DistShapeShape won't find all intersections | ||||
Description | I have an example of a wire and an edge that intersect two times (with their intersection positions being far away from each other), but BRepExtrema_DistShapeShape finds only one of the intersections. Please see the code in "Steps To Reproduce". | ||||
Steps To Reproduce | #include <BRepAdaptor_CompCurve.hxx> #include <BRepAdaptor_Curve.hxx> #include <BRepBuilderAPI_MakeEdge.hxx> #include <BRepBuilderAPI_MakeVertex.hxx> #include <BRepCheck_Analyzer.hxx> #include <BRepExtrema_DistShapeShape.hxx> #include <BRepTools.hxx> #include <BRep_Builder.hxx> #include <Precision.hxx> #include <ShapeFix_Edge.hxx> #include <TopExp_Explorer.hxx> #include <TopoDS.hxx> #include <TopoDS_Edge.hxx> #include <TopoDS_Wire.hxx> #include <iostream> int main(int, char**) { BRep_Builder builder; TopoDS_Wire wire; { TopoDS_Shape shape; BRepTools::Read(shape, "Wire.brep", builder); for (TopExp_Explorer wireExplorer(shape, TopAbs_WIRE); wireExplorer.More(); wireExplorer.Next()) { wire = TopoDS::Wire(wireExplorer.Current()); break; } if (wire.IsNull()) { std::cerr << "Wire is null." << std::endl; exit(1); } BRepCheck_Analyzer wireAnalyzer(wire); if (!wireAnalyzer.IsValid()) { std::cerr << "Wire is invalid." << std::endl; exit(1); } } TopoDS_Edge edge; { TopoDS_Shape shape; BRepTools::Read(shape, "Edge.brep", builder); for (TopExp_Explorer edgeExplorer(shape, TopAbs_EDGE); edgeExplorer.More(); edgeExplorer.Next()) { edge = TopoDS::Edge(edgeExplorer.Current()); break; } if (edge.IsNull()) { std::cerr << "Edge is null." << std::endl; exit(1); } BRepCheck_Analyzer edgeAnalyzer(edge); if (!edgeAnalyzer.IsValid()) { std::cerr << "Edge is invalid." << std::endl; exit(1); } } BRepExtrema_DistShapeShape distanceComputer; distanceComputer.SetFlag(Extrema_ExtFlag_MIN); distanceComputer.LoadS1(wire); distanceComputer.LoadS2(edge); distanceComputer.Perform(); if (!distanceComputer.IsDone()) { std::cerr << "Calculation failed." << std::endl; exit(1); } std::cout << "There are " << distanceComputer.NbSolution() << " solutions, two solutions are expected!" << std::endl; return 0; } | ||||
Tags | No tags attached. | ||||
Test case number | |||||
|
Edge.brep (470 bytes) |
|
Wire.brep (23,454 bytes) |
|
The described problem appears quite often with the given wire. If necessary I can show more edges whose intersections are partially missed. |
|
If we make the edge shorter (in bounds of the wire) then both solutions are found. If we change the order of arguments then also both solutions are found. It is obviously the bug in extrema algo. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-01-24 12:34 | BenjaminBihler | New Issue | |
2020-01-24 12:34 | BenjaminBihler | Assigned To | => msv |
2020-01-24 12:34 | BenjaminBihler | File Added: Edge.brep | |
2020-01-24 12:34 | BenjaminBihler | File Added: Wire.brep | |
2020-01-27 14:13 | BenjaminBihler | Note Added: 0090074 | |
2020-01-27 17:18 |
|
Note Added: 0090077 | |
2020-09-15 12:36 |
|
Target Version | 7.5.0 => 7.6.0 |
2021-08-29 18:53 |
|
Target Version | 7.6.0 => 7.7.0 |
2022-10-24 10:42 |
|
Target Version | 7.7.0 => 7.8.0 |
2023-08-01 15:08 | dpasukhi | Target Version | 7.8.0 => Unscheduled |