This sample illustrates how to create an interactive 3D model Web viewer from uploading a CAD file to visualization.
Server side loads a CAD file using HOOPS Exchange and exports SC model using libconverter of HOOPS Communicator. By using Exchange and libconverter separately instead of HC Converter, import options and advanced features of Exchange which are not supported by Converter can be used.
Farthermore, by keeping imported model with Exchange, Exchange APIs can be called from client side interactively.
This sample was developed for the following article of Tech Soft 3D Forum:
https://forum.techsoft3d.com/t/how-hoops-communicator-can-use-server-side-exchange-processes/1841
- HOOPS Communicator (2024.1.0)
- HOOPS Exchange (2024.1.0)
- libmicrohttpd (1.0.0)
https://ftp.gnu.org/gnu/libmicrohttpd/
- Ubuntu server 20.04 LTS AWE EC2 instance
- Windows 10
- MacOS 12.4
+ server_side_exchange
+ ExServer
+ Makefile (for Linux / MacOS)
+ VS2019_ExServer.bat (for Windows)
+ main.html
+ js
+ main.js
+ HttpServer.js
+ package.json
+ src (copy src folder here from \web_viewer)
ExServer is a server side console application which is using HOOPS Exchange and HC libconverter.
- Unzip HOOPS Exchange SDK and locate a valid hoops_license.h in
includ/
- Unzip HOOPS Communicator SDK and locate a valid hoops_license.h in
authoring/libconverter/include/
- Unzip libmicrohttpd and install with root user
./configure && make && make install
- Edit ExServer/Makefile according to your environment
- Set library path
Linux
export LD_LIBRARY_PATH=/usr/local/lib:/path/to/HOOPS_Communicator/authoring/converter/bin/linux64
MacOS
export DYLD_LIBRARY_PATH=/usr/local/lib:/path/to/HOOPS_Communicator/authoring/converter/bin/macos
- Build
sudo make
- Unzip HOOPS Exchange SDK and locate a valid hoops_license.h in
includ/
- Unzip HOOPS Communicator SDK and locate a valid hoops_license.h in
authoring/libconverter/include/
- Unzip libconverter SDK
- Register the following enviroment valiables
Name:EX_SERVER_WORKING_DIR
Value:path¥to¥temp¥folder
Name:SC_MODELS_DIR
Value:path¥to¥sc_models¥folder
- Edit ExServer¥VS2019_ExServer.bat accoording to your environment and open ExServer.sln using the bat file
- Build the solution
- Launch HTTP server with tarminal
cd path/to/server_side_exchange
npm install
npm start
- Start Communicator SC server (/quick_start/start_server)
- Set library path
Linux
export LD_LIBRARY_PATH=/usr/local/lib:/path/to/HOOPS_Communicator/authoring/converter/bin/linux64
MacOS
export DYLD_LIBRARY_PATH=/usr/local/lib:/path/to/HOOPS_Communicator/authoring/converter/bin/macos
- Set enviroment valiables
export EX_SERVER_WORKING_DIR=/path/to/temp/folder
export SC_MODELS_DIR=/path/to/sc_models/folder
- Start ExServer (giving a port number in command line argument)
Windows:ExServer 8888
Linux/MacOS:./ExServer 8888
- Open the main.html with server's port number (using Chrome)
http://localhost:8000/main.html?port=8888