View Issue Details

IDProjectCategoryView StatusLast Update
0029775CommunityOCCT:Modeling Datapublic2018-06-29 21:18
ReporterBenjaminBihler Assigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Platformmingw-w64OSWindows 
Product Version7.2.0 
Target Version7.3.0Fixed in Version7.3.0 
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: https://www.opencascade.com/content/wrong-first-and-lastparameter-using-brepadaptorcompcurve 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.MakeWire(wire);

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

Activities

msv

2018-05-15 18:16

developer   ~0075984

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

2018-05-16 13:09

administrator   ~0075990

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
    BRepAdaptor_CompCurve.

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
    BRepAdaptor_CompCurve.

BenjaminBihler

2018-05-16 13:13

developer   ~0075991

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

2018-05-16 15:13

developer   ~0075996

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

2018-05-16 15:15

administrator   ~0075997

Branch CR29775 has been updated forcibly by msv.

SHA-1: ccdf6a11937a57044bcf9a201d76bf6825719cd6

msv

2018-05-16 15:16

developer   ~0075998

Reviewed.
No need to test, as only comments have been updated.

bugmaster

2018-05-23 12:05

administrator   ~0076151

Comments have been updated only

git

2018-06-23 13:56

administrator   ~0076949

Branch CR29775 has been deleted by kgv.

SHA-1: ccdf6a11937a57044bcf9a201d76bf6825719cd6

Related Changesets

occt: master 340549b0

2018-05-16 09:59:15

abv


Committer: abv Details Diff
0029775: Modeling Data - BRepAdaptor_CompCurve Parameterization Is Incorrect

Added wire connectivity requirement to class documentation of
BRepAdaptor_CompCurve.
Affected Issues
0029775
mod - src/BRepAdaptor/BRepAdaptor_CompCurve.hxx Diff File

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
2018-05-24 16:02 abv Changeset attached => occt master 340549b0
2018-05-24 16:02 abv Assigned To bugmaster => abv
2018-05-24 16:02 abv Status tested => verified
2018-05-24 16:02 abv Resolution open => fixed
2018-06-23 13:56 git Note Added: 0076949
2018-06-29 21:13 aiv Fixed in Version => 7.3.0
2018-06-29 21:18 aiv Status verified => closed