How run OpenCASCADE in telephone

I'm trying to run the OpenCascade library on my phone.

To do this, I decided to use html, js.

It turned out to connect a mathematical library, but I do not know how to connect OpenCascade.

All code :

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script src=https://cdnjs.cloudflare.com/ajax/libs/mathjs/3.3.0/math.min.js></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjs/9.2.0/math.js'></script>
</head>
<body>
<form name="search">
<input type="text" name="key" placeholder="Введите ключ"></input>
<input type="button" name="print" value="Печать" />
<input type="button" name="print1" value= math.sqrt(-4) />
</form>
<div id="printBlock"></div>
<script>
function printForm(e){

// получаем значение поля key
var keyBox = document.search.key;
var val = keyBox.value;
// получаем элемент printBlock
var printBlock = document.getElementById("printBlock");
// создаем новый параграф
var pElement = document.createElement("p");
// устанавливаем у него текст
pElement.textContent = val;
// добавляем параграф в printBlock
printBlock.appendChild(pElement);
// ставим пи
var val1 = math.pi;
// создаем новый параграф
var pElement1 = document.createElement("p");
// устанавливаем у него текст
pElement1.textContent = val1;
// добавляем параграф в printBlock
printBlock.appendChild(pElement1);

}

var printButton = document.search.print;
printButton.addEventListener("click", printForm);

</script>
</body>
</html>

Ivan P's picture

> I'm trying to run the OpenCascade library on my phone
Judging from your code, you are trying to use OpenCascade in JS and HTML. Have a look at `\opencascade-7.7.0\samples\webgl`from your Opencascade install folder. It uses Emscripten, so follow the provided instructions in Readme.md

Ivan P's picture

There is an example how to use library on Android, with Android SDK.

\opencascade-7.7.0\samples\java\jniviewer

keep in mind that it may require some work as well, since C++ libs are not commonly used on Android. Make sure to have a physical device on Android, once you get to testing stage