Engineering Sketch Pad (ESP) is used to model geometry throughout the design process.

Note

ESP121 with OpenCASCADE-7.4.1 is utilized for the Flow360 automated meshing workflow. To maintain consistency it is strongly recommended to download and install the same pre-built ESP version.

## 3.1.1. Prerequisites#

The most important prerequisite for ESP is OpenCASCADE (included with pre-built versions). ESP supports OpenCASCADE version 7.4.1 and 7.6.0. They are available at ESP’s website. Another prerequisite is a WebGL/Websocket capable browser. For example, Mozilla’s Firefox, Google Chrome and Apple’s Safari. CAPS depends on UDUNITS2 and Python.

## 3.1.2. Install Pre-Built Versions#

### 3.1.2.1. Linux#


span.prompt1:before {
content: "\$ ";
}

1. Unpack the tar file in your desired location. There must be no space in the path to the installation directory.

tar -xf ESP121OCC741Lin.tgz


The *.tgz file can be deleted, if you wish. The unpacked distribution includes OpenCASCADE and Python.

1. Open a terminal and direct to the installation directory and setup the ESP.

cd ESP121OCC741
./setup.sh

1. Source the ESP environment in your terminal.

source EngSketchPad/ESPenv.sh

1. Test running ESP by issuing the below command:

serveCSM EngSketchPad/data/tutorial1.csm


### 3.1.2.2. Windows#

1. Download the pre-built ESP *.zip file from the Flexcompute GitHub Page.

2. Unpack the zip file in your desired directory. There must be no space in the path to the installation directory (eg, C:\ESP121). The *.zip file can be deleted, if you wish. The unpacked distribution includes OpenCASCADE and Python.

3. Open a Command Prompt as administrator, direct to the installation directory, and setup ESP.


span.prompt2:before {
content: "C:\\> ";
}
cd ESP121OCC741
.\setup.cmd

1. Set the environment for ESP.

.\EngSketchPad\ESPenv.bat


To set the environment permanently: from the Start menu search for “environment” and select “Edit environment variables for your account”. Under User variables, select Path and click Edit, then add the path to the bin directory of EngineeringSketchPad (eg, C:\<path>\ESP121\EngSketchPad\bin).

1. Test running ESP by issuing the below command in the Command Prompt:

serveCSM EngSketchPad\data\tutorial1.csm


### 3.1.2.3. Windows Subsystem for Linux (WSL)#

1. From the Microsft Store, find Ubuntu-22.04 LTS and install it. Then, open the Ubuntu-22.04 terminal as administrator. Follow the below commands in terminal:

sudo apt update
sudo apt-get install firefox


After installing Firefox, make sure you can launch it from the terminal. In the event that you cannot launch Firefox from WSL, ensure that WSL is updated to the latest version and restart it.

To update WSL, from a Command Prompt or PowerShell (not Ubuntu terminal):

wsl --update
wsl --shutdown

1. After installing Firefox and confirming launch from the Ubuntu terminal, follow the ESP installation procedure in the previous section Linux within the Ubuntu terminal.

Note

The above instruction is tested on Windows 11. If you use WSL to install ESP, please make sure you can launch GUI app from your terminal.

## 3.1.3. Compile Engineering Sketch Pad and Edge Attribute Plugin#

This section explains how to build ESP step-by-step as a software relevant to your operating system.

### 3.1.3.1. Linux and MAC OS#

1. From ESP’s website download the *.tgz file according to your machine and unpack it in your desired directory. There must be no space in the path.

2. In order to build the software follow these instructions:

cd EngSketchPad/config


This procedure produces two files at the top level: ESPenv.sh and ESPenv.csh. They can be used to source the ESP environment. In order to build ESP, the terminal must contain ESP’s environment.

For example, if you are using csh or tsch:

source ESPenv.csh


or if you are using bash/zsh:

source ESPenv.sh

1. From the terminal go to the source directory and compile the software:

cd EngSketchPad/src
make

1. The Flow360 automated meshing workflow requires an additional plugin for ESP. The Edge Attribute plugin can be retrieved from Flexcompute’s GitHub repository:

git clone https://github.com/flexcompute/EngineeringSketchPad.git


Make sure the terminal has ESP’s environment (see source the environment) and go to the Edge Attribute Plugin directory, then compile:

cd <DirectoryContainingPlugIn>/PlugIn/EdgeAttr/
make


### 3.1.3.2. Windows#

1. In order to compile ESP in Windows we use Microsoft Visual Studio 2022 Community from https://visualstudio.microsoft.com/downloads/. Make sure that you have also installed Python3.

2. After downloading the Visual Studio Installer, launch it and check “Desktop development with C++”. Prior to installing take note of the Windows SDK version on the right panel (eg, 10.0.19041.0). Select install.

3. Next, open a Command Prompt and execute the following commands to set the required Visual Studio variables. The ‘x64’ below is your machine architecture and ‘10.0.19041.0’ is the Windows SDK version.

cd C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\
.\vcvarsall.bat x64 10.0.19041.0

1. Download the pre-built ESP *.exe file from ESP’s website and unpack it in your desired directory. There must be no space in the path.

2. Open a Command Prompt and issue the below commands to compile the software.

cd C:\<path>\ESP121\EngSketchPad\config
cd ..

1. Set the environment for ESP.

.\ESPenv.bat

1. Direct to the source directory and compile.

cd src
.\make.bat

1. The Flow360 automated meshing workflow requires an additional plugin for ESP. The Edge Attribute plugin can be retrieved from Flexcompute’s GitHub repository:

cd %ESP_ROOT%

1. Make sure the Command Prompt has ESP’s environment (see source the environment) and go to the Edge Attribute Plugin directory, then compile:

cd PlugIn\EdgeAttr
nmake -f NMakefile


### 3.1.3.3. Windows Subsystem for Linux (WSL)#

Building ESP in Windows Subsystem for Linux (WSL) is similar to compiling ESP in Linux and MAC OS.

### 3.1.3.4. Test the Edge Attribute Plugin#

To test if the EdgeAttr Plugin is built correctly, in the same terminal or Command Prompt and the same directory where the plugin is built, issue the following command:


span.prompt3:before {
content: " ";
}
serveCSM test.csm


The ESP GUI should open in a browser window. Turn off Viz for faces from the build tree on the left. Hover the cursor on an edge (i.e. with green colors) and press 6. In the message panel, you should see EdgeName= String for the selected edge (e.g. Body 9 Edge 4).