Close

Relief for ODA Team in Ukraine

Learn more
ODA PRC SDK
Work with U3D Files

U3D Format Support in PRC SDK

ODA PRC SDK supports work with Universal 3D format files through converting these files contents into .prc files. This approach allows:

  • Read U3D files. Reading is implemented through using Universal 3D Sample Software library from Intel®.
  • Render U3D files contents using native ODA products, such as Visualize.

All types of mesh objects, including RHAdobeMesh, PointSet, and LineSet objects, as well as materials and textures, can be imported. Import of views and lighting objects is not supported.

U3D files conversion to PRC format is implemented in the OdU3D2PrcImport module.

U3D to PRC Conversion Procedure

To convert a .u3d file into a .prc file, you should stick the following procedure:

  1. Load the U3D import module:
              
    OdU3D2PrcImportModulePtr pModule = ::odrxDynamicLinker()->loadModule(OdU3D2PrcImportModuleName);
              
            
  2. Create an instance of the U3D importer and check whether it was successfully created:
              
    OdU3D2PrcImportPtr importer = pModule->create();
    if(importer.isNull())
      odPrintConsoleString(L"U3D Importer object creation failed!\n");
              
            
  3. Set import parameters (destination PRC database and input U3D file path are mandatory):
              
    importer->properties()->putAt(L"Database", pFile);
    importer->properties()->putAt(L"U3DPath", OdRxVariantValue(u3dName));
              
            
  4. Proceed with the import process and check its result:
              
    if(OdResult::eOk != importer->import())
      odPrintConsoleString(L"import failed!\n"); 
              
            

How to Set Import Parameters

The OdU3D2PrcImport module provides a set of import parameters, which are stored in a dictionary object within the importer object. It means that each parameter is represented with a "name-value" pair.

To get the properties dictionary for reading and modification, call the properties() method from the OdPdfImport class.

To set a new value for a parameter, call the putAt() method of the returned dictionary object passing parameter's name and new value.

You can find the list of supported import parameters in the following table:

Parameter Dictionary Name Description
Target PRC Database Database A PRC database where the U3D file content should be placed. Represented with a smart pointer to an OdPrcFile object.
Input U3D File Path U3DPath A full path to the input .u3d file to be imported.
Transformation Matrix Transform Matrix A transformation matrix to be applied to all imported elements.

The Database and U3DPath parameters are mandatory.

You can explore the resulted .prc file structure and render its content by opening it in the OdaPrcApp sample application:

Please note, that it is possible to import several .u3d files into one .prc file. The picture below illustrates the result.

U3D Files Rendering

ODA Software provides two ways of rendering a U3D file content:

See Also

Get Started with ODA PRC SDK

Work with PRC Entities

Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.