Integrate Parasolid with OpenNURBS SDK in Six Simple Steps

March 19, 2021

admin

Blog, Technology

0

Integrate Parasolid with OpenNURBS SDK in Six Simple Steps

While it’s not rocket science to integrate these two SDKs – Parasolid and OpenNURBS, the challenge is in integrating them in such a way that it works on multiple platforms esp. Windows and Mac both. CMake is a build system generator and a great cross-platform open-source tool for building, automation, testing and packaging using a compiler-independent method. It supports directory hierarchies and applications that depend on multiple libraries. It requires only a C++ compiler on its own build system. It can be slightly tricky to tame this beast though and get it kicking. I have listed down simple steps to help you get there.

Install CMake tool on the machine where you want to create a CMake project for your application. CMake comes with very comprehensive documentation which you can refer for any command help.

1. Before starting any CMake project creation you need to first decide the directory hierarchies for a project (please refer to the below example hierarchy).
In the below example our main root directory name is ‘RhinoToParasolidConverter’ which has one ‘CMakeLists.txt’ file, and two directories ‘cmake’ and ’Converter’.

2. In the ‘CMakeList.txt’ file present at the root of our project folder we need to provide below commands.

3. There are two files present in ‘opennurbs.cmake’ and ‘parasolid.cmake’ in ‘cmake’ directory which are used to find the libraries of OpenNURBS and Parasolid SDK (Please refer below snapshots).

opennurbs.cmake

parasolid.cmake

4. Now finally the ‘CMakeLists.txt’ file present in the ‘Converter’ directory adds the Parasolid and OpenNURBS header path and library to the project. In this example, we have created a static library project using CMake.

5. This CMake works for both Visual Studio and Xcode, below is the command to run the CMake file on Windows and Mac. The ‘OPENNURBS_ROOT’ and ‘PARASOLID_ROOT’ are the command line variables which are used in the CMake files. You can give the path of OpenNURBS and Parasolid SDK according to your machine.

You have to create a ‘build’ directory (folder) in the root project directory. And from the ‘build’ folder you have to run the command below.

Windows:

cmake .. -D PARASOLID_ROOT=”C:\Program Files (x86)\Parasolid\kernel\x64_win\base” -D OPENNURBS_ROOT=”F:\OpenNurbsWith2019\opennurbs-7.0.19309.17460″ -G “Visual Studio 16 2019” -A x64


Mac:

cmake .. -DPARASOLID_ROOT=/Users/appledeveloper1/Desktop/base -D OPENNURBS_ROOT=/Users/appledeveloper1/Desktop/Rhino_to_parasolid/opennurbs-7.0.19309.17460 -G Xcode

Hopefully, this will get you up to speed on CMake build script for Parasolid and OpenNURBS. Feel free to connect with us if you have any questions regarding this. Also, we are glad to undertake any projects that you may have related to Parasolid, OpenNURBS, and in general any other 3D data translation.

Author: Mahendra S.
Contact us:
info@prototechsolutions.com
ProtoTech Solutions Pvt Ltd.

Leave a Reply

Your email address will not be published. Required fields are marked *