MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030998Community[OCCT] OCCT:Data Exchangepublic2019-09-25 15:412020-11-26 14:49
ReporterVico Liang 
Assigned Togka 
PrioritynormalSeverityblock 
StatusacknowledgedResolutionsuspended 
PlatformOSOS Version
Product Version[OCCT] 7.4.0 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0030998: STEPCAFControl_Writer will not export shape with Identity Location if there are other partner shapes with diff Location.
Description
const Handle(ADVOCCT_OCAFApplication)& aApplication = getGlobalApplication();
Handle(TDocStd_Document) aXCAFDocument;
aApplication->NewDocument("BinXCAF", aXCAFDocument);
XCAFDoc_DocumentTool::Set(aXCAFDocument->Main());
Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aXCAFDocument->Main());
Handle(XCAFDoc_ColorTool) aColorTool = XCAFDoc_DocumentTool::ColorTool(aXCAFDocument->Main());

for(auto aIter= theGlobalObjectList; aIter->More(); aIter->Next())
{
     TDF_Label aNewShape = aShapeTool->AddShape(aIter->Shape(), Standard_False, Standard_False);
     
Quantity_Color aColor(Quantity_NameOfColor(aIter->ColorLive()));
     aColorTool->SetColor(aNewShape, aColor, XCAFDoc_ColorGen);
     TDataStd_Name::Set(aNewShape, aIter->Name());
}

// Write out
STEPCAFControl_Writer aXCAFWriter;
aXCAFWriter.SetNameMode(Standard_True);
aXCAFWriter.SetColorMode(Standard_True);
aXCAFWriter.Transfer(aXCAFDocument);
aXCAFWriter.Write(theFilePath);
aApplication->Close(aXCAFDocument);



The uploaded files contain input file: "export missing origin object.brep"
and output file: "export missing origin object.step"

NOTE: IGESCAFControl_Writer has the same issue.
TagsNo tags attached.
Test case number
Attached Files? file icon export missing origin object.brep (15,284 bytes) 2019-09-25 15:42
? file icon export missing origin object.step (7,826 bytes) 2019-09-25 15:42
jpg file icon before export in brep.jpg (404,490 bytes) 2019-09-25 15:46
jpg file icon after export in step.jpg (558,869 bytes) 2019-09-25 15:46
png file icon testres.png (20,672 bytes) 2020-10-29 08:51
? file icon bug30998.brep (15,284 bytes) 2020-11-03 14:55

- Relationships

-  Notes
(0096145)
szy (manager)
2020-10-22 17:32

For processing.
(0096354)
skl (developer)
2020-10-29 08:50

In order to reproduce mentioned problem I have prepared Draw command with following code:
    Handle(TDocStd_Document) aXCAFDocument = new TDocStd_Document("dummy");
    XCAFDoc_DocumentTool::Set(aXCAFDocument->Main());
    Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aXCAFDocument->Main());
    TopoDS_Shape aSh;
    BRep_Builder aB;
    BRepTools::Read(aSh, "export missing origin object.brep", aB);
    TDF_Label aNewShape = aShapeTool->AddShape(aSh, Standard_False, Standard_False);
    TDataStd_Name::Set(aNewShape, "TestSh");
    STEPCAFControl_Writer aXCAFWriter;
    aXCAFWriter.SetNameMode(Standard_True);
    aXCAFWriter.Transfer(aXCAFDocument);
    aXCAFWriter.Write("testres.stp");

After import a written STEP file ("testres.stp") we receive a good result (see attached image testres.png).
(0096355)
skl (developer)
2020-10-29 08:56

We can not reproduce this bug.
Please see our last comment and describe how we can reproduce mentioned problem.

(0096411)
Vico Liang (developer)
2020-10-30 17:41
edited on: 2020-11-02 13:57

Dear skl, To reproduce the issue, you have to add sub-shapes using iterator. There are two shapes in the top one.

get two shapes: aSh1,aSha2

TDF_Label aNewShape = aShapeTool->AddShape(aSh1, Standard_False, Standard_False);
TDF_Label aNewShape = aShapeTool->AddShape(aSh2, Standard_False, Standard_False);

(0096497)
skl (developer)
2020-11-03 14:57

Dear bugmaster, please add attached file bug30998.brep to repository.
(0096500)
git (administrator)
2020-11-03 15:19

Branch CR30998 has been created by skl.

SHA-1: f3b842cc4deea9beeeed38a028208efca8645a6d


Detailed log of new commits:

Author: skl
Date: Tue Nov 3 15:18:44 2020 +0300

    0030998: STEPCAFControl_Writer will not export shape with Identity Location if there are other partner shapes with diff Location.
    
    Fix + 2 Draw tests.
(0096523)
Vico Liang (developer)
2020-11-03 19:23

is it possible to add this patch to version 7.5?
(0096536)
git (administrator)
2020-11-05 13:05

Branch CR30998 has been updated forcibly by skl.

SHA-1: 53cc0fa3fbec9a309ba2e2b8062df4664130715c
(0096570)
git (administrator)
2020-11-05 18:29

Branch CR30998 has been updated forcibly by skl.

SHA-1: 6777872d829cda997906c702c185c3cf461338a6
(0096574)
git (administrator)
2020-11-06 10:34

Branch CR30998 has been updated forcibly by skl.

SHA-1: e8774137e467df1eaa5628a9b15a676a3aca1b86
(0096586)
git (administrator)
2020-11-06 13:28

Branch CR30998 has been updated forcibly by skl.

SHA-1: 2dc0f60638595233a3533c5b2b1ea27d2cc08529
(0096603)
git (administrator)
2020-11-07 16:42

Branch CR30998_2 has been created by skl.

SHA-1: 5dbc1e9d3908417098af358dc3a3c1135e56f275


Detailed log of new commits:

Author: skl
Date: Sat Nov 7 16:42:27 2020 +0300

    0030998: STEPCAFControl_Writer will not export shape with Identity Location if there are other partner shapes with diff Location.
    
    Fix + 2 tests.
(0096604)
git (administrator)
2020-11-08 08:36

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: ebc6291664a0b07751b354e424d6f6800e066093
(0096605)
git (administrator)
2020-11-08 14:22

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: 0aa42bb3efb6fe8c29a7f068b589ec468f6c2b18
(0096624)
skl (developer)
2020-11-09 15:24

Dear Vico Liang,
At present mentioned problem cannot be correctly solved within the existing structure of XCAF document. The satisfactory solution needs a change in conceptual approaches and cannot be implemented at this moment.
As workaround we can to suggest you to add whole compound to XCAF document or, if you needs to use iterator, check each shape before adding to the XCAF document and set location with default gp_Trsf if current shape hasn`t location.
We will not close this bug - we will simply postpone it until such fundamental changes becomes possible.

(0096653)
Vico Liang (developer)
2020-11-11 11:10

Dear skl,
Thanks for your suggesion. We did as the workaround with default gp_Trsf. Thanks for your hard working on this.
(0096781)
git (administrator)
2020-11-16 06:53

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: e6055b109a875e8332995c64365b83209c262af2
(0097020)
git (administrator)
2020-11-24 09:36

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: 3c76a1a31811a3430d1b061f6c9aa3df2f04e352

- Issue History
Date Modified Username Field Change
2019-09-25 15:41 Vico Liang New Issue
2019-09-25 15:41 Vico Liang Assigned To => gka
2019-09-25 15:42 Vico Liang File Added: export missing origin object.brep
2019-09-25 15:42 Vico Liang File Added: export missing origin object.step
2019-09-25 15:46 Vico Liang File Added: before export in brep.jpg
2019-09-25 15:46 Vico Liang File Added: after export in step.jpg
2019-09-25 15:48 Vico Liang Description Updated View Revisions
2019-09-25 15:52 Vico Liang Description Updated View Revisions
2019-09-25 15:52 Vico Liang Product Version => 7.4.0
2019-09-25 15:52 Vico Liang Target Version 7.5.0 => 7.4.0
2019-09-25 15:52 Vico Liang Description Updated View Revisions
2019-09-25 22:08 abv Target Version 7.4.0 => 7.5.0
2020-09-11 17:48 gka Target Version 7.5.0 => 7.6.0*
2020-10-22 17:32 szy Note Added: 0096145
2020-10-22 17:32 szy Assigned To gka => skl
2020-10-22 17:32 szy Status new => assigned
2020-10-29 08:50 skl Note Added: 0096354
2020-10-29 08:51 skl File Added: testres.png
2020-10-29 08:53 skl Assigned To skl => Vico Liang
2020-10-29 08:56 skl Note Added: 0096355
2020-10-29 08:56 skl Status assigned => feedback
2020-10-30 17:41 Vico Liang Note Added: 0096411
2020-10-30 17:41 Vico Liang Assigned To Vico Liang => skl
2020-11-02 13:57 Vico Liang Note Edited: 0096411 View Revisions
2020-11-03 14:55 skl File Added: bug30998.brep
2020-11-03 14:56 skl Status feedback => assigned
2020-11-03 14:57 skl Note Added: 0096497
2020-11-03 15:19 git Note Added: 0096500
2020-11-03 19:23 Vico Liang Note Added: 0096523
2020-11-05 13:05 git Note Added: 0096536
2020-11-05 18:29 git Note Added: 0096570
2020-11-06 10:34 git Note Added: 0096574
2020-11-06 13:28 git Note Added: 0096586
2020-11-07 16:42 git Note Added: 0096603
2020-11-08 08:36 git Note Added: 0096604
2020-11-08 14:22 git Note Added: 0096605
2020-11-09 15:24 skl Note Added: 0096624
2020-11-09 15:24 skl Status assigned => feedback
2020-11-10 07:28 skl Assigned To skl => Vico Liang
2020-11-11 11:10 Vico Liang Note Added: 0096653
2020-11-11 11:10 Vico Liang Assigned To Vico Liang => skl
2020-11-11 11:21 skl Assigned To skl => szy
2020-11-16 06:53 git Note Added: 0096781
2020-11-16 10:52 kgv Description Updated View Revisions
2020-11-24 09:36 git Note Added: 0097020
2020-11-24 17:06 szy Assigned To szy => gka
2020-11-24 17:06 szy Status feedback => acknowledged
2020-11-24 17:06 szy Resolution open => suspended


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker