Jump to content

Orthogonal Views Extractor from STEP File - PythonOCC Version

A python script to automate the extraction of orthogonal views of the six faces of solids extracted from STEP files using tools available on PythonOCC.

Image 1: Views extracted from considered solid

Asset Description

The implemented asset is a python script created with the aim of automating the extraction of the six orthogonal views (top, bottom, right, left, front, back) from STEP files using the PythonOCC library.

Asset Details

Technical Information

The input of the algorithm is a file in STEP format, which is a standardized format for 3D model data exchange. The output of the algorithm is six images of the six orthogonal views (top, bottom, right, left, front, back) of the model. The whole procedure is automatized, allowing to reduce time and manual effort. Also, the users can specify image resolution, allowing them to tailor the output to their specific needs. The script is written in python, leveraging its tools to visualize the STEP files and using PythonOCC’s tools to manipulate them.

Usage

In order to use the implemented algorithm, the user has to start by downloading the script. After, several key parameters can be set to tailor the algorithm to the specific needs of the users. In particular, the following variables can be set:

  • folder_path: the path to the directory that contains the STEP files to be processed;
  • output_folder_path: path in which the extracted views will be saved for all the files;
  • save_path = "" #path in which the dataset containing the dimensions of all the files will be saved;
  • screen_width and screen_height: the desired width and height of output images;
  • setted_tol: optionally specify a tolerance for the computation of the bounding boxes around objects.
  • Finally, once executed the script, it will generate the desired images. Six view images (top, bottom, right, left, front, back) will be generated in the chosen folder.

    Maturity

    Well-established: development has reached a satisfying level of maturity and performs its task completely. No further development is planned in the future. The script will only see eventual maintenance intervention if improvement is deemed necessary.

    Licence

    Mozilla Public Licence v2.0 - MPL 2.0

    Resources

    Acknowledgement

    This work was performed as part of the PERNOUD pilot in the context of the AI REDGIO 5.0 project

    Relevant Categories