MantisBT - Community
View Issue Details
0031618Community[OCCT] OCCT:Data Exchangepublic2020-06-18 18:122020-07-25 14:03
kgv 
bugmaster 
normalminor 
verifiedfixed 
[OCCT] 7.4.0 
[OCCT] 7.5.0* 
Not required
0031618: Data Exchange, RWGltf_CafWriter - exporting some models produces glTF files not passing validation
RWGltf_CafWriter produces invalid glTF files for some models:
https://www.opencascade.com/comment/21591 [^]

{
  "name": "",
  "primitives": [] // not supposed to be empty
}
pload XDE OCAF VISUALIZATION
ReadStep D io1-tu-203.stp
vinit View
XDisplay -dispMode 1 D
vfit
WriteGltf D test.gltf
No tags attached.
child of 0030953verified bugmaster Open CASCADE Data Exchange - implement export of mesh data into glTF 2.0 format 
zip io1-tu-203.zip (37,331) 2020-06-18 18:12
https://tracker.dev.opencascade.org/
Issue History
2020-06-18 18:12kgvNew Issue
2020-06-18 18:12kgvAssigned To => kgv
2020-06-18 18:12kgvAssigned Tokgv => mkrylova
2020-06-18 18:12kgvStatusnew => assigned
2020-06-18 18:12kgvProduct Version => 7.4.0
2020-06-18 18:12kgvFile Added: io1-tu-203.zip
2020-06-18 18:14kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23045#r23045
2020-06-18 18:15kgvRelationship addedrelated to 0030325
2020-06-18 18:16kgvRelationship addedchild of 0030953
2020-07-14 16:52gitNote Added: 0093138
2020-07-14 21:19mkrylovaAssigned Tomkrylova => osa
2020-07-14 21:19mkrylovaStatusassigned => resolved
2020-07-15 13:06kgvNote Added: 0093144
2020-07-15 13:07kgvAssigned Toosa => mkrylova
2020-07-15 13:07kgvStatusresolved => assigned
2020-07-20 16:58gitNote Added: 0093201
2020-07-20 16:58mkrylovaAssigned Tomkrylova => osa
2020-07-20 16:58mkrylovaStatusassigned => resolved
2020-07-21 09:37osaNote Added: 0093218
2020-07-21 09:38osaAssigned Toosa => mkrylova
2020-07-21 10:06kgvNote Added: 0093219
2020-07-21 16:55gitNote Added: 0093234
2020-07-21 22:40kgvNote Added: 0093243
2020-07-21 22:40kgvAssigned Tomkrylova => bugmaster
2020-07-21 22:40kgvStatusresolved => reviewed
2020-07-25 13:22bugmasterNote Added: 0093317
2020-07-25 13:22bugmasterStatusreviewed => tested
2020-07-25 13:34bugmasterTest case number => Not required
2020-07-25 13:57bugmasterChangeset attached => occt master b011420f
2020-07-25 13:57bugmasterStatustested => verified
2020-07-25 13:57bugmasterResolutionopen => fixed
2020-07-25 14:02gitNote Added: 0093333
2020-07-25 14:02gitNote Added: 0093339
2020-07-25 14:03gitNote Added: 0093349

Notes
(0093138)
git   
2020-07-14 16:52   
Branch CR31618 has been created by mkrylova.

SHA-1: bf958cf0dec61ab1727fc7feb95fd88811890edd


Detailed log of new commits:

Author: mkrylova
Date: Tue Jul 14 16:49:41 2020 +0300

    0031618: Data Exchange, RWGltf_CafWriter - exporting some models produces glTF files not passing validation
    
    Added a check for non-empty mesh
(0093144)
kgv   
2020-07-15 13:06   
+    RWMesh_FaceIterator aFaceIter(aDocNode.RefLabel, TopLoc_Location(), true, aDocNode.Style);
+    if (!aFaceIter.More())
+    {
+      continue;
+    }

When initializing RWMesh_FaceIterator only to check if there are any faces to export, there is no point to dispatch colors (3rd argument in constructor), thus it could be set to FALSE.
As aFaceIter is not used further in the block, please move it into {} to limit visibility and release unused variable.

Ignoring data silently is undesired. If exporting model does not generated any warning - please add it.

> Message::SendWarning (TCollection_AsciiString ("RWGltf_CafWritere skipped node '") + aNodeName + "' without triangulation data");
(0093201)
git   
2020-07-20 16:58   
Branch CR31618_1 has been created by mkrylova.

SHA-1: 8d52a14d7b0d3a5d25b2aaaa94f1c3747935b56b


Detailed log of new commits:

Author: mkrylova
Date: Tue Jul 14 16:49:41 2020 +0300

    0031618: Data Exchange, RWGltf_CafWriter - exporting some models produces glTF files not passing validation
    
    Added a check for non-empty mesh and new warning
    that notifies about skipping an empty node
(0093218)
osa   
2020-07-21 09:37   
+ Message::SendWarning(TCollection_AsciiString("RWGltf_CafWriter skipped node '") + aNodeName + "' without triangulation data");

Please not forget spaces before parenthesis.

+ if (!aFaceIter.More())
+ {
+ continue;
+ }

Maybe it will be better to add some warning here too (if exporting model has not generated it yet)
(0093219)
kgv   
2020-07-21 10:06   
> Maybe it will be better to add some warning here too
> (if exporting model has not generated it yet)
I suppose this will duplicate the message.
(0093234)
git   
2020-07-21 16:55   
Branch CR31618_2 has been created by mkrylova.

SHA-1: c16d3f5544dfa6cb5fd7325c6a5c0ad95676b916


Detailed log of new commits:

Author: mkrylova
Date: Tue Jul 14 16:49:41 2020 +0300

    0031618: Data Exchange, RWGltf_CafWriter - exporting some models produces glTF files not passing validation
    
    Added a check for non-empty mesh and new warning
    that notifies about skipping an empty node
(0093243)
kgv   
2020-07-21 22:40   
Please raise the patch in OCCT branch CR31618_2.
(0093317)
bugmaster   
2020-07-25 13:22   
Combination -
OCCT branch : IR-2020-07-24
master SHA - 4c7a3faef5f292475c23ee615ad49d57fc039b58
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-07-24 SHA - be95aa91db3bd344c872901349e58022d3c687fc
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:
Debian80-64:
OCCT
Total CPU difference: 17271.39000000011 / 17230.04000000007 [+0.24%]
Products
Total CPU difference: 800.6699999999917 / 791.7399999999936 [+1.13%]
Windows-64-VC14:
OCCT
Total CPU difference: 18742.140625 / 18745.390625 [-0.02%]
Products
Total CPU difference: 1329.234375 / 1321.390625 [+0.59%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0093333)
git   
2020-07-25 14:02   
Branch CR31618_2 has been deleted by inv.

SHA-1: c16d3f5544dfa6cb5fd7325c6a5c0ad95676b916
(0093339)
git   
2020-07-25 14:02   
Branch CR31618_1 has been deleted by inv.

SHA-1: 8d52a14d7b0d3a5d25b2aaaa94f1c3747935b56b
(0093349)
git   
2020-07-25 14:03   
Branch CR31618 has been deleted by inv.

SHA-1: bf958cf0dec61ab1727fc7feb95fd88811890edd