View Issue Details

IDProjectCategoryView StatusLast Update
0029203Open CASCADEOCCT:Modeling Algorithmspublic2019-10-25 14:27
ReporternbvAssigned Tomsv  
Status feedbackResolutionopen 
Target VersionUnscheduled 
Summary0029203: Ambiguous behavior of Point-Face-classification algorithms: shall it return ON-status?
DescriptionSee Steps To Reproduce.

Script 1.
Different algorithms return different results.

b2dclassifx DRAW-command uses "polygonal"-classifier (based on CSLib_Class2d).
b2dclassify uses "ray"-classifier (based on BRepClass_Intersector).

Wrong ON-status is returned by the reason of poor algorithm of IntRes2d_Position computation in BRepClass_Intersector class. Correct status is OUT.

Script 2.

3D-representation of the given point is in the wire of the given face.

      Draw[]> explode ff w
      # ff_1
      Draw[]> mksurf ss ff
      Draw[]> sval ss 1.6881493482012555 3.9044196877163997 xx yy zz
      Draw[]> vertex vv xx yy zz
      Draw[]> distmini dd ff_1 vv; dval dd_val
      # 3.039106595854385e-008 < Tolerance (1.0e-7)

However, distance point-curve in 2D-space is quite big.

      Draw[]> v2d
      Draw[]> pcurve ff
      Draw[]> 2dfit
      Draw[]> 2dproj ff_7 1.6881493482012555 3.9044196877163997
      #ext_1 ext_2 ext_3
      Draw[36]> length ext_1
      # 5.9317418539273143e-006

On the current MASTER, status OUT is returned. After the fix for issue #28211, status ON will be returned.
Steps To Reproducetestgrid bug29203*

Test cases are attached to this issue.
Additional information
and documentation updates

The problem has been detected while fixing the bug #0028211 when debugging "de iges_1 O4" test case.


The problem has been detected while fixing the bug #0028211 when debugging "bugs modalg_6 bug27341_304" test case.
TagsNo tags attached.
Test case number

Attached Files

  • bug29203_transface.bin (85,016 bytes)
  • bug29203_toron.bin (5,773 bytes)
  • bug29203_1 (1,027 bytes)
  • bug29203_2 (1,107 bytes)
  • 0002-0029203-Ambiguous-behavior-of-Point-Face-classificat.patch (103,844 bytes)


related to 0029421 feedbackmsv Make face classifier algorithm stable and robust 
related to 0030365 verifiedsmoskvin Modeling Algorithms - Create tool to compute deviation between any 2D-curve and some its segment 



2017-10-11 11:27

developer   ~0071332

Fix for the issue #0028211 will not solve the problem.


2017-10-11 11:33


bug29203_transface.bin (85,016 bytes)


2017-10-11 11:35

developer   ~0071333

Test case has already been created and attached (see bug29203 file)


2017-10-19 17:27

developer   ~0071647

Last edited: 2017-10-19 18:42

In order to fix, we shall make the following steps:

1. Provide all edges on faces sent to the classification algorithm being same-parameter. It touches not only source files in test cases but intermediate results of the algorithms. It can lead to obtain huge tolerance of the edge(s). So, the face will be invalid (see #0023731).

2. Change the algorithm in BRepClass_Intersector::Perform(...) method in order to make it work with 3D-tolerance of the considered edge (not with external 3D-tolerance). Maybe, after this solution will be implemented, the external tolerance will be rejected from classifier algorithm. Currently, it is impossible to be done by the reason explained in item 1.

3. Improve the algorithm of computation of deflection between discrete polygon and source curve (see method BRepTopAdaptor_FClass2d::Init()). Currently, the computed deflection is equal to the length of projection of middle-point of arc to the chord. New algorithm can be based on GCPnts_DistFunction2d class or can use simple iteration formula (obtained if we apply Newton-algorithm to GCPnts_DistFunction2d function):


where C' and C'' are 1st and 2nd derivative of the curve, obtained in the point U(n), D - direction of the segment of the polygon.

Please note that this formula is satisfied for 2D-space only. For 3D-algorithm it will look more complexly.


Other steps must be defined dependently on regressions.


2017-10-19 18:05

developer   ~0071648

I.e. after the fix, behavior "de iges_1 O4" and "bugs modalg_6 bug27341_*" test cases will be probably changed.


2017-10-19 18:06


bug29203_toron.bin (5,773 bytes)


2017-10-20 16:40

developer   ~0071667

Concerning item 2 of the proposal, we have to leave the old behavior, so that the algorithm could work in two modes: 1) old mode when input global 3D tolerance is used for all edges, 2) new mode when each edge uses its own tolerance.


2018-01-12 14:57


bug29203_1 (1,027 bytes)


2018-01-12 14:57


bug29203_2 (1,107 bytes)


2018-01-22 13:27


0002-0029203-Ambiguous-behavior-of-Point-Face-classificat.patch (103,844 bytes)


2018-01-22 13:31

developer   ~0073555

Git-patch in the file " 0002-0029203-Ambiguous-behavior-of-Point-Face-classificat.patch" fixes described problem. However, it is based on "0001-0028211-Modeling-Algorithms-Boolean-fuse-operation-p.patch" (see message 0029421:0073554), which cannot be integrated at present.

Issue History

Date Modified Username Field Change
2017-10-11 11:26 nbv New Issue
2017-10-11 11:26 nbv Assigned To => msv
2017-10-11 11:26 nbv File Added: bug28211_transface.bin
2017-10-11 11:27 nbv Note Added: 0071332
2017-10-11 11:27 nbv Priority normal => low
2017-10-11 11:33 nbv File Deleted: bug28211_transface.bin
2017-10-11 11:33 nbv File Added: bug29203_transface.bin
2017-10-11 11:34 nbv File Added: bug29203
2017-10-11 11:35 nbv Steps to Reproduce Updated
2017-10-11 11:35 nbv Note Added: 0071333
2017-10-19 17:27 nbv Note Added: 0071647
2017-10-19 18:01 nbv Summary Different Point-Face-classification algorithms return different results => Ambiguous behavior of Point-Face-classification algorithms: shall it return ON-status?
2017-10-19 18:01 nbv Description Updated
2017-10-19 18:01 nbv Steps to Reproduce Updated
2017-10-19 18:01 nbv Additional Information Updated
2017-10-19 18:02 nbv Steps to Reproduce Updated
2017-10-19 18:05 nbv Note Added: 0071648
2017-10-19 18:06 nbv File Added: bug29203_toron.bin
2017-10-19 18:42 nbv Note Edited: 0071647
2017-10-20 16:40 msv Note Added: 0071667
2017-11-07 10:06 nbv Description Updated
2018-01-12 14:23 nbv File Deleted: bug29203
2018-01-12 14:27 nbv File Added: bug29203_1
2018-01-12 14:27 nbv File Added: bug29203_2
2018-01-12 14:28 nbv Steps to Reproduce Updated
2018-01-12 14:57 nbv File Deleted: bug29203_1
2018-01-12 14:57 nbv File Deleted: bug29203_2
2018-01-12 14:57 nbv File Added: bug29203_1
2018-01-12 14:57 nbv File Added: bug29203_2
2018-01-12 15:58 nbv Relationship added related to 0029421
2018-01-22 13:27 nbv File Added: 0002-0029203-Ambiguous-behavior-of-Point-Face-classificat.patch
2018-01-22 13:27 nbv Assigned To msv => nbv
2018-01-22 13:27 nbv Status new => feedback
2018-01-22 13:31 nbv Note Added: 0073555
2018-11-12 16:52 nbv Relationship added related to 0030365
2019-02-14 12:01 bugmaster Project Internal => Open CASCADE
2019-07-18 18:34 msv Assigned To nbv =>
2019-07-18 18:34 msv Target Version 7.4.0 => Unscheduled
2019-10-25 14:27 abv Assigned To => msv