[Dry goods sharing] How to integrate 3D model visualization, format conversion engine and Parasolid?

​Sharing a sample project today that implements HOOPS Exchange and Siemens Parasolid into HOOPS Visualize using HOOPS sprockets.

HOOPS Chinese website icon-default.png?t=N4P3http://techsoft3d.evget.com/ ↓ Click the video below to view details↓

HOOPS Visualize - Exchange and Parasolid Integration Video

As you can see in the video above, this example illustrates how to   develop a 3D modeling application using Parasolid and HOOPS Visualize and Exchange.

It covers all major 3D modeling functions such as solid model creation, editing, querying, deleting, importing and exporting, including solid, face and edge entity mapping between HOOPS Visualize and Parasolid.
This will be a good example for evaluation, benchmarking and POC of your 3D modeling application development.

▶ There are two methods:

  • Using  Exchange-Parasolid  sprockets

This is the traditional method explained in the document:
Exchange-Parasolid - HOOPS Visualize HPS 2023 SP1 documentation

  • Parasolid connectors using Exchange sprockets and Exchange

This approach uses the Exchange sprocket and optionally uses Parasolid to use the following Parasolid connector for HOOPS Exchange:
HOOPS Exchange for Parasolid Developers — HOOPS Exchange 2023 documentation

▶ Example projects

Download the sample project from here:
mfc_sandbox_HE-Ps.zip  (333.8 KB)

▶ Source code comparison between sprockets

The same 3D modeling commands are implemented in both projects. USING_EXCHANGE_PARASOLID per processor definition switches source code between Exchange-Parasolid and Exchange sprocket, i.e. updates visualization after editing entities, HPS::Parasolid::Component::Tessallate is used for Exchange-Parasolid sprockets, but HPS::Exchange ::Component::Reload for HOOPS  Exchange sprockets.

▶ Parasolid command

The Parasolid command implements PsProcess in the class and is used in common by both projects.

▶ Swap initialization

To use the Exchange API, Exchange needs to be initialized separately.

▶ Model import

  • Using  Exchange-Parasolid sprockets

If it imports 3D CAD files using HPS::ExchangeParasolid::ImportNotifier, the model structure is managed from root to Representation Item as Exchange::Component, but from body to leaf as Parasolid::Component.

This means that the Exchange-Parasolid sprocket converts all imported entities into Parasolid entities during the import process. It takes longer than swapping sprockets.

  • Use swap sprockets

In order to solve the performance problem, the second method uses HPS::Exchange::ImportNotifier.

It manages the model structure from root to leaf, using Exchange::Component.

  • Swap Parasolid Connectors

When the second method needs to use Parasolid, get A3DRiBrepModel using HPS::Exchange::Component::GetExchangeEntity and convert it to Parasolid body using A3DRepresentationItemTranslateToPkParts. After model editing, Parasolid body can be converted to A3DRiBrepModel using and replaced in PRC. You'll see an example of this workflow in the class of the second example.

Implementation process

It does not know the Parasolid entity tag ID until it converts the Parasolid entity. Once an entity is converted to Parasolid, it is saved in the Parasolid session and can be queried.

▶ Exchange-Parasolid sprockets and Exchange sprockets

The video below compares the performance between the Exchange-Parasolid sprockets and the Exchange sprockets.

↓ Click the video below to view details↓

HOOPS Exchange-Parasolid  sprockets vs exchange sprockets

  • import

Exchange-Parasolid sprockets: 7.4 seconds; Exchange sprockets: 4 seconds

  • edit (delete faces)

Exchange-Parasolid sprockets: 4.8 seconds, 4.7 seconds; Exchange sprockets: 13 seconds, 7.1 seconds

If the source data is Parasolid based, such as NX, SolidWorks or Solid Edge, it retrieves the PK_BODY of the 3D CAD file. Although this benchmark uses NX parts, the Exchange-Parasolid sprocket takes 7.4 - 4 = 3.4 seconds to retrieve the PK_BODY. It is shorter than the conversion from PRC to PK_BODY: 13 - 7.1 = 5.9 seconds to swap sprockets.

Since the swap sprockets switch the Parasolid body when needed , it takes longer: 13 seconds. From the second start, the Exchange sprocket performance: 7.1 seconds is still lower than the Exchange -Parasolid sprockets: 4.7 seconds. This is because the Exchange sprocket needs to create the A3DRiBrepBody for visualization. Exchange-Parasolid sprockets directly subdivide PK_BODY for visualization.

Click here to get >>> 3D model lightweight and format conversion solution icon-default.png?t=N4P3https://isite.baidu.com/site/wjz8psvc/275e648c-86f9-40a6-a112-5771ac5491f2

Guess you like

Origin blog.csdn.net/Juvien_Huang/article/details/131064560