MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0025852Open CASCADE[OCCT] OCCT:Visualizationpublic2015-02-23 16:162018-07-18 18:53
Reporterabv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatustestedResolutionopen 
PlatformOSOS Version
Product Version[OCCT] 6.7.0 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0025852: Visualization - Font_BRepFont produces bad faces for circled symbols
DescriptionText 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)')
Steps To Reproduce
pload MODELING VISUALIZATION
text2brep t "\u00ae" Courier 10
whatis t
vinit View1
vclear
vtop
vsetdispmode 1
vdisplay t
vfit
vmoveto 250 250
checkshape t
TagsNo tags attached.
Test case numberbugs vis bug25852
Attached Filespng file icon sign_KO.png (5,197 bytes) 2015-02-23 19:34

- Relationships
related to 0024181closedbugmaster Open CASCADE Text to BRep functionality 
related to 0024218closedbugmaster Open CASCADE ShapeFix_Face requires double execution to produce valid shape when FixSplitFaceMode is in effect 

-  Notes
(0037788)
kgv (developer)
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 (developer)
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 (tester)
2017-08-08 18:05

Problem described in issue is reproduced on current state of OCCT.
(0077488)
git (administrator)
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 (administrator)
2018-07-16 10:01

Branch CR25852 has been updated forcibly by skl.

SHA-1: 914282c7e8df69f6c4f024dc5790850ade448e25
(0077658)
git (administrator)
2018-07-16 13:34

Branch CR25852 has been updated forcibly by skl.

SHA-1: c6d268fdc8d773d8fc3ad6fbbeb9f455f18fd57e
(0077659)
git (administrator)
2018-07-16 13:45

Branch CR25852 has been updated forcibly by skl.

SHA-1: c8157bf9209069b9c7f1d96d15ad5ecfcabc82d0
(0077660)
kgv (developer)
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 (developer)
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 (developer)
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 (administrator)
2018-07-16 15:50

Branch CR25852 has been updated forcibly by skl.

SHA-1: 6a3ff22f55f11ae0690c245201fcd37afd528df5
(0077684)
skl (developer)
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 (developer)
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 (administrator)
2018-07-16 19:26

Branch CR25852 has been updated forcibly by skl.

SHA-1: 0d7b88932b73e1d8e1828204afbb41940a595d97
(0077689)
gka (developer)
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 (administrator)
2018-07-17 07:40

Branch CR25852 has been updated forcibly by skl.

SHA-1: 4311cd37130946f02ef0bf70a2fea742d524c084
(0077701)
skl (developer)
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 (developer)
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 (administrator)
2018-07-17 10:51

Branch CR25852 has been updated forcibly by skl.

SHA-1: 17e83166276644efef73af0e57dde532d675ad42
(0077705)
git (administrator)
2018-07-17 11:35

Branch CR25852 has been updated forcibly by skl.

SHA-1: 92407608d123842d07f5b96d0e8762c815d0af4d
(0077706)
skl (developer)
2018-07-17 11:37

Branches CR25852 and CR25852_prod are ready to be reviewed.
(0077707)
kgv (developer)
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 (developer)
2018-07-17 11:45

Branches CR25852 and CR25852_prod were reviewed.
(0077720)
kgv (developer)
2018-07-17 12:41

CR25852_prod still contains changes unrelated to bug.
(0077728)
skl (developer)
2018-07-17 13:47

Use branch CR25852prod instead of CR25852_prod.
(0077731)
git (administrator)
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 (developer)
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 (administrator)
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 (administrator)
2018-07-18 18:53

Retested on IR-WEEK39

- Issue History
Date Modified Username Field Change
2015-02-23 16:16 abv New Issue
2015-02-23 16:16 abv Assigned To => kgv
2015-02-23 16:16 abv Relationship added related to 0024181
2015-02-23 19:33 kgv Steps to Reproduce Updated View Revisions
2015-02-23 19:34 kgv File Added: sign_KO.png
2015-02-23 19:48 kgv Note Added: 0037788
2015-02-24 08:57 kgv Assigned To kgv => gka
2015-04-14 11:54 gka Target Version 6.9.0 => 7.0.0
2015-04-14 12:17 abv Target Version 7.0.0 => 7.1.0
2016-08-06 13:10 kgv Note Added: 0056523
2016-08-06 13:11 kgv Note Edited: 0056523 View Revisions
2016-08-06 13:11 kgv Note Edited: 0056523 View Revisions
2016-08-06 13:12 kgv Relationship added related to 0024218
2016-10-25 09:33 kgv Target Version 7.1.0 => 7.2.0
2017-07-27 09:24 abv Target Version 7.2.0 => 7.4.0*
2017-08-08 18:05 mkv Test case number => bugs vis bug25852
2017-08-08 18:05 mkv Note Added: 0069222
2018-07-09 18:08 kgv Relationship added related to 0029941
2018-07-11 11:40 kgv Assigned To gka => skl
2018-07-11 11:40 kgv Status new => assigned
2018-07-12 09:48 git Note Added: 0077488
2018-07-12 16:26 kgv Summary Text to BRep algorithm produces bad faces for circled symbols => Visualization - Font_BRepFont produces bad faces for circled symbols
2018-07-16 10:01 git Note Added: 0077645
2018-07-16 13:34 git Note Added: 0077658
2018-07-16 13:45 git Note Added: 0077659
2018-07-16 13:46 kgv Note Added: 0077660
2018-07-16 13:49 skl Note Added: 0077662
2018-07-16 13:50 skl Assigned To skl => kgv
2018-07-16 13:50 skl Status assigned => resolved
2018-07-16 13:50 skl Assigned To kgv => gka
2018-07-16 13:52 kgv Note Added: 0077663
2018-07-16 13:52 kgv Assigned To gka => skl
2018-07-16 13:52 kgv Status resolved => assigned
2018-07-16 13:52 kgv Note Edited: 0077663 View Revisions
2018-07-16 13:52 kgv Note Edited: 0077663 View Revisions
2018-07-16 13:53 kgv Note Edited: 0077663 View Revisions
2018-07-16 15:50 git Note Added: 0077676
2018-07-16 18:03 skl Note Added: 0077684
2018-07-16 18:04 skl Assigned To skl => kgv
2018-07-16 18:04 skl Status assigned => resolved
2018-07-16 18:04 skl Assigned To kgv => gka
2018-07-16 19:15 gka Note Added: 0077686
2018-07-16 19:15 gka Assigned To gka => skl
2018-07-16 19:15 gka Status resolved => assigned
2018-07-16 19:17 gka Note Edited: 0077686 View Revisions
2018-07-16 19:26 git Note Added: 0077688
2018-07-16 20:20 gka Note Added: 0077689
2018-07-17 07:40 git Note Added: 0077690
2018-07-17 10:38 skl Note Added: 0077701
2018-07-17 10:38 skl Assigned To skl => kgv
2018-07-17 10:38 skl Status assigned => resolved
2018-07-17 10:38 skl Assigned To kgv => gka
2018-07-17 10:47 kgv Note Added: 0077702
2018-07-17 10:47 kgv Assigned To gka => skl
2018-07-17 10:47 kgv Status resolved => assigned
2018-07-17 10:51 git Note Added: 0077703
2018-07-17 11:35 git Note Added: 0077705
2018-07-17 11:37 skl Note Added: 0077706
2018-07-17 11:37 skl Assigned To skl => gka
2018-07-17 11:40 kgv Note Added: 0077707
2018-07-17 11:44 gka Assigned To gka => kgv
2018-07-17 11:44 gka Status assigned => resolved
2018-07-17 11:45 gka Note Added: 0077708
2018-07-17 11:45 gka Assigned To kgv => bugmaster
2018-07-17 11:45 gka Status resolved => reviewed
2018-07-17 12:41 kgv Note Added: 0077720
2018-07-17 12:41 kgv Assigned To bugmaster => skl
2018-07-17 12:41 kgv Status reviewed => assigned
2018-07-17 13:47 skl Note Added: 0077728
2018-07-17 14:24 git Note Added: 0077731
2018-07-17 16:46 kgv Note Added: 0077745
2018-07-17 16:46 kgv Assigned To skl => bugmaster
2018-07-17 16:46 kgv Status assigned => resolved
2018-07-17 16:46 kgv Status resolved => reviewed
2018-07-17 18:41 bugmaster Note Added: 0077754
2018-07-18 18:53 bugmaster Note Added: 0077792
2018-07-18 18:53 bugmaster Status reviewed => tested


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker