Thu, 08/12/2021 - 13:40
Hi guys!
I use STEPCAFControl_Reader for reading step-files and STEPCAFControl_Reader for writing gltf.
Is it possible to get custom properties (like "density" from the attached file) from the intermidiate TDocStd_Document or in any other way?
I need to write it into extra fields of the resulting gltf.
#206=DERIVED_UNIT((#201,#202));
#207=DERIVED_UNIT((#203,#204));
#208=MEASURE_REPRESENTATION_ITEM('density measure',
POSITIVE_RATIO_MEASURE(19.3),#206);
#209=MEASURE_REPRESENTATION_ITEM('density measure',
POSITIVE_RATIO_MEASURE(0.76),#207);
#210=PROPERTY_DEFINITION_REPRESENTATION(#220,#214);
#211=PROPERTY_DEFINITION_REPRESENTATION(#221,#215);
#212=PROPERTY_DEFINITION_REPRESENTATION(#222,#216);
#213=PROPERTY_DEFINITION_REPRESENTATION(#223,#217);
#214=REPRESENTATION('material name',(#218),#2031);
#215=REPRESENTATION('density',(#208),#2031);
#216=REPRESENTATION('material name',(#219),#2032);
#217=REPRESENTATION('density',(#209),#2032);
#218=DESCRIPTIVE_REPRESENTATION_ITEM('\X2\0417043E043B043E0442043E\X0\',
'\X2\0417043E043B043E0442043E\X0\');
#219=DESCRIPTIVE_REPRESENTATION_ITEM('\X2\04140435044004350432043E\X0\
(\X2\043404430431\X0\)','\X2\04140435044004350432043E\X0\ (\X2\043404430431\X0\)');
#220=PROPERTY_DEFINITION('material property','material name',#2051);
#221=PROPERTY_DEFINITION('material property','density of part',#2051);
#222=PROPERTY_DEFINITION('material property','material name',#2052);
#223=PROPERTY_DEFINITION('material property','density of part',#2052);
#224=SURFACE_STYLE_RENDERING_WITH_PROPERTIES($,#253,(#226));
#225=SURFACE_STYLE_RENDERING_WITH_PROPERTIES($,#254,(#227));
Sat, 09/25/2021 - 23:13
This specific entity "density" is translated into XCAFDoc_Material within XCAF document, so that you may retrieve it with help of XCAFDoc_MaterialTool::GetDensityForShape() for an appropriate shape label.
Thu, 07/20/2023 - 14:09
Hello Kirill,
What is the unit of density returned from XCAFDoc_MaterialTool::GetDensityForShape() ?
Also is there any way to set the mass/density units before importing STEP ?
Thanks & Regards,
Prajwal
Sat, 07/22/2023 - 11:41
Prajwal Shelar, according to comments in source code,
XCAFDoc_MaterialTool::GetDensityForShape()
returnsg/mm³
, whileXCAFDoc_Material::GetDensity()
returnsg/cm³
:Of course, proper unit information will be returned only in case of a valid STEP file and absence of particular bugs in OCCT translator.
OCCT documentation refers to the following STEP recommended practices, which XCAF translator is supposed to rely on:
Mon, 07/24/2023 - 09:01
Hi,
I tried XCAFDoc_Material::GetDensity() for two STEP files with same material STEEL.
For file 'Difi_000001.stp', I get density value as 7.85 gm/cm3 (unit as you mentioned in previous comment) which is correct.
But for file 'Hinge.step', I get density value as 0.00785 gm/cm3 which is wrong. Is this a bug?
Similarly, XCAFDoc_MaterialTool::GetDensityForShape() also gives wrong results.
I have attached the two STEP files.
I get same result for CAD Assistant as well. https://dev.opencascade.org/content/cad-assistant-v161-wrong-density-mat...
Thanks.