STEP export: Assemblies and Hierarchy

Hi,

I have the following problem when exporting an XDE document to STEP-AP via STEPCAFControl_Writer in OCC 6.3:

When there are nested assemblies, (e.g. assembly1 is father of assembly2), the child-assemblies are exported only if they have a sibling (which is in my tests a simple shape).

So, when the structure in the XDE document is this:

assembly1
|
+-- assembly2
|
+-- shape1
+-- shape2

the assembly2 and the shapes are not exported to STEP.

But when the structure is this:

assembly1
|
+-- assembly2
| |
| +-- shape1
| +-- shape2
|
+-- shape3

then everything is fine.

Is this a common problem or just mine? Does someone have a suggestion?

Thanks for taking a look!

mz's picture

Oops - bad formatting.

I try again. The non-working structure is this:

assembly1
|
+-- assembly2
----- shape1
----- shape2

The working structure is this

assembly1
|
+-- assembly2
|----- shape1
|----- shape2
|
+-- shape3

mz's picture

Hi,

to make it easier to take a look, here is a code snippet which produces an XDE document-structure that can't be exported:

gp_Trsf t0;
TopLoc_Location location0(t0);
Handle_XCAFDoc_ShapeTool shapeTool = XCAFDoc_DocumentTool::ShapeTool(xdeDoc->Main());

// Create 3 assemblies and connect them hierarchically
TDF_Label assemblyLabel1 = shapeTool->NewShape();
TDataStd_Name::Set(assemblyLabel1, "assembly1");

TDF_Label assemblyLabel2 = shapeTool->NewShape();
TDataStd_Name::Set(assemblyLabel2, "assembly2");

TDF_Label assemblyLabel3 = shapeTool->NewShape();
TDataStd_Name::Set(assemblyLabel3, "assembly3");

TDF_Label componentAssembly2 = shapeTool->AddComponent(assemblyLabel1, assemblyLabel2, location0);
TDataStd_Name::Set(componentAssembly2, "componentAssembly2");

TDF_Label componentAssembly3 = shapeTool->AddComponent(assemblyLabel2, assemblyLabel3, location0);
TDataStd_Name::Set(componentAssembly3, "componentAssembly3");

When dumping the XDE document, everything looks fine. When exporting to STEP, no exception is thrown but the result is a broken structure.

Does someone see a mistake? Any suggestions?
Thank you.

Pawel's picture

Hi mz,

maybe this thread will help:

http://www.opencascade.org/org/forum/thread_18813/

I guess the sample code produces correct structures.

Pawel

youngbin son's picture

can you upload again URL?

that URL is not working now