Any way to get the CAD axis system reference?

I'm working on a CAD importer.

Everything seems to go as planned, bu we recently detected an issue regarding the rotation of the resultant CAD file. After a few tests it seems to be something related on how OCCT reads the data related to the system axis.
I will show a sample cube, imported with CAD assistant:
- Img1 is the STEP file,
- Img2 is our OBJ model.
Any thoughts on this? Any flag or parameter that can be used to know where Z is pointing?

Kind regards,
Lorenzo

Attachments: 
Dmitrii Pasukhin's picture

Hello, the translation parameter can be modified:

https://dev.opencascade.org/doc/overview/html/occt_user_guides__step.htm...

Parameter:

    // Mode to variate apply or not transformation placed in the root shape representation.
    // Issues #29068 and #31491.
    Interface_Static::Init("step", "read.step.root.transformation", 'e', "");
    Interface_Static::Init("step", "read.step.root.transformation", '&', "enum 0");
    Interface_Static::Init("step", "read.step.root.transformation", '&', "eval OFF");
    Interface_Static::Init("step", "read.step.root.transformation", '&', "eval ON");
    Interface_Static::SetCVal("read.step.root.transformation", "ON");

Could you please check this one? Additionally, it can be a bug of export or some import issue. Do you have original one with clear orientation?

Best regards, Dmitrii.

Lorenzo Napl's picture

Hi Dimitrii,
It seems there is no reference to that parameter (transformation) at the documentation. Could you confirm?
Anyway I will test it including that parameter and I will confirm.
Please find attached the STEP test file that I'm using.

Kind regards,
Lorenzo Navarro

Attachments: 
Lorenzo Napl's picture

Please find attached the final comparision.
I asume that the parameter must be set before the CAD reading, something like this:

    auto reader = STEPCAFControl_Reader();
    
    reader.SetColorMode(true);
    reader.SetNameMode(true);
    reader.SetLayerMode(true);
    reader.SetPropsMode(true);
    Interface_Static::SetIVal("read.step.root.transformation", 1);
    
    auto returnStatus = reader.ReadFile(UtilsCli::ToStdString(fullFileName).c_str());

Could this be an import bug?

Is there anywhere to check how many static parameters can be set. I seems that some of them are missing in the documentation.
For example in this post I found a few ones that there aren't explained on the docs (as it could be write.stepcaf.subshapes.name).

Kind regards,
Lorenzo

Attachments: 
Dmitrii Pasukhin's picture

StepCafControl_ConfigurationNode should to became a container for every parameters for DE_Wrapper. Soon any STEP parameters will be not static and part of the one single struct for general reading withing new class to be more clear which setting exist and can be modified.

As for a bug - probably it is not a bug. Probably it is different option to export or something similar. kgv give you some samples with rotated one.

Best regards, Dmitrii.

gkv311 n's picture

OCCT STEP translator expects coordinate system to be Z-up. However, most applications working with OBJ files expect coordinate system to be Y-up. For this reason, CAD Assistant performs coordinate system flipping on OBJ import/export that you may find in its settings.

Within C++ API, these options are controlled by RWObj_CafWriter::CoordinateSystemConverter/RWObj_CafReader::CoordinateSystemConverter like in this sample for exporting glTF files.

image

Lorenzo Napl's picture

Thank you both for your responses. All clear.
We will wait for the parameter refactor in order to extend our app.

Kind regards,
Lorenzo