View Issue Details

IDProjectCategoryView StatusLast Update
0005698Open CASCADEOCCT:Modeling Datapublic2006-06-29 09:15
ReportermsvAssigned Tomkk 
PrioritynormalSeveritytrivial 
Status acknowledgedResolutionsuspended 
OSAll 
Summary0005698: Inaccurate result of D0 method in BRepAdaptor_CompCurve
DescriptionTo reproduce a bug it is needed to create an object of type
BRepAdaptor_CompCurve parameterised by curvulinear abscissa.

E.g., consider the following source code of a Draw command:
//----------------------------------------------------------
static int mytest(Draw_Interpretor& di, int n, char** a)
{
  if (n < 2) {
    cout<<"missing parameter - wire"<<endl;
    return 1;
  }
  TopoDS_Shape shape = DBRep::Get(a[1],TopAbs_WIRE);
  if (shape.IsNull())
    return 1;
  TopoDS_Wire wire = TopoDS::Wire(shape);
  // create curve parameterised by curvilinear distance
  BRepAdaptor_CompCurve curve(wire,Standard_True);
  double length = curve.LastParameter();
  double need_length = length/2;
  gp_Pnt pnt;
  curve.D0(need_length,pnt);
  // create check_curve parameterised in a general way
  BRepAdaptor_CompCurve check_curve(wire);
  double check_par =
    GCPnts_AbscissaPoint(check_curve, need_length, 0).Parameter();
  gp_Pnt check_pnt;
  check_curve.D0(check_par,check_pnt);
  // check that points are coinsiding
  double error_dist = pnt.Distance(check_pnt);
  if (error_dist > Precision::Confusion()) {
    cout.precision(3);
    cout<<"error_dist="<<error_dist<<
      " ("<<error_dist/need_length*100<<"%)"<<endl;
    return 1;
  }
  return 0;
}
//----------------------------------------------------------

Run it with the attached shape (wire.brep) as argument.
Normally it must return the code 0 with no output, but this command in the
current version of OCCT returns the code 1 and gives the following output:

error_dist=25.5 (1.64%)

The cause of the bug is in linear interpolation of parameters on edges made in
the method Prepare().
TagsNo tags attached.
Test case number

Attached Files

  • wire.brep.gz (5,370 bytes)
  • OCC5698_msv_patch.tar.gz (3,458 bytes)

Activities

2004-04-14 14:42

 

wire.brep.gz (5,370 bytes)

2004-04-14 14:43

 

OCC5698_msv_patch.tar.gz (3,458 bytes)

Issue History

Date Modified Username Field Change
2004-08-03 18:10 bugmaster Product Version 5.1.2 => dev
2004-08-03 18:10 bugmaster Assigned To bugmaster => mkk
2004-08-03 18:10 bugmaster Status new => assigned
2004-08-04 09:47 bugmaster Status assigned => closed
2004-08-04 09:47 bugmaster Resolution @0@ => suspended
2004-08-04 09:47 bugmaster validate => 1
2011-08-02 11:32 bugmaster Category OCCT:MOD => OCCT:Modeling Data