View Issue Details

IDProjectCategoryView StatusLast Update
0025852Open CASCADEOCCT:Visualizationpublic2020-03-04 10:23
Reporterabv Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.7.0 
Target Version7.4.0Fixed in Version7.4.0 
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 Files

  • sign_KO.png (5,197 bytes)

Relationships

related to 0024181 closedbugmaster Open CASCADE Text to BRep functionality 
related to 0024218 closedbugmaster Open CASCADE ShapeFix_Face requires double execution to produce valid shape when FixSplitFaceMode is in effect 
child of 0031401 newkgv Open CASCADE Visualization - revise Toolkits dependency graph 

Activities

kgv

2015-02-23 19:34

developer  

sign_KO.png (5,197 bytes)

kgv

2015-02-23 19:48

developer   ~0037788

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.

kgv

2016-08-06 13:10

developer   ~0056523

Last edited: 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..


mkv

2017-08-08 18:05

tester   ~0069222

Problem described in issue is reproduced on current state of OCCT.

git

2018-07-12 09:48

administrator   ~0077488

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

git

2018-07-16 10:01

administrator   ~0077645

Branch CR25852 has been updated forcibly by skl.

SHA-1: 914282c7e8df69f6c4f024dc5790850ade448e25

git

2018-07-16 13:34

administrator   ~0077658

Branch CR25852 has been updated forcibly by skl.

SHA-1: c6d268fdc8d773d8fc3ad6fbbeb9f455f18fd57e

git

2018-07-16 13:45

administrator   ~0077659

Branch CR25852 has been updated forcibly by skl.

SHA-1: c8157bf9209069b9c7f1d96d15ad5ecfcabc82d0

kgv

2018-07-16 13:46

developer   ~0077660

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

skl

2018-07-16 13:49

developer   ~0077662

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/

kgv

2018-07-16 13:52

developer   ~0077663

Last edited: 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.

git

2018-07-16 15:50

administrator   ~0077676

Branch CR25852 has been updated forcibly by skl.

SHA-1: 6a3ff22f55f11ae0690c245201fcd37afd528df5

skl

2018-07-16 18:03

developer   ~0077684

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/

gka

2018-07-16 19:15

developer   ~0077686

Last edited: 2018-07-16 19:17

Please to take into account remark about braces and to remove redundant cycle in the lines 564-568

git

2018-07-16 19:26

administrator   ~0077688

Branch CR25852 has been updated forcibly by skl.

SHA-1: 0d7b88932b73e1d8e1828204afbb41940a595d97

gka

2018-07-16 20:20

developer   ~0077689

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.

git

2018-07-17 07:40

administrator   ~0077690

Branch CR25852 has been updated forcibly by skl.

SHA-1: 4311cd37130946f02ef0bf70a2fea742d524c084

skl

2018-07-17 10:38

developer   ~0077701

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/

kgv

2018-07-17 10:47

developer   ~0077702

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 (//!).

git

2018-07-17 10:51

administrator   ~0077703

Branch CR25852 has been updated forcibly by skl.

SHA-1: 17e83166276644efef73af0e57dde532d675ad42

git

2018-07-17 11:35

administrator   ~0077705

Branch CR25852 has been updated forcibly by skl.

SHA-1: 92407608d123842d07f5b96d0e8762c815d0af4d

skl

2018-07-17 11:37

developer   ~0077706

Branches CR25852 and CR25852_prod are ready to be reviewed.

kgv

2018-07-17 11:40

developer   ~0077707

> Branches CR25852 and CR25852_prod are ready to be reviewed.
CR25852_prod should be rebased on current master.

gka

2018-07-17 11:45

developer   ~0077708

Branches CR25852 and CR25852_prod were reviewed.

kgv

2018-07-17 12:41

developer   ~0077720

CR25852_prod still contains changes unrelated to bug.

skl

2018-07-17 13:47

developer   ~0077728

Use branch CR25852prod instead of CR25852_prod.

git

2018-07-17 14:24

administrator   ~0077731

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.

kgv

2018-07-17 16:46

developer   ~0077745

Please take the patch (CR25852_1 + CR25852prod).

http://jenkins-test-11.nnov.opencascade.com/view/CR25852_1-CR25852prod-KGV/

bugmaster

2018-07-17 18:41

administrator   ~0077754

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

bugmaster

2018-07-18 18:53

administrator   ~0077792

Retested on IR-WEEK39

git

2018-07-21 20:02

administrator   ~0077882

Branch CR25852_1 has been deleted by inv.

SHA-1: df559a70d838febe8ff7882d8c5329b185420627

git

2018-07-21 20:02

administrator   ~0077884

Branch CR25852 has been deleted by inv.

SHA-1: 92407608d123842d07f5b96d0e8762c815d0af4d

Related Changesets

occt: master 3388cf17

2018-07-12 06:47:02

skl


Committer: bugmaster Details Diff
0025852: Visualization - Font_BRepFont produces bad faces for circled symbols

Font_BRepFont now uses a dedicated algorithm for text-to-BRep transformation instead of relying on ShapeFix.
It orders wires based on wire classification, analyzes internal zones and creates a few faces (if needed).
TKService dependency from TKShHealing has been dropped.
Affected Issues
0025852
mod - src/Font/Font_BRepFont.cxx Diff File
mod - src/Font/Font_BRepFont.hxx Diff File
mod - src/TKService/EXTERNLIB Diff File
mod - tests/bugs/vis/bug25852 Diff File

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
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
2016-08-06 13:11 kgv Note Edited: 0056523
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-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
2018-07-16 13:52 kgv Note Edited: 0077663
2018-07-16 13:53 kgv Note Edited: 0077663
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
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
2018-07-21 18:39 bugmaster Changeset attached => occt master 3388cf17
2018-07-21 18:39 bugmaster Status tested => verified
2018-07-21 18:39 bugmaster Resolution open => fixed
2018-07-21 20:02 git Note Added: 0077882
2018-07-21 20:02 git Note Added: 0077884
2020-03-04 10:23 kgv Relationship added related to 0031401
2020-03-04 10:23 kgv Relationship replaced child of 0031401