View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0027565 | Community | OCCT:Modeling Algorithms | public | 2016-06-02 19:13 | 2016-12-09 16:39 |
Reporter | BenjaminBihler | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | VC++ 2015 | ||
Product Version | 7.0.0 | ||||
Target Version | 7.1.0 | Fixed in Version | 7.1.0 | ||
Summary | 0027565: [Regression to OCCT 7.0.0] Number of Intersections Is Wrong | ||||
Description | The issue was introduced in revision e64622331f0d16e29689c51f3fff6be638af2092. Up to revision 264abd72f2508894ff6d514f2d9ff5c2443656f8 two intersections (solutions) have been reported for a given wire and edge. But now only one intersection is reported, even though there are obviously two intersections. | ||||
Steps To Reproduce | I will upload two files: Curve.stp and Wire.stp. If you run the following code, you will see the number of solutions(it should be two): #include <TopoDS_Wire.hxx> #include <TopoDS_Edge.hxx> #include <BRepExtrema_DistShapeShape.hxx> #include <TopoDS.hxx> #include <STEPControl_Reader.hxx> #include <Precision.hxx> #include <TopExp_Explorer.hxx> #include <string> #include <vector> #include <iostream> std::vector<TopoDS_Shape> importStep(const std::string file) { std::vector<TopoDS_Shape> shapes; STEPControl_Reader reader; IFSelect_ReturnStatus status = reader.ReadFile(file.c_str()); if (status == IFSelect_RetDone) { //Interface_TraceFile::SetDefault(); bool failsonly = false; reader.PrintCheckLoad(failsonly, IFSelect_ItemsByEntity); int rootsNumber = reader.NbRootsForTransfer(); reader.PrintCheckTransfer(failsonly, IFSelect_ItemsByEntity); for (Standard_Integer rootIndex = 1; rootIndex <= rootsNumber; rootIndex++) { //bool ok = reader.TransferRoot(rootIndex); int shapesNumber = reader.NbShapes(); if (shapesNumber > 0) { for (int shapeIndex = 1; shapeIndex <= shapesNumber; shapeIndex++) { TopoDS_Shape shape = reader.Shape(shapeIndex); shapes.push_back(shape); } } } } else { throw "Could not read in file."; } return shapes; } int main(int, char**) { std::vector<TopoDS_Shape> shapes = importStep("Curve.stp"); TopoDS_Edge curve1; for (const auto& shape : shapes) { std::cout << "Searching edges." << std::endl; for (TopExp_Explorer edgeExplorer(shape, TopAbs_EDGE, TopAbs_WIRE); edgeExplorer.More(); edgeExplorer.Next()) { std::cout << "Edge found." << std::endl; curve1 = TopoDS::Edge(edgeExplorer.Current()); } } shapes = importStep("Wire.stp"); TopoDS_Wire curve2; for (const auto& shape : shapes) { std::cout << "Searching wires." << std::endl; for (TopExp_Explorer wireExplorer(shape, TopAbs_WIRE); wireExplorer.More(); wireExplorer.Next()) { std::cout << "Wire found." << std::endl; curve2 = TopoDS::Wire(wireExplorer.Current()); } } std::cout << "Curve 1 is null: " << curve1.IsNull() << std::endl; std::cout << "Curve 2 is null: " << curve2.IsNull() << std::endl; BRepExtrema_DistShapeShape extremaShape(curve2, curve1, 1.0, Extrema_ExtFlag_MIN); extremaShape.Perform(); if (!extremaShape.IsDone()) { std::cerr << "Computation has failed." << std::endl; } std::cout << "There are " << extremaShape.NbSolution() << " solutions." << std::endl; return 0; } # Test bugs moddata_3 bug27565 | ||||
Tags | No tags attached. | ||||
Test case number | bugs moddata_3 bug27565 | ||||
|
Curve.stp (157,370 bytes) |
|
Wire.stp (180,450 bytes) |
|
Benjamin, please note that Extrema does not seek for intersections but for extremum, actually for the point of minimal distance. It can be quite expected for it to find single point, even if two objects have several extremums. Alexander, could you please have a look? |
|
Andrey, thanks for your hint. But if I use a large deflection value (like 1.0 in my example), doesn't that mean that I should get all local distance minima that are within a 1.0 surrounding of the global minimum? |
2016-06-03 20:06 developer |
bug27565.brep (203,676 bytes) |
|
Branch CR27565 has been created by aml. SHA-1: 548aa6ceb0bd314bc0dc53a3b746fd1d44c4147f Detailed log of new commits: Author: aml Date: Fri Jun 3 20:08:00 2016 +0300 0027565: [Regression to OCCT 7.0.0] Number of Intersections Is Wrong Incorrect tolerance management is fixed. |
|
Branch CR27565 has been updated forcibly by aml. SHA-1: 71223613f4e46817f33a69910d398e598407e557 |
|
Dear msv, I confirm the problem. The problem was inside of duplicates handling algorithm. Method "Upper" was used instead of "Last" ("Lower" instead of "First") in computation of a scale coefficient. Please check current state of the CR27565 branch. |
|
Fix is OK. Remark is to the test. It is better to extend functionality of the command distmini instead of adding a new QA command. |
|
Branch CR27565 has been updated forcibly by aml. SHA-1: 673725507c65191774b2a470c3c1b3b198220e02 |
|
Dear msv, Please check current state of the CR27565 branch. |
|
Reviewed. |
|
Dear BugMaster, Branch CR27565 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested. SHA-1: 673725507c65191774b2a470c3c1b3b198220e02 Number of compiler warnings: occt component: Linux: 0 (0 on master) Windows: 0 (0 on master) MacOS: 0 (0 on master) products component: Linux: 72 Windows: 4 MacOS: 1153 Regressions/Differences: Not detected Testing cases: bugs moddata_3 bug27565 - OK http://occt-tests/CR27565-master-OCCT/Debian70-64/bugs/moddata_3/bug27565.html http://occt-tests/CR27565-master-OCCT/Windows-64-VC10/bugs/moddata_3/bug27565.html Testing on Linux: Total MEMORY difference: 89903262 / 88754430 [+1.29%] Total CPU difference: 19741.00000000013 / 19850.559999999932 [-0.55%] Testing on Windows: Total MEMORY difference: 55951520 / 55967213 [-0.03%] Total CPU difference: 18347.776813198805 / 18470.736801398853 [-0.67%] |
|
Branch CR27565 has been deleted by inv. SHA-1: 673725507c65191774b2a470c3c1b3b198220e02 |
occt: master f84bf635 2016-06-03 17:08:00
Committer: bugmaster Details Diff |
0027565: [Regression to OCCT 7.0.0] Number of Intersections Is Wrong Incorrect tolerance management is fixed. Test case is added. |
Affected Issues 0027565 |
|
mod - src/BRepTest/BRepTest_ExtremaCommands.cxx | Diff File | ||
mod - src/Extrema/Extrema_GenExtCC.gxx | Diff File | ||
add - tests/bugs/moddata_3/bug27565 | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-06-02 19:13 | BenjaminBihler | New Issue | |
2016-06-02 19:13 | BenjaminBihler | Assigned To | => msv |
2016-06-02 19:13 | BenjaminBihler | File Added: Curve.stp | |
2016-06-02 19:13 | BenjaminBihler | File Added: Wire.stp | |
2016-06-02 19:21 |
|
Assigned To | msv => aml |
2016-06-02 19:21 |
|
Status | new => assigned |
2016-06-02 19:25 |
|
Note Added: 0054654 | |
2016-06-02 19:33 | BenjaminBihler | Note Added: 0054655 | |
2016-06-03 20:06 |
|
File Added: bug27565.brep | |
2016-06-03 20:29 | git | Note Added: 0054704 | |
2016-06-03 20:30 | git | Note Added: 0054705 | |
2016-06-03 20:37 |
|
Note Added: 0054706 | |
2016-06-03 20:37 |
|
Assigned To | aml => msv |
2016-06-03 20:37 |
|
Status | assigned => resolved |
2016-06-03 20:37 |
|
Steps to Reproduce Updated | |
2016-06-04 01:06 |
|
Note Added: 0054707 | |
2016-06-04 01:06 |
|
Assigned To | msv => aml |
2016-06-04 01:06 |
|
Status | resolved => assigned |
2016-06-06 10:07 | git | Note Added: 0054710 | |
2016-06-06 10:09 |
|
Note Added: 0054711 | |
2016-06-06 10:09 |
|
Assigned To | aml => msv |
2016-06-06 10:09 |
|
Status | assigned => resolved |
2016-06-06 15:59 |
|
Note Added: 0054734 | |
2016-06-06 15:59 |
|
Assigned To | msv => bugmaster |
2016-06-06 15:59 |
|
Status | resolved => reviewed |
2016-06-06 16:06 |
|
Assigned To | bugmaster => apv |
2016-06-08 14:28 |
|
Test case number | => bugs moddata_3 bug27565 |
2016-06-08 15:10 |
|
Note Added: 0054802 | |
2016-06-08 15:10 |
|
Assigned To | apv => bugmaster |
2016-06-08 15:10 |
|
Status | reviewed => tested |
2016-06-08 15:10 |
|
Note Edited: 0054802 | |
2016-06-10 13:12 | bugmaster | Changeset attached | => occt master f84bf635 |
2016-06-10 13:12 | bugmaster | Status | tested => verified |
2016-06-10 13:12 | bugmaster | Resolution | open => fixed |
2016-06-17 12:14 | git | Note Added: 0055149 | |
2016-12-09 16:30 |
|
Status | verified => closed |
2016-12-09 16:39 |
|
Fixed in Version | => 7.1.0 |