-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9e1c6bf
Showing
67 changed files
with
11,740 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: abe8fbc0b369dd281139a9147136f73c | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" data-content_root="../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Overview: module code — SimExporter documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/tabs.css?v=a5c4661c" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/theme.css?v=556d74e5" /> | ||
|
||
|
||
<!--[if lt IE 9]> | ||
<script src="../_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script src="../_static/jquery.js?v=5d32c60e"></script> | ||
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script> | ||
<script src="../_static/documentation_options.js?v=5929fcd5"></script> | ||
<script src="../_static/doctools.js?v=9a2dae69"></script> | ||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<script src="../_static/tabs.js?v=3030b3cb"></script> | ||
<script src="../_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.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"> | ||
SimExporter | ||
</a> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="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"> | ||
<ul> | ||
<li class="toctree-l1"><a class="reference internal" href="../demo.html">Demo</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../install.html">Install</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../usage.html">How to use</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="../api.html">API</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">SimExporter</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" aria-label="Home"></a></li> | ||
<li class="breadcrumb-item active">Overview: module code</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<h1>All modules for which code is available</h1> | ||
<ul><li><a href="SimExporter/core/exporter.html">SimExporter.core.exporter</a></li> | ||
<li><a href="SimExporter/core/factory.html">SimExporter.core.factory</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
<footer> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2024, Mimesis, Inria.</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
=== | ||
API | ||
=== | ||
|
||
.. autoclass:: SimExporter.core.exporter.Exporter | ||
:special-members: __init__ | ||
:members: process | ||
|
||
|
||
.. autoclass:: SimExporter.core.factory.Factory | ||
:members: add_mesh, add_points, add_arrows, add_k3d_objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
==== | ||
Demo | ||
==== | ||
|
||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Meshes | ||
|
||
.. raw:: html | ||
|
||
<iframe src="_static/html/meshes.html" height="600px" width="100%"></iframe> | ||
|
||
.. group-tab:: Points | ||
|
||
.. raw:: html | ||
|
||
<iframe src="_static/html/points.html" height="600px" width="100%"></iframe> | ||
|
||
.. tabs:: | ||
|
||
.. group-tab:: Meshes | ||
|
||
.. code-block:: python | ||
from SimExporter.core import Exporter | ||
# Load data | ||
... | ||
# Create the exporter | ||
exporter = Exporter(animation=True, | ||
fps=50) | ||
# Add meshes to the scene | ||
exporter.objects.add_mesh(positions=..., | ||
cells=..., | ||
color=[192, 28, 40], | ||
alpha=0.6, | ||
flat_shading=False, | ||
time_positions=...) | ||
exporter.objects.add_mesh(positions=..., | ||
cells=..., | ||
alpha=1., | ||
flat_shading=False, | ||
wireframe=True, | ||
colormap_name='Reds', | ||
colormap_range=[0, 1], | ||
time_colormap_values=..., | ||
time_positions=...) | ||
# Export to HTML | ||
exporter.process(filename='scene.html', | ||
background_color='black', | ||
menu_visible=True, | ||
grid_visible=False, | ||
frame_visible=True) | ||
.. group-tab:: Points | ||
|
||
.. code-block:: python | ||
from SimExporter.core import Exporter | ||
# Load data | ||
... | ||
# Create the exporter | ||
exporter = Exporter(animation=True, | ||
fps=50) | ||
# Add meshes to the scene | ||
exporter.objects.add_points(positions=..., | ||
point_size=2., | ||
colormap_name='YlOrBr', | ||
time_colormap_values=..., | ||
time_positions=...) | ||
exporter.objects.add_mesh(positions=..., | ||
cells=..., | ||
color='grey', | ||
alpha=0.6, | ||
wireframe=True, | ||
time_positions=...) | ||
# Export to HTML | ||
exporter.process(filename='scene.html', | ||
background_color='black', | ||
menu_visible=True, | ||
grid_visible=False, | ||
frame_visible=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
=========== | ||
SimExporter | ||
=========== | ||
|
||
**SimExporter** is a Python module for creating 3D scenes of various 3D objects using | ||
:K3D:`K3D <>` and exporting a 3D plot or a 3D animation in a standalone HTML file. | ||
|
||
This HTML file can then be opened in any browsers on any laptop, is can then be easily integrated into a website or | ||
presentation slides. | ||
|
||
|
||
Features | ||
-------- | ||
|
||
**SimExporter** provides a lightweight, user-friendly API to create 3D objects: | ||
|
||
* Create various 3D object types: meshes, points, vectors; | ||
* Associate time series to the 3D objects. | ||
|
||
Then, the scene containing the 3D objects can be exported in a standalone HTML file: | ||
|
||
* Export a static plot of the 3D objects; | ||
* Export an animation using the time series associated to the 3D objects. | ||
|
||
|
||
Gallery | ||
------- | ||
|
||
.. image:: _static/gallery.png | ||
|
||
|
||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
Demo <demo.rst> | ||
Install <install.rst> | ||
How to use <usage.rst> | ||
API <api.rst> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
======= | ||
Install | ||
======= | ||
|
||
Requirements | ||
------------ | ||
|
||
**SimExporter** has the following dependencies: | ||
|
||
.. table:: | ||
:widths: 30 30 50 | ||
|
||
+---------------------+--------------+--------------------------------+ | ||
| **Dependency** | **Type** | **Instructions** | | ||
+=====================+==============+================================+ | ||
| :Numpy:`Numpy <>` | **Required** | :guilabel:`pip install numpy` | | ||
+---------------------+--------------+--------------------------------+ | ||
| :K3D:`K3D <>` | **Required** | :guilabel:`pip install k3d` | | ||
+---------------------+--------------+--------------------------------+ | ||
| :Vedo:`Vedo <>` | **Required** | :guilabel:`pip install vedo` | | ||
+---------------------+--------------+--------------------------------+ | ||
| :Colour:`Colour <>` | **Required** | :guilabel:`pip install colour` | | ||
+---------------------+--------------+--------------------------------+ | ||
|
||
|
||
Install | ||
------- | ||
|
||
Install with *pip* | ||
"""""""""""""""""" | ||
|
||
**SimExporter** can be easily installed with :guilabel:`pip` for users: | ||
|
||
.. code-block:: bash | ||
pip install git+https://github.com/RobinEnjalbert/SimExporter.git | ||
You should be able to run: | ||
|
||
.. code-block:: python | ||
import SimExporter | ||
Install from sources | ||
"""""""""""""""""""" | ||
|
||
**SimExporter** can also be installed from sources for developers: | ||
|
||
.. code-block:: bash | ||
git clone https://github.com/RobinEnjalbert/SimExporter.git | ||
cd SimExporter | ||
pip install -e . | ||
You should be able to run: | ||
|
||
.. code-block:: python | ||
import SimExporter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
========== | ||
How to use | ||
========== | ||
|
||
This light tutorial reviews the whole project API to create 3D objects and export them in HTML. | ||
|
||
|
||
Step 1: Create the Exporter | ||
--------------------------- | ||
|
||
The :py:class:`Exporter<SimExporter.core.exporter.Exporter>` class is the main user API to create and export 3D objects: | ||
|
||
.. code-block:: python | ||
from SimExporter.Core import Exporter | ||
exporter = Exporter(animation=True, | ||
fps=30) | ||
The :guilabel:`animation` option defines if the exported output will be a static 3D plot or an animation (in that case, | ||
the frame rate :guilabel:`fps` can be specified). | ||
|
||
|
||
Step 2: Add 3D objects | ||
---------------------- | ||
|
||
The **Exporter** exposes the methods to create several 3D objects in the :guilabel:`objects` attribute. | ||
|
||
* Adding **mesh** with :py:meth:`objects.add_mesh<SimExporter.core.factory.Factory.add_mesh>`: | ||
|
||
.. code-block:: python | ||
exporter.objects.add_mesh(positions=my_mesh_positions, | ||
cells=my_mesh_cells) | ||
* Adding **points** with :py:meth:`objects.add_points<SimExporter.core.factory.Factory.add_points>`: | ||
|
||
.. code-block:: python | ||
exporter.objects.add_points(positions=my_points_positions) | ||
* Adding **arrows** with :py:meth:`objects.add_arrows<SimExporter.core.factory.Factory.add_arrows>`: | ||
|
||
.. code-block:: python | ||
exporter.objects.add_arrows(positions=my_arrows_positions, | ||
vectors=my_arrows_vectors) | ||
* Adding standard **k3d objects** with :py:meth:`objects.add_k3d_objects<SimExporter.core.factory.Factory.add_k3d_objects>`: | ||
|
||
.. code-block:: python | ||
import k3d | ||
lines = k3d.lines(vertices=my_lines_vertices, | ||
indices=my_lines_indices) | ||
exporter.objects.add_k3d_objects(lines) | ||
Step 3: Export in HTML | ||
---------------------- | ||
|
||
Finally, the call to :py:meth:`process<SimExporter.core.exporter.Exporter.process>` will export the 3D scene in HTML: | ||
|
||
.. code-block:: python | ||
exporter.process(filename='scene.html') |
Oops, something went wrong.