浏览代码

user guide update

Gilbert Brault 5 年之前
父节点
当前提交
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
 - [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) ->, \<->, \<-
 - [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)
 - [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
 ## Line
@@ -205,6 +206,31 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
 ```
 ```
 ![Force](reference/force.svg)
 ![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
 ## 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
 [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
 ```python
 [1]: %matplotlib widget
 [1]: %matplotlib widget
 [2]: from pysketcher import *
 [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
 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={}
 myfig={}
 sketchParse(head,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
 ### Yaml
 
 

文件差异内容过多而无法显示
+ 360 - 0
jupysketch-doc/docs/reference/wall.svg


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

@@ -546,6 +546,33 @@
       </ul>
       </ul>
     </nav>
     </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>
       
       
         <li class="md-nav__item">
         <li class="md-nav__item">
@@ -557,14 +584,14 @@
       <ul class="md-nav__list">
       <ul class="md-nav__list">
         
         
           <li class="md-nav__item">
           <li class="md-nav__item">
-  <a href="#yaml_12" class="md-nav__link">
+  <a href="#yaml_13" class="md-nav__link">
     Yaml
     Yaml
   </a>
   </a>
   
   
 </li>
 </li>
         
         
           <li class="md-nav__item">
           <li class="md-nav__item">
-  <a href="#python_12" class="md-nav__link">
+  <a href="#python_13" class="md-nav__link">
     Python
     Python
   </a>
   </a>
   
   
@@ -934,6 +961,33 @@
       </ul>
       </ul>
     </nav>
     </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>
       
       
         <li class="md-nav__item">
         <li class="md-nav__item">
@@ -945,14 +999,14 @@
       <ul class="md-nav__list">
       <ul class="md-nav__list">
         
         
           <li class="md-nav__item">
           <li class="md-nav__item">
-  <a href="#yaml_12" class="md-nav__link">
+  <a href="#yaml_13" class="md-nav__link">
     Yaml
     Yaml
   </a>
   </a>
   
   
 </li>
 </li>
         
         
           <li class="md-nav__item">
           <li class="md-nav__item">
-  <a href="#python_12" class="md-nav__link">
+  <a href="#python_13" class="md-nav__link">
     Python
     Python
   </a>
   </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="#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="#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="#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>
 <li><a href="#"></a></li>
 </ul>
 </ul>
 <h2 id="line">Line</h2>
 <h2 id="line">Line</h2>
@@ -1180,12 +1235,36 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
 </code></pre>
 </code></pre>
 
 
 <p><img alt="Force" src="force.svg" /></p>
 <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>
 <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 *
-[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>
 </code></pre>
 
 
 <p>for Yaml, you need to add those extra steps</p>
 <p>for Yaml, you need to add those extra steps</p>
@@ -1195,8 +1274,8 @@ myfig={}
 sketchParse(head,myfig)
 sketchParse(head,myfig)
 </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)</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={}
 <pre><code class="python">myfig={}
 sketch=&quot;&quot;&quot;
 sketch=&quot;&quot;&quot;
 # put here the yaml 'object' definition
 # put here the yaml 'object' definition
@@ -1208,7 +1287,7 @@ d = myfig['object'].draw()
 drawing_tool.display()
 drawing_tool.display()
 </code></pre>
 </code></pre>
 
 
-<h3 id="python_12">Python</h3>
+<h3 id="python_13">Python</h3>
 <pre><code class="python">drawing_tool.erase()
 <pre><code class="python">drawing_tool.erase()
 # put the code of the object case here
 # put the code of the object case here
 # replace object by the actual name line, rectangle, circle...
 # replace object by the actual name line, rectangle, circle...

文件差异内容过多而无法显示
+ 360 - 0
jupysketch-doc/site/reference/wall.svg


文件差异内容过多而无法显示
+ 1 - 1
jupysketch-doc/site/search/search_index.json


二进制
jupysketch-doc/site/sitemap.xml.gz


文件差异内容过多而无法显示
+ 99 - 3020
notebooks/Reference.ipynb