|
@@ -639,13 +639,6 @@
|
|
|
</ul>
|
|
</ul>
|
|
|
</nav>
|
|
</nav>
|
|
|
|
|
|
|
|
-</li>
|
|
|
|
|
-
|
|
|
|
|
- <li class="md-nav__item">
|
|
|
|
|
- <a href="#code-to-display-the-above-defined-shapes" class="md-nav__link">
|
|
|
|
|
- Code to display the above defined shapes
|
|
|
|
|
- </a>
|
|
|
|
|
-
|
|
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<li class="md-nav__item">
|
|
@@ -778,6 +771,19 @@
|
|
|
|
|
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </nav>
|
|
|
|
|
+
|
|
|
|
|
+</li>
|
|
|
|
|
+
|
|
|
|
|
+ <li class="md-nav__item">
|
|
|
|
|
+ <a href="#code-to-display-the-above-defined-shapes" class="md-nav__link">
|
|
|
|
|
+ Code to display the above defined shapes
|
|
|
|
|
+ </a>
|
|
|
|
|
+
|
|
|
|
|
+ <nav class="md-nav" aria-label="Code to display the above defined shapes">
|
|
|
|
|
+ <ul class="md-nav__list">
|
|
|
|
|
+
|
|
|
<li class="md-nav__item">
|
|
<li class="md-nav__item">
|
|
|
<a href="#yaml_20" class="md-nav__link">
|
|
<a href="#yaml_20" class="md-nav__link">
|
|
|
Yaml
|
|
Yaml
|
|
@@ -804,6 +810,18 @@
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <li class="md-nav__item">
|
|
|
|
|
+ <a href="../yamlsketcher/" title="YAML files Reference" class="md-nav__link">
|
|
|
|
|
+ YAML files Reference
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</ul>
|
|
</ul>
|
|
|
</nav>
|
|
</nav>
|
|
|
</div>
|
|
</div>
|
|
@@ -1237,13 +1255,6 @@
|
|
|
</ul>
|
|
</ul>
|
|
|
</nav>
|
|
</nav>
|
|
|
|
|
|
|
|
-</li>
|
|
|
|
|
-
|
|
|
|
|
- <li class="md-nav__item">
|
|
|
|
|
- <a href="#code-to-display-the-above-defined-shapes" class="md-nav__link">
|
|
|
|
|
- Code to display the above defined shapes
|
|
|
|
|
- </a>
|
|
|
|
|
-
|
|
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
<li class="md-nav__item">
|
|
<li class="md-nav__item">
|
|
@@ -1376,6 +1387,19 @@
|
|
|
|
|
|
|
|
</li>
|
|
</li>
|
|
|
|
|
|
|
|
|
|
+ </ul>
|
|
|
|
|
+ </nav>
|
|
|
|
|
+
|
|
|
|
|
+</li>
|
|
|
|
|
+
|
|
|
|
|
+ <li class="md-nav__item">
|
|
|
|
|
+ <a href="#code-to-display-the-above-defined-shapes" class="md-nav__link">
|
|
|
|
|
+ Code to display the above defined shapes
|
|
|
|
|
+ </a>
|
|
|
|
|
+
|
|
|
|
|
+ <nav class="md-nav" aria-label="Code to display the above defined shapes">
|
|
|
|
|
+ <ul class="md-nav__list">
|
|
|
|
|
+
|
|
|
<li class="md-nav__item">
|
|
<li class="md-nav__item">
|
|
|
<a href="#yaml_20" class="md-nav__link">
|
|
<a href="#yaml_20" class="md-nav__link">
|
|
|
Yaml
|
|
Yaml
|
|
@@ -1725,7 +1749,6 @@ gravity.set_name("gravity")
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
<p><img alt="Gravity" src="../reference/gravity.svg" /></p>
|
|
<p><img alt="Gravity" src="../reference/gravity.svg" /></p>
|
|
|
-<h2 id="code-to-display-the-above-defined-shapes">Code to display the above defined shapes</h2>
|
|
|
|
|
<h2 id="moment">Moment</h2>
|
|
<h2 id="moment">Moment</h2>
|
|
|
<p><a href="#list-of-shapes">home</a> defines a Moment arrow with text given text, center and radius.</p>
|
|
<p><a href="#list-of-shapes">home</a> defines a Moment arrow with text given text, center and radius.</p>
|
|
|
<h3 id="yaml_15">Yaml</h3>
|
|
<h3 id="yaml_15">Yaml</h3>
|
|
@@ -1812,6 +1835,7 @@ dashpot.set_name("dashpot")
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
<p><img alt="Dashpot" src="../reference/dashpot.svg" /></p>
|
|
<p><img alt="Dashpot" src="../reference/dashpot.svg" /></p>
|
|
|
|
|
+<h2 id="code-to-display-the-above-defined-shapes">Code to display the above defined shapes</h2>
|
|
|
<p><a href="#list-of-shapes">home</a> In order to display the various shapes, use the following code in a jupyter notebook</p>
|
|
<p><a href="#list-of-shapes">home</a> In order to display the various shapes, use the following code in a jupyter notebook</p>
|
|
|
<pre><code class="python">[1]: %matplotlib widget
|
|
<pre><code class="python">[1]: %matplotlib widget
|
|
|
[2]: from pysketcher import *
|
|
[2]: from pysketcher import *
|
|
@@ -1825,7 +1849,8 @@ dashpot.set_name("dashpot")
|
|
|
<pre><code class="python">head = """\
|
|
<pre><code class="python">head = """\
|
|
|
libraries: ["from math import tan, radians, sin, cos","from pysketcher import *","import numpy as np"]
|
|
libraries: ["from math import tan, radians, sin, cos","from pysketcher import *","import numpy as np"]
|
|
|
myfig={}
|
|
myfig={}
|
|
|
-sketchParse(head,myfig)
|
|
|
|
|
|
|
+sketch = Sketch(myfig)
|
|
|
|
|
+sketch.append(head)
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
<p>The above code initialize myfig sketch space loading into it libraries references so samples can use tan, radians, si, cos and all the objects defined in pysketcher (the module name of jupytersketcher) and numpy as well: this is used by the yaml definition of shapes</p>
|
|
<p>The above code initialize myfig sketch space loading into it libraries references so samples can use tan, radians, si, cos and all the objects defined in pysketcher (the module name of jupytersketcher) and numpy as well: this is used by the yaml definition of shapes</p>
|
|
@@ -1835,10 +1860,11 @@ sketch="""
|
|
|
# put here the yaml 'object' definition
|
|
# put here the yaml 'object' definition
|
|
|
"""
|
|
"""
|
|
|
drawing_tool.erase()
|
|
drawing_tool.erase()
|
|
|
-sketchParse(sketch,myfig)
|
|
|
|
|
|
|
+sketch.append(sketch)
|
|
|
# replace 'object' by the actual one
|
|
# replace 'object' by the actual one
|
|
|
d = myfig['object'].draw()
|
|
d = myfig['object'].draw()
|
|
|
drawing_tool.display()
|
|
drawing_tool.display()
|
|
|
|
|
+display(SVG(Sketch.matplotlib2SVG()))
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
<h3 id="python_20">Python</h3>
|
|
<h3 id="python_20">Python</h3>
|
|
@@ -1847,6 +1873,7 @@ drawing_tool.display()
|
|
|
# replace object by the actual name line, rectangle, circle...
|
|
# replace object by the actual name line, rectangle, circle...
|
|
|
object.draw()
|
|
object.draw()
|
|
|
drawing_tool.display()
|
|
drawing_tool.display()
|
|
|
|
|
+display(SVG(Sketch.matplotlib2SVG()))
|
|
|
</code></pre>
|
|
</code></pre>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1881,6 +1908,20 @@ drawing_tool.display()
|
|
|
</a>
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ <a href="../yamlsketcher/" title="YAML files Reference" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
|
|
|
|
|
+ <div class="md-footer-nav__title">
|
|
|
|
|
+ <div class="md-ellipsis">
|
|
|
|
|
+ <span class="md-footer-nav__direction">
|
|
|
|
|
+ Next
|
|
|
|
|
+ </span>
|
|
|
|
|
+ YAML files Reference
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="md-footer-nav__button md-icon">
|
|
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a>
|
|
|
|
|
+
|
|
|
</nav>
|
|
</nav>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|