Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0029775Community[OCCT] OCCT:Modeling Datapublic2018-05-15 17:422018-05-24 06:48
Assigned Tobugmaster 
Platformmingw-w64OSWindowsOS Version7
Product Version[OCCT] 7.2.0 
Target Version[OCCT] 7.3.0Fixed in Version 
Summary0029775: Modeling Data - BRepAdaptor_CompCurve Parameterization Is Incorrect
DescriptionWhen I create a BRepAdaptor_CompCurve for a wire, the evaluations at the first and the last parameter do not return the first and the last position of the wire.

It could be that this issue has already been described here: [^] and it could be that issue "0005698: Inaccurate result of D0 method in BRepAdaptor_CompCurve" describes the same problem.

Please see the pasted code. It is especially surprising for me, that the start and stop point coordinates change, if I run the snippet several times.
Steps To Reproduce// Define points
const gp_Pnt corner1(0.0, 100.0, 0.0);
const gp_Pnt point2(10.0, 100.0, 0.0);
const gp_Pnt point3(90.0, 100.0, 0.0);
const gp_Pnt corner4(100.0, 100.0, 0.0);
const gp_Pnt corner5(100.0, 0.0, 0.0);
const gp_Pnt corner6(0.0, 0.0, 0.0);
const gp_Pnt point7(0.0, 10.0, 0.0);
const gp_Pnt point8(0.0, 90.0, 0.0);

// Create wire
TopoDS_Wire wire;
BRep_Builder wireBuilder;

wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(corner1, point2));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(point2, point3));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(point3, corner4));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(corner4, corner5));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(corner5, corner6));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(corner6, point7));
wireBuilder.Add(wire, BRepBuilderAPI_MakeEdge(point7, point8));

// Create an adaptor
const BRepAdaptor_CompCurve curve(wire);

// Get the first and the last point of the wire
const gp_Pnt startPoint = curve.Value(curve.FirstParameter());
const gp_Pnt stopPoint = curve.Value(curve.LastParameter());

// Check the points
if (startPoint.Distance(corner1) > Precision::Approximation())
  std::cout << "Error! Start point: " << startPoint.X() << ", "
    << startPoint.Y() << ", " << startPoint.Z() << std::endl;

if (stopPoint.Distance(point8) > Precision::Approximation())
  std::cout << "Error! Stop point: " << stopPoint.X() << ", "
    << stopPoint.Y() << ", " << stopPoint.Z() << std::endl;
TagsNo tags attached.
Test case numberNot needed
Attached Files

- Relationships

-  Notes
msv (developer)
2018-05-15 18:16

You create invalid wire. All edges in it are not connected to each other. CompCurve must work only on valid wires where all edges are connected to each other to make a chain.
git (administrator)
2018-05-16 13:09

Branch CR29775 has been created by BenjaminBihler.

SHA-1: aa011b8906d55d6fe9dae730aefbb1a4ea731ff6

Detailed log of new commits:

Author: Benjamin Bihler
Date: Wed May 16 12:07:24 2018 +0200

    0029775: Modeling Data - BRepAdaptor_CompCurve Parameterization Is Incorrect
    Added vertex orientation requirement to class documentation of

Author: Benjamin Bihler
Date: Wed May 16 11:59:15 2018 +0200

    0029775: Modeling Data - BRepAdaptor_CompCurve Parameterization Is Incorrect
    Added wire connectivity requirement to class documentation of
BenjaminBihler (developer)
2018-05-16 13:13

Thank you very much, Mikhail. This was one of my problems. I haven't been aware of that requirement. In my real-life code I had also done the vertex orientation mistake which you have pointed to in issue 0029765.

In my humble opinition at least the first requirement should definitely be mentioned in the documentation of BRepAdaptor_CompCurve. Mentioning the other requirement might also not be wrong. I have made two commits with a documentation proposal.
msv (developer)
2018-05-16 15:13

Usually all modeling algorithms expect the shapes to be valid, at least in terms of the BRepCheck_Analyzer class. So, in general it is useless to put in documentation the statement that the input shape must be correct.

Nevertheless, I have no objection against the first commit. It sounds clear, though excess.
But the second one has ambiguous sense. It would be more right to say that the edges in the wire must also be correct. We can go much further with such explanations of requirements. But they will be so obvious that can make the reader puzzled "why is it written here?".
git (administrator)
2018-05-16 15:15

Branch CR29775 has been updated forcibly by msv.

SHA-1: ccdf6a11937a57044bcf9a201d76bf6825719cd6
msv (developer)
2018-05-16 15:16

No need to test, as only comments have been updated.
bugmaster (administrator)
2018-05-23 12:05

Comments have been updated only

- Issue History
Date Modified Username Field Change
2018-05-15 17:42 BenjaminBihler New Issue
2018-05-15 17:42 BenjaminBihler Assigned To => msv
2018-05-15 18:16 msv Note Added: 0075984
2018-05-15 18:16 msv Assigned To msv => BenjaminBihler
2018-05-15 18:16 msv Status new => feedback
2018-05-16 13:09 git Note Added: 0075990
2018-05-16 13:13 BenjaminBihler Note Added: 0075991
2018-05-16 13:13 BenjaminBihler Assigned To BenjaminBihler => msv
2018-05-16 13:13 BenjaminBihler Status feedback => resolved
2018-05-16 15:13 msv Note Added: 0075996
2018-05-16 15:15 git Note Added: 0075997
2018-05-16 15:16 msv Note Added: 0075998
2018-05-16 15:16 msv Assigned To msv => bugmaster
2018-05-16 15:16 msv Status resolved => reviewed
2018-05-23 12:05 bugmaster Note Added: 0076151
2018-05-23 12:05 bugmaster Status reviewed => tested
2018-05-23 12:32 bugmaster Test case number => Not needed
2018-05-24 06:48 abv Target Version 7.4.0* => 7.3.0

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker