View Issue Details

IDProjectCategoryView StatusLast Update
0030998CommunityOCCT:Data Exchangepublic2020-12-01 17:38
ReporterVico Liang Assigned Togka 
PrioritynormalSeverityblock 
Status acknowledgedResolutionsuspended 
Product Version7.4.0 
Target VersionUnscheduled 
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

  • export missing origin object.brep (15,284 bytes)
  • export missing origin object.step (7,826 bytes)
  • before export in brep.jpg (404,490 bytes)
  • after export in step.jpg (558,869 bytes)
  • testres.png (20,672 bytes)
  • bug30998.brep (15,284 bytes)

Activities

Vico Liang

2019-09-25 15:42

developer  

export missing origin object.brep (15,284 bytes)

Vico Liang

2019-09-25 15:42

developer  

export missing origin object.step (7,826 bytes)

Vico Liang

2019-09-25 15:46

developer  

before export in brep.jpg (404,490 bytes)

Vico Liang

2019-09-25 15:46

developer  

after export in step.jpg (558,869 bytes)

szy

2020-10-22 17:32

manager   ~0096145

For processing.

skl

2020-10-29 08:50

developer   ~0096354

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

skl

2020-10-29 08:51

developer  

testres.png (20,672 bytes)

skl

2020-10-29 08:56

developer   ~0096355

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

Vico Liang

2020-10-30 17:41

developer   ~0096411

Last edited: 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);

skl

2020-11-03 14:55

developer  

bug30998.brep (15,284 bytes)

skl

2020-11-03 14:57

developer   ~0096497

Dear bugmaster, please add attached file bug30998.brep to repository.

git

2020-11-03 15:19

administrator   ~0096500

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.

Vico Liang

2020-11-03 19:23

developer   ~0096523

is it possible to add this patch to version 7.5?

git

2020-11-05 13:05

administrator   ~0096536

Branch CR30998 has been updated forcibly by skl.

SHA-1: 53cc0fa3fbec9a309ba2e2b8062df4664130715c

git

2020-11-05 18:29

administrator   ~0096570

Branch CR30998 has been updated forcibly by skl.

SHA-1: 6777872d829cda997906c702c185c3cf461338a6

git

2020-11-06 10:34

administrator   ~0096574

Branch CR30998 has been updated forcibly by skl.

SHA-1: e8774137e467df1eaa5628a9b15a676a3aca1b86

git

2020-11-06 13:28

administrator   ~0096586

Branch CR30998 has been updated forcibly by skl.

SHA-1: 2dc0f60638595233a3533c5b2b1ea27d2cc08529

git

2020-11-07 16:42

administrator   ~0096603

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.

git

2020-11-08 08:36

administrator   ~0096604

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: ebc6291664a0b07751b354e424d6f6800e066093

git

2020-11-08 14:22

administrator   ~0096605

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: 0aa42bb3efb6fe8c29a7f068b589ec468f6c2b18

skl

2020-11-09 15:24

developer   ~0096624

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.

Vico Liang

2020-11-11 11:10

developer   ~0096653

Dear skl,
Thanks for your suggesion. We did as the workaround with default gp_Trsf. Thanks for your hard working on this.

git

2020-11-16 06:53

administrator   ~0096781

Branch CR30998_2 has been updated forcibly by skl.

SHA-1: e6055b109a875e8332995c64365b83209c262af2

git

2020-11-24 09:36

administrator   ~0097020

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
2019-09-25 15:52 Vico Liang Description Updated
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
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
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
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
2020-12-01 17:38 utverdov Target Version 7.6.0 => Unscheduled