MantisBT - Open CASCADE
View Issue Details
0025852Open CASCADE[OCCT] OCCT:Visualizationpublic2015-02-23 16:162020-03-04 10:23
abv 
bugmaster 
normalminor 
closedfixed 
[OCCT] 6.7.0 
[OCCT] 7.4.0[OCCT] 7.4.0 
bugs vis bug25852
0025852: Visualization - Font_BRepFont produces bad faces for circled symbols
Text to BRep algorithm produces bad shape (single-face) for symbols that must be represented by two or more faces, located inside one, like circled symbols (e.g. circled copyright sign, '(c)')
pload MODELING VISUALIZATION
text2brep t "\u00ae" Courier 10
whatis t
vinit View1
vclear
vtop
vsetdispmode 1
vdisplay t
vfit
vmoveto 250 250
checkshape t
No tags attached.
related to 0024181closed bugmaster Open CASCADE Text to BRep functionality 
related to 0024218closed bugmaster Open CASCADE ShapeFix_Face requires double execution to produce valid shape when FixSplitFaceMode is in effect 
child of 0031401new kgv Open CASCADE Visualization - revise Toolkits dependency graph 
png sign_KO.png (5,197) 2015-02-23 19:34
https://tracker.dev.opencascade.org/
Issue History
2015-02-23 16:16abvNew Issue
2015-02-23 16:16abvAssigned To => kgv
2015-02-23 16:16abvRelationship addedrelated to 0024181
2015-02-23 19:33kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9432#r9432
2015-02-23 19:34kgvFile Added: sign_KO.png
2015-02-23 19:48kgvNote Added: 0037788
2015-02-24 08:57kgvAssigned Tokgv => gka
2015-04-14 11:54gkaTarget Version6.9.0 => 7.0.0
2015-04-14 12:17abvTarget Version7.0.0 => 7.1.0
2016-08-06 13:10kgvNote Added: 0056523
2016-08-06 13:11kgvNote Edited: 0056523bug_revision_view_page.php?bugnote_id=56523#r14351
2016-08-06 13:11kgvNote Edited: 0056523bug_revision_view_page.php?bugnote_id=56523#r14352
2016-08-06 13:12kgvRelationship addedrelated to 0024218
2016-10-25 09:33kgvTarget Version7.1.0 => 7.2.0
2017-07-27 09:24abvTarget Version7.2.0 => 7.4.0
2017-08-08 18:05mkvTest case number => bugs vis bug25852
2017-08-08 18:05mkvNote Added: 0069222
2018-07-09 18:08kgvRelationship addedrelated to 0029941
2018-07-11 11:40kgvAssigned Togka => skl
2018-07-11 11:40kgvStatusnew => assigned
2018-07-12 09:48gitNote Added: 0077488
2018-07-12 16:26kgvSummaryText to BRep algorithm produces bad faces for circled symbols => Visualization - Font_BRepFont produces bad faces for circled symbols
2018-07-16 10:01gitNote Added: 0077645
2018-07-16 13:34gitNote Added: 0077658
2018-07-16 13:45gitNote Added: 0077659
2018-07-16 13:46kgvNote Added: 0077660
2018-07-16 13:49sklNote Added: 0077662
2018-07-16 13:50sklAssigned Toskl => kgv
2018-07-16 13:50sklStatusassigned => resolved
2018-07-16 13:50sklAssigned Tokgv => gka
2018-07-16 13:52kgvNote Added: 0077663
2018-07-16 13:52kgvAssigned Togka => skl
2018-07-16 13:52kgvStatusresolved => assigned
2018-07-16 13:52kgvNote Edited: 0077663bug_revision_view_page.php?bugnote_id=77663#r19516
2018-07-16 13:52kgvNote Edited: 0077663bug_revision_view_page.php?bugnote_id=77663#r19517
2018-07-16 13:53kgvNote Edited: 0077663bug_revision_view_page.php?bugnote_id=77663#r19518
2018-07-16 15:50gitNote Added: 0077676
2018-07-16 18:03sklNote Added: 0077684
2018-07-16 18:04sklAssigned Toskl => kgv
2018-07-16 18:04sklStatusassigned => resolved
2018-07-16 18:04sklAssigned Tokgv => gka
2018-07-16 19:15gkaNote Added: 0077686
2018-07-16 19:15gkaAssigned Togka => skl
2018-07-16 19:15gkaStatusresolved => assigned
2018-07-16 19:17gkaNote Edited: 0077686bug_revision_view_page.php?bugnote_id=77686#r19527
2018-07-16 19:26gitNote Added: 0077688
2018-07-16 20:20gkaNote Added: 0077689
2018-07-17 07:40gitNote Added: 0077690
2018-07-17 10:38sklNote Added: 0077701
2018-07-17 10:38sklAssigned Toskl => kgv
2018-07-17 10:38sklStatusassigned => resolved
2018-07-17 10:38sklAssigned Tokgv => gka
2018-07-17 10:47kgvNote Added: 0077702
2018-07-17 10:47kgvAssigned Togka => skl
2018-07-17 10:47kgvStatusresolved => assigned
2018-07-17 10:51gitNote Added: 0077703
2018-07-17 11:35gitNote Added: 0077705
2018-07-17 11:37sklNote Added: 0077706
2018-07-17 11:37sklAssigned Toskl => gka
2018-07-17 11:40kgvNote Added: 0077707
2018-07-17 11:44gkaAssigned Togka => kgv
2018-07-17 11:44gkaStatusassigned => resolved
2018-07-17 11:45gkaNote Added: 0077708
2018-07-17 11:45gkaAssigned Tokgv => bugmaster
2018-07-17 11:45gkaStatusresolved => reviewed
2018-07-17 12:41kgvNote Added: 0077720
2018-07-17 12:41kgvAssigned Tobugmaster => skl
2018-07-17 12:41kgvStatusreviewed => assigned
2018-07-17 13:47sklNote Added: 0077728
2018-07-17 14:24gitNote Added: 0077731
2018-07-17 16:46kgvNote Added: 0077745
2018-07-17 16:46kgvAssigned Toskl => bugmaster
2018-07-17 16:46kgvStatusassigned => resolved
2018-07-17 16:46kgvStatusresolved => reviewed
2018-07-17 18:41bugmasterNote Added: 0077754
2018-07-18 18:53bugmasterNote Added: 0077792
2018-07-18 18:53bugmasterStatusreviewed => tested
2018-07-21 18:39bugmasterChangeset attached => occt master 3388cf17
2018-07-21 18:39bugmasterStatustested => verified
2018-07-21 18:39bugmasterResolutionopen => fixed
2018-07-21 20:02gitNote Added: 0077882
2018-07-21 20:02gitNote Added: 0077884
2020-03-04 10:23kgvRelationship addedrelated to 0031401
2020-03-04 10:23kgvRelationship replacedchild of 0031401

Notes
(0037788)
kgv   
2015-02-23 19:48   
Font_BRepFont does not perform classification of input polygons - instead it replies on the tool ShapeFix_Face to split Face into parties when needed:
  myFixer.FixWireMode()          = 1;
  myFixer.FixOrientationMode()   = 1;
  myFixer.FixSplitFaceMode()     = 1; // some glyphs might be composed from several faces


There was also a bug related to this functionality - 0024218 with symbol %, though after fixing it, code of Font_BRepFont has not been updated.
(0056523)
kgv   
2016-08-06 13:10   
(edited on: 2016-08-06 13:11)
Theoretically it is better not using ShapeFix_Face in Font_BRepFont at all, however it is not possible right now without duplicating some functionality:
https://lists.gnu.org/archive/html/freetype/2000-07/msg00004.html [^]
...the clockwise / anti-clockwise direction trick doesn't
work with all fonts. TrueType and Type 1 fonts use reverse conventions
for the inside/outside rotation. There exist fonts that do not respect
the convention of their respective format. You may also end up with
individual glyphs that are reversed compared to the rest of the same
face (usually they are "mirrored" version of another glyph, through
compositing). In theory, a badly designed fonts could even have a
glyph with two contours used with opposite conventions !!

If you want to be correct all the time, you first need to determine
the convention used in a specific glyph. See the experimental code
(#if 0) in "src/base/ftglyph.c" named "Get_Direction" or something
like that. It computes the convention by looking at the points on
the edges of the bounding box..


(0069222)
mkv   
2017-08-08 18:05   
Problem described in issue is reproduced on current state of OCCT.
(0077488)
git   
2018-07-12 09:48   
Branch CR25852 has been created by skl.

SHA-1: e311d4e5a0c89dd1f41bac70e0f164d31e934419


Detailed log of new commits:

Author: skl
Date: Thu Jul 12 09:47:02 2018 +0300

    0025852: Text to BRep algorithm produces bad faces for circled symbols
(0077645)
git   
2018-07-16 10:01   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 914282c7e8df69f6c4f024dc5790850ade448e25
(0077658)
git   
2018-07-16 13:34   
Branch CR25852 has been updated forcibly by skl.

SHA-1: c6d268fdc8d773d8fc3ad6fbbeb9f455f18fd57e
(0077659)
git   
2018-07-16 13:45   
Branch CR25852 has been updated forcibly by skl.

SHA-1: c8157bf9209069b9c7f1d96d15ad5ecfcabc82d0
(0077660)
kgv   
2018-07-16 13:46   
+    TopTools_MapOfShape usedShapes;
+    Standard_Integer nbFaces = 0;
+    while (aMapOutInts.Extent() > 0) {

Patch does not follow OCCT Coding rules in several aspects:
- Variable names (a/the).
- Brackets placement.

+      NCollection_DataMap <TopoDS_Shape, TopTools_MapOfShape>::Iterator itMOI(aMapOutInts);
+      TopoDS_Shape aW;
+      Standard_Integer maxNbOuts = -1;
+      for (; itMOI.More(); itMOI.Next()) {
...
+      TopTools_MapIteratorOfMapOfShape itIn(anIns);
+      for (; itIn.More(); itIn.Next()) {

Please declare iterator unused outside the loop within for(;;) statement.

+    NCollection_DataMap <TopoDS_Shape, TopTools_MapOfShape> aMapOutInts;
+    NCollection_DataMap <TopoDS_Shape, Standard_Integer> aMapOutLevel;

Please specify hasher explicitly for maps.
(0077662)
skl   
2018-07-16 13:49   
Branches CR25852 and CR25852_prod are ready to be reviewed.

Result of tests:
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Windows-64-VC10-opt-test-compare/2/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Debian70-64-opt-test-compare/2/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080//view/CR25852-master-SKL/view/COMPARE/job/CR25852-master-SKL-Products-Debian70-64-opt-test-compare/ [^]
(0077663)
kgv   
2018-07-16 13:52   
(edited on: 2018-07-16 13:53)
> Result of tests:
Please fix regressions first - check image difference,
I see 'j'/'i' are missing now on screenshots, and other artifacts.

(0077676)
git   
2018-07-16 15:50   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 6a3ff22f55f11ae0690c245201fcd37afd528df5
(0077684)
skl   
2018-07-16 18:03   
Branches CR25852 and CR25852_prod are ready to be reviewed.

Result of tests:
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Windows-64-VC10-opt-test-compare/3/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Debian70-64-opt-test-compare/3/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-Products-Windows-64-VC10-opt-test-compare/2/ [^]
(0077686)
gka   
2018-07-16 19:15   
(edited on: 2018-07-16 19:17)
Please to take into account remark about braces and to remove redundant cycle in the lines 564-568

(0077688)
git   
2018-07-16 19:26   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 0d7b88932b73e1d8e1828204afbb41940a595d97
(0077689)
gka   
2018-07-16 20:20   
1. Please make separate method to build faces. (lines 518- 621).

2. Map "TopTools_MapOfShape anIntWs" should be replaced on the sequence or vector of shapes because this map is used only as container for internal wires.
Please note that iteration by map can give different result from time to time.
  
3. Please retest this branch after corrections.
(0077690)
git   
2018-07-17 07:40   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 4311cd37130946f02ef0bf70a2fea742d524c084
(0077701)
skl   
2018-07-17 10:38   
Branches CR25852 and CR25852_prod are ready to be reviewed.

Result of tests:
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Windows-64-VC10-opt-test-compare/4/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-OCCT-Debian70-64-opt-test-compare/4/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-Products-Windows-64-VC10-opt-test-compare/3/ [^]
http://jenkins-test-11.nnov.opencascade.com:8080/job/CR25852-master-SKL-Products-Debian70-64-opt-test-compare/3/ [^]
(0077702)
kgv   
2018-07-17 10:47   
Once again, please follow Recommended OCCT Coding Style for name conversions, braces placement, etc:
https://dev.opencascade.org/doc/overview/html/occt_dev_guides__coding_rules.html [^]

+// =======================================================================
+// function : classifyWW
+// purpose  : auxilary for buildFaces
+// =======================================================================
+TopAbs_State classifyWW(TopoDS_Wire& W1, const TopoDS_Wire& W2, const TopoDS_Face F)
+{

Why F is not passed by reference here?
Local function should be marked with "static" and documented in usual way for declarations (//!).
(0077703)
git   
2018-07-17 10:51   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 17e83166276644efef73af0e57dde532d675ad42
(0077705)
git   
2018-07-17 11:35   
Branch CR25852 has been updated forcibly by skl.

SHA-1: 92407608d123842d07f5b96d0e8762c815d0af4d
(0077706)
skl   
2018-07-17 11:37   
Branches CR25852 and CR25852_prod are ready to be reviewed.
(0077707)
kgv   
2018-07-17 11:40   
> Branches CR25852 and CR25852_prod are ready to be reviewed.
CR25852_prod should be rebased on current master.
(0077708)
gka   
2018-07-17 11:45   
Branches CR25852 and CR25852_prod were reviewed.
(0077720)
kgv   
2018-07-17 12:41   
CR25852_prod still contains changes unrelated to bug.
(0077728)
skl   
2018-07-17 13:47   
Use branch CR25852prod instead of CR25852_prod.
(0077731)
git   
2018-07-17 14:24   
Branch CR25852_1 has been created by kgv.

SHA-1: df559a70d838febe8ff7882d8c5329b185420627


Detailed log of new commits:

Author: skl
Date: Thu Jul 12 09:47:02 2018 +0300

    0025852: Visualization - Font_BRepFont produces bad faces for circled symbols
    
    Font_BRepFont has been modified to use dedicated algorithm
    for ordering of wires based on wire classification,
    analysis of internal zones and creation few result faces (if it is needed)
    instead of relying on ShapeFix.
    
    TKService dependency from TKShHealing has been dropped.
(0077745)
kgv   
2018-07-17 16:46   
Please take the patch (CR25852_1 + CR25852prod).

http://jenkins-test-11.nnov.opencascade.com/view/CR25852_1-CR25852prod-KGV/ [^]
(0077754)
bugmaster   
2018-07-17 18:41   
Combination -
OCCT branch : CR25852_1 SHA - df559a70d838febe8ff7882d8c5329b185420627
Products branch : CR25852prod SHA - c8849f8302d55380ec8fb56caa8c26a3bfe171ae
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 17434.30999999984 / 17080.800000000007 [+2.07%]
Products
Total CPU difference: 7459.800000000037 / 7461.820000000036 [-0.03%]
Windows-64-VC10:
OCCT
---
Products
Total CPU difference: 2921.3059261999965 / 2901.743400799998 [+0.67%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0077792)
bugmaster   
2018-07-18 18:53   
Retested on IR-WEEK39
(0077882)
git   
2018-07-21 20:02   
Branch CR25852_1 has been deleted by inv.

SHA-1: df559a70d838febe8ff7882d8c5329b185420627
(0077884)
git   
2018-07-21 20:02   
Branch CR25852 has been deleted by inv.

SHA-1: 92407608d123842d07f5b96d0e8762c815d0af4d