STEP Import: material, density

Hello community,

I am trying to read the part's density from a STEP-file exported from Pro/Engineer Wildfire 5. I tested different export options all including density (AP_203_is_ext, AP_203_e2, AP_214_is,...).

The density is represented as:
#4161=DERIVED_UNIT(.....)
#4162=MEASURE_REPRESENTATION_ITEM('density measure' POSITIVE_RATIO_MEASURE(...),#4161)

I also tried to import the STEP-file http://www.cax-if.de/library/dm1-oc-214.zip ... also in this case no success.

Finally some information about my import strategy:

STEPCAFControl_Reader reader;
reader.ReadFile(...);
m_doc.Nullify();
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("MDTV-XCAF", m_doc);

// enable all modes ... I also tried differnt combinations
reader.SetColorMode(true);
reader.SetNameMode(true);
reader.SetLayerMode(true);
reader.SetGDTMode(true);
reader.SetPropsMode(true);
reader.SetMatMode(true); //this should be the important thing for density true?
reader.SetSHUOMode(true);

if ( reader.Transfer( m_doc ) )
{
Handle(XCAFDoc_ShapeTool) aShapeTool = XCAFDoc_DocumentTool::ShapeTool(m_doc->Main());
Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(m_doc->Main());
Handle(XCAFDoc_MaterialTool) myMaterials = XCAFDoc_DocumentTool::MaterialTool(m_doc->Main());

TDF_LabelSequence mat;
myMaterials->GetMaterialLabels(mat);
cout }

Unfortunately the program always prints out:
"Num of StepLoader Materials:0"

The following always returns density=0
.....
const TDF_Label &label = sequence.Value(i+1);
if (aShapeTool->IsShape(label)){
TopoDS_Shape s = aShapeTool->GetShape(label);
double density=myMaterials->GetDensityForShape(label);
}
....

Has anyone ideas how to solve this problem? How must a density be represented in a STEP-file to be imported? Is the material interface already implemented? I found no documentation about this feature.

Thanks in advance,

Matthias Kennel
www.iff.fraunhofer.de/de/geschaeftsbereiche/virtual-engineering.html

kennel's picture

I added a new material loading method in the Step-Loader to support the STEP export of PTC Pro/Engineer WF 5. I would like to contribute it to the community for the nexte version of OC. Ha anyone an idea how to do this?

Matthias Kennel
www.iff.fraunhofer.de/de/geschaeftsbereiche/virtual-engineering.html

Pierre Juillard's picture

Hi Matthias,

I am not export on this topic, but yous should consider having a look to SCL project for STEP import/export (https://github.com/mpictor/StepClassLibrary/wiki).

If I understand well, this open source library is being included in OCE, the open source version of OCC, maintained by the community (https://github.com/tpaviot/oce/wiki)

You should thus simply have a look to see if the functionality you are interested in is not already managed by SCL.

If so, you should just end up to use OCE (which is if I understand still well) binary compatible with OCC in your own project.

Bests,
Have a good day.

Pierre

Forum supervisor's picture

Dear Matthias,
In order to take advantage of the proposed cotribution, we are bound to sign the CLA Agreement with you.
So, we suggest you to register at the contribution portal - http://dev.opencascade.org/
and consider a possibility to sign the CLA according the procedure published on that site.
Regards