Initial Commit

This commit is contained in:
2025-07-04 20:33:06 +03:00
commit 8f09347ae0
9219 changed files with 2447903 additions and 0 deletions
@@ -0,0 +1,199 @@
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Introduction &mdash; imstk-unity 1.0.0 documentation</title>
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Tutorial" href="guide.html" />
<link rel="prev" title="Welcome to iMSTK-Unity" href="index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> imstk-unity
</a>
<div class="version">
1.0.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<p class="caption" role="heading"><span class="caption-text">Introduction</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Introduction</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#overview">Overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="#limitations">Limitations</a></li>
<li class="toctree-l2"><a class="reference internal" href="#project-structure">Project Structure</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="#setup-for-development">Setup for Development</a></li>
<li class="toctree-l1"><a class="reference internal" href="#devices">Devices</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#debugging">Debugging</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">User guide</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="guide.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="guide.html#example-scenes">Example Scenes</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Class List</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="classes.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="classes.html#component-structure">Component Structure</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Release Notes</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Releases</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Licensing</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="license.html">Apache License</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">imstk-unity</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
<li>Introduction</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/documentation.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<p class="centered">
<strong><strong>iMSTK-Unity</strong></strong></p><p class="centered">
<strong><em>User Documentation</em></strong></p><section id="introduction">
<h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this heading"></a></h1>
<p>This document describes the iMSTK-Unity interface as well as how to build and develop it.</p>
<section id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this heading"></a></h2>
<p>iMSTK is a free &amp; open source C++ toolkit for prototyping interactive multi-modal surgical simulations. The iMSTK-Unity asset provides classes that allow the use of iMSTK features inside of unity, those are amongst others various rigid and deformable models, collision detection and response, geometric importers and filters.</p>
<p>The iMSTK-Unity classes utilizes a C# interface of iMSTK that is generated by using the <a class="reference external" href="https://www.swig.org/">SWIG</a> tool. This interface is wrapped around most C++ functions and forwards its calls to the original C++ code. This allows you to use iMSTK in C# almost the same way as you would in C++.</p>
<blockquote>
<div><figure class="align-center">
<a class="reference internal image-reference" href="_images/ImstkUnityArchitecture1.png"><img alt="Alternative text" src="_images/ImstkUnityArchitecture1.png" style="width: 600px;" /></a>
</figure>
</div></blockquote>
</section>
<section id="limitations">
<h2>Limitations<a class="headerlink" href="#limitations" title="Permalink to this heading"></a></h2>
<p>This is an early release, not all iMSTK classes are easily accessible through the unity layer. Additionally there may be some combinations that have not been tested. Some errors _may_ cause Unity to crash, save early and save often. Please report issues you encounter in the iMSTK-Unity <a class="reference external" href="https://gitlab.kitware.com/iMSTK/imstk-unity/-/issues">issue tracker</a></p>
<p>While there is an OpenHaptics asset available at the store. Currently iMSTK-Unity does not support that, if you need support for the 3D-Touch series of devices you will have to build iMSTK with the appropriate settings.</p>
</section>
<section id="project-structure">
<h2>Project Structure<a class="headerlink" href="#project-structure" title="Permalink to this heading"></a></h2>
<p>The files of the asset are split in the following directories:</p>
<blockquote>
<div><ul class="simple">
<li><p><strong>iMSTK/Scripts</strong>: This directory is for the runtime scripts of the plugin.</p></li>
<li><p><strong>iMSTK/Scripts/Editor</strong>: This directory is for the editor scripts of the plugin. These scripts implement custom editor functionality. Editor scripts may use runtime scripts but wont be included in the player, which means you should not use functions from these in your own scripts</p></li>
<li><p><strong>iMSTK/Resources</strong>: This directory contains resources required during runtime.</p></li>
<li><p><strong>iMSTK/Editor/Resources</strong>: This directory contains resources required in the editor (such as style sheets or UI markup).</p></li>
<li><p><strong>iMSTK/Plugins</strong>: This directory is for libraries (dlls/so) that Unity needs to load.</p></li>
</ul>
</div></blockquote>
<p>Directories needed for the project but not relevant to the plugin:</p>
<blockquote>
<div><ul class="simple">
<li><p><strong>iMSTK/Models, Materials, &amp; Textures</strong>: These directories are for various assets used by the Demo. They are not part of the plugin.</p></li>
</ul>
</div></blockquote>
<p>The asset on the store may not contain the latest version of iMSTK-Unity, if you want to be up to date you can check out the sources <a class="reference external" href="https://gitlab.kitware.com/iMSTK/iMSTK-unity">from gitlab</a>. As the binary files for iMSTK arent included in the repository, you will also have to build iMSTK yourself when you go this route.</p>
</section>
</section>
<section id="setup-for-development">
<span id="setupfordevelopment"></span><h1>Setup for Development<a class="headerlink" href="#setup-for-development" title="Permalink to this heading"></a></h1>
<p>When checking out iMSTK-Unity from gitlab you will first need to build iMSTK. iMSTK uses CMake for its build system. iMSTK is a superbuild meaning it builds, includes, and links to all of its dependencies. There is no need to go find them. To build iMSTK clone <a class="reference external" href="https://gitlab.kitware.com/iMSTK/iMSTK">the iMSTK repository</a> and build it using cmake. Turn on the <code class="docutils literal notranslate"><span class="pre">IMSTK_BUILD_FOR_UNITY</span></code> cmake switch. This will reduce the number of dependencies that are being built. It will also enable the generation of “.cs” files as well as “.dlls”/”.so” files in your install directory that are needed by the “.cs” code. These will be used in Unity. Optionally enable <code class="docutils literal notranslate"><span class="pre">iMSTK_USE_VRPN</span></code> and/or <code class="docutils literal notranslate"><span class="pre">iMSTK_USE_OpenHaptics</span></code> for device support.</p>
<p>You can install the binaries two different ways, for both methods you need to know the directory in which iMSTK was installed. If you didnt change anything that directory will be called <cite>install</cite> and resides inside the directory that you defined in cmake to build imstk, e.g. <code class="docutils literal notranslate"><span class="pre">C:\Projects\imstk\build\install</span></code> :</p>
<ul class="simple">
<li><dl class="simple">
<dt>Using <code class="docutils literal notranslate"><span class="pre">`InstallImstk.bat`</span></code> from the asset directory the format is</dt><dd><p><code class="docutils literal notranslate"><span class="pre">InstallImstk.bat</span> <span class="pre">&lt;path</span> <span class="pre">to</span> <span class="pre">imstk/install&gt;</span></code></p>
</dd>
</dl>
</li>
<li><p>Alternatively you can enable <cite>Developer Mode</cite> for iMSTK inside of Unity. This option ca be found in “Edit-&gt;Project Settings-&gt;iMSTK Settings”. When turned on, you will be prompted to install iMSTK whenever you start Unity. After turning on this option, you may need to restart Unity. When it prompts you, select yes and provide your iMSTK install directory, located in <code class="docutils literal notranslate"><span class="pre">`&lt;iMSTK</span> <span class="pre">build</span> <span class="pre">directory&gt;/install`</span></code>. All the necessary files will be copied. If you dont want to be asked to reinstall iMSTK toggle this option off again.</p></li>
</ul>
<p>If you make changes in iMSTK you must reinstall it to Unity.</p>
<p>Note: There is a Force Install button to install iMSTK into Unity at the instant it is clicked. This may not always work depending on if an iMSTK script (that utilizes a given dll) has run in the editor. In that case those dlls cannot be unloaded from Unity.</p>
<p>Note: Make sure Unity is not running, even though closed it may be running in the background and prevent any installation.</p>
</section>
<section id="devices">
<h1>Devices<a class="headerlink" href="#devices" title="Permalink to this heading"></a></h1>
<p>The asset available from the asset store does not have <a class="reference external" href="https://support.3dsystems.com/s/article/OpenHaptics-for-Windows-Developer-Edition-v35?language=en_US">OpenHaptics</a> or <a class="reference external" href="https://github.com/vrpn/vrpn">VRPN</a> enabled. To use external devices you will have to build iMSTK for yourself. When building enable
<code class="docutils literal notranslate"><span class="pre">iMSTK_USE_VRPN</span></code> or <code class="docutils literal notranslate"><span class="pre">iMSTK_USE_OpenHaptics</span></code> respectively. This will create a version of iMSTK with device support enabled. When the build is done install iMSTK into the Unity Asset as described above.</p>
<section id="debugging">
<h2>Debugging<a class="headerlink" href="#debugging" title="Permalink to this heading"></a></h2>
<p>Debugging may be done in visual studio, even on the native side. You must attach the debugger to Unity as you would to any external process. With iMSTK open in visual studio, click debug-&gt;attach to process. Select the Unity executable and make sure youre set on native debugging.</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="index.html" class="btn btn-neutral float-left" title="Welcome to iMSTK-Unity" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="guide.html" class="btn btn-neutral float-right" title="Tutorial" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2022, Kitware.</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>