Gilbert Brault 5 rokov pred
rodič
commit
5b29ad5857

+ 30 - 3
jupysketch-doc/docs/reference.md

@@ -14,6 +14,7 @@
 - [Arc_wText](#arc_wtext): defines an arc with text positionned left (moving clock-wise) of arc half-way
 - [Arrow1](#arrow1): defines a line with arrow(s) given starting and ending point and arrow termination(s) ->, \<->, \<-
 - [Force](#force): defines an Indication of a force by an arrow and a text (symbol)
+- [Wall](#wall): defines an hached box given starting, ending point and thickness, filled with a pattern
 - [](#)
 
 ## Line
@@ -205,6 +206,31 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
 ```
 ![Force](reference/force.svg)
 
+## Wall
+[home](#list-of-shapes) defines an hached box given starting, ending point and thickness, filled with a pattern
+
+### Yaml
+```yaml
+theta: 30
+L: 8
+B: point(L-4,-2)                      # wall right end
+A: point(-4,tan(radians(theta))*L-2)  # wall left end
+wall: 
+    formula: Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.5,transparent=False)
+    style:
+        linecolor: black
+```
+### Python
+```python
+theta = 30
+L = 8
+B = point(L-4,-2)                      # wall right end
+A = point(-4,tan(radians(theta))*L-2)  # wall left end
+wall= Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.5,transparent=False)
+wall.set_linecolor('black')
+```
+![Wall](reference/wall.svg)
+
 ## Code to display the above defined shapes
 
 [home](#list-of-shapes) In order to display the various shapes, use the following code in a jupyter notebook
@@ -213,8 +239,9 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
 ```python
 [1]: %matplotlib widget
 [2]: from pysketcher import *
-[3]: drawing_tool.set_coordinate_system(xmin=-10, xmax=10,ymin=-10, ymax=10,axis=True)
-[4]: drawing_tool.mpl.gcf().canvas
+[3]: from math import tan, radians, sin, cos # needed for python code
+[4]: drawing_tool.set_coordinate_system(xmin=-10, xmax=10,ymin=-10, ymax=10,axis=True)
+[5]: drawing_tool.mpl.gcf().canvas
 ```
 for Yaml, you need to add those extra steps
 
@@ -224,7 +251,7 @@ libraries: ["from math import tan, radians, sin, cos","from pysketcher import *"
 myfig={}
 sketchParse(head,myfig)
 ```
-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)
+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): this is used by the yaml definition of shapes
 
 ### Yaml
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 360 - 0
jupysketch-doc/docs/reference/wall.svg


+ 88 - 9
jupysketch-doc/site/reference/index.html

@@ -546,6 +546,33 @@
       </ul>
     </nav>
   
+</li>
+      
+        <li class="md-nav__item">
+  <a href="#wall" class="md-nav__link">
+    Wall
+  </a>
+  
+    <nav class="md-nav" aria-label="Wall">
+      <ul class="md-nav__list">
+        
+          <li class="md-nav__item">
+  <a href="#yaml_12" class="md-nav__link">
+    Yaml
+  </a>
+  
+</li>
+        
+          <li class="md-nav__item">
+  <a href="#python_12" class="md-nav__link">
+    Python
+  </a>
+  
+</li>
+        
+      </ul>
+    </nav>
+  
 </li>
       
         <li class="md-nav__item">
@@ -557,14 +584,14 @@
       <ul class="md-nav__list">
         
           <li class="md-nav__item">
-  <a href="#yaml_12" class="md-nav__link">
+  <a href="#yaml_13" class="md-nav__link">
     Yaml
   </a>
   
 </li>
         
           <li class="md-nav__item">
-  <a href="#python_12" class="md-nav__link">
+  <a href="#python_13" class="md-nav__link">
     Python
   </a>
   
@@ -934,6 +961,33 @@
       </ul>
     </nav>
   
+</li>
+      
+        <li class="md-nav__item">
+  <a href="#wall" class="md-nav__link">
+    Wall
+  </a>
+  
+    <nav class="md-nav" aria-label="Wall">
+      <ul class="md-nav__list">
+        
+          <li class="md-nav__item">
+  <a href="#yaml_12" class="md-nav__link">
+    Yaml
+  </a>
+  
+</li>
+        
+          <li class="md-nav__item">
+  <a href="#python_12" class="md-nav__link">
+    Python
+  </a>
+  
+</li>
+        
+      </ul>
+    </nav>
+  
 </li>
       
         <li class="md-nav__item">
@@ -945,14 +999,14 @@
       <ul class="md-nav__list">
         
           <li class="md-nav__item">
-  <a href="#yaml_12" class="md-nav__link">
+  <a href="#yaml_13" class="md-nav__link">
     Yaml
   </a>
   
 </li>
         
           <li class="md-nav__item">
-  <a href="#python_12" class="md-nav__link">
+  <a href="#python_13" class="md-nav__link">
     Python
   </a>
   
@@ -996,6 +1050,7 @@
 <li><a href="#arc_wtext">Arc_wText</a>: defines an arc with text positionned left (moving clock-wise) of arc half-way</li>
 <li><a href="#arrow1">Arrow1</a>: defines a line with arrow(s) given starting and ending point and arrow termination(s) -&gt;, \&lt;-&gt;, \&lt;-</li>
 <li><a href="#force">Force</a>: defines an Indication of a force by an arrow and a text (symbol)</li>
+<li><a href="#wall">Wall</a>: defines an hached box given starting, ending point and thickness, filled with a pattern</li>
 <li><a href="#"></a></li>
 </ul>
 <h2 id="line">Line</h2>
@@ -1180,12 +1235,36 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
 </code></pre>
 
 <p><img alt="Force" src="force.svg" /></p>
+<h2 id="wall">Wall</h2>
+<p><a href="#list-of-shapes">home</a> defines an hached box given starting, ending point and thickness, filled with a pattern</p>
+<h3 id="yaml_12">Yaml</h3>
+<pre><code class="yaml">theta: 30
+L: 8
+B: point(L-4,-2)                      # wall right end
+A: point(-4,tan(radians(theta))*L-2)  # wall left end
+wall: 
+    formula: Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.5,transparent=False)
+    style:
+        linecolor: black
+</code></pre>
+
+<h3 id="python_12">Python</h3>
+<pre><code class="python">theta = 30
+L = 8
+B = point(L-4,-2)                      # wall right end
+A = point(-4,tan(radians(theta))*L-2)  # wall left end
+wall= Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.5,transparent=False)
+wall.set_linecolor('black')
+</code></pre>
+
+<p><img alt="Wall" src="wall.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>
 <pre><code class="python">[1]: %matplotlib widget
 [2]: from pysketcher import *
-[3]: drawing_tool.set_coordinate_system(xmin=-10, xmax=10,ymin=-10, ymax=10,axis=True)
-[4]: drawing_tool.mpl.gcf().canvas
+[3]: from math import tan, radians, sin, cos # needed for python code
+[4]: drawing_tool.set_coordinate_system(xmin=-10, xmax=10,ymin=-10, ymax=10,axis=True)
+[5]: drawing_tool.mpl.gcf().canvas
 </code></pre>
 
 <p>for Yaml, you need to add those extra steps</p>
@@ -1195,8 +1274,8 @@ myfig={}
 sketchParse(head,myfig)
 </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)</p>
-<h3 id="yaml_12">Yaml</h3>
+<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): this is used by the yaml definition of shapes</p>
+<h3 id="yaml_13">Yaml</h3>
 <pre><code class="python">myfig={}
 sketch=&quot;&quot;&quot;
 # put here the yaml 'object' definition
@@ -1208,7 +1287,7 @@ d = myfig['object'].draw()
 drawing_tool.display()
 </code></pre>
 
-<h3 id="python_12">Python</h3>
+<h3 id="python_13">Python</h3>
 <pre><code class="python">drawing_tool.erase()
 # put the code of the object case here
 # replace object by the actual name line, rectangle, circle...

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 360 - 0
jupysketch-doc/site/reference/wall.svg


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
jupysketch-doc/site/search/search_index.json


BIN
jupysketch-doc/site/sitemap.xml.gz


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 99 - 3020
notebooks/Reference.ipynb