|
@@ -21,8 +21,10 @@
|
|
|
[home](#list-of-shapes) Defines a line providing start and end point
|
|
[home](#list-of-shapes) Defines a line providing start and end point
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-A: point(-5,-5)
|
|
|
|
|
-B: point(5,5)
|
|
|
|
|
|
|
+name: line
|
|
|
|
|
+shapes:
|
|
|
|
|
+ A: point(-5,-5)
|
|
|
|
|
+ B: point(5,5)
|
|
|
line: Line(A,B)
|
|
line: Line(A,B)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
@@ -30,16 +32,19 @@ line: Line(A,B)
|
|
|
A = point(-5,-5)
|
|
A = point(-5,-5)
|
|
|
B = point(5,5)
|
|
B = point(5,5)
|
|
|
line = Line(A,B)
|
|
line = Line(A,B)
|
|
|
|
|
+line.set_name("line")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Rectangle
|
|
## Rectangle
|
|
|
[home](#list-of-shapes) Defines a rectangle providing bottom left corner, x dimension, y dimension
|
|
[home](#list-of-shapes) Defines a rectangle providing bottom left corner, x dimension, y dimension
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-L: 8
|
|
|
|
|
-h: 5
|
|
|
|
|
-p: point(-(L/2),-(h/2))
|
|
|
|
|
-rectangle: Rectangle(p,L,h)
|
|
|
|
|
|
|
+name: rectangle
|
|
|
|
|
+shapes:
|
|
|
|
|
+ L: 8
|
|
|
|
|
+ h: 5
|
|
|
|
|
+ p: point(-(L/2),-(h/2))
|
|
|
|
|
+ rectangle: Rectangle(p,L,h)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
@@ -47,69 +52,85 @@ L = 8
|
|
|
h = 5
|
|
h = 5
|
|
|
p = point(-(L/2),-(h/2))
|
|
p = point(-(L/2),-(h/2))
|
|
|
rectangle = Rectangle(p,L,h)
|
|
rectangle = Rectangle(p,L,h)
|
|
|
|
|
+rectangle.set_name("rectangle")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Circle
|
|
## Circle
|
|
|
[home](#list-of-shapes) Defines a circle proving center and radius
|
|
[home](#list-of-shapes) Defines a circle proving center and radius
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-circle: Circle(point(0,0),5)
|
|
|
|
|
|
|
+name: circle
|
|
|
|
|
+shapes:
|
|
|
|
|
+ circle: Circle(point(0,0),5)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
circle = Circle(point(0,0),5)
|
|
circle = Circle(point(0,0),5)
|
|
|
|
|
+circle.set_name("circle")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Triangle
|
|
## Triangle
|
|
|
[home](#list-of-shapes) Defines a triangle providing three corner
|
|
[home](#list-of-shapes) Defines a triangle providing three corner
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-L: 3.0
|
|
|
|
|
-W: 4.0
|
|
|
|
|
-triangle: Triangle(p1=(W/2,0), p2=(3*W/2,W/2), p3=(4*W/5.,L))
|
|
|
|
|
|
|
+name: triangle
|
|
|
|
|
+shapes:
|
|
|
|
|
+ L: 3.0
|
|
|
|
|
+ W: 4.0
|
|
|
|
|
+ triangle: Triangle(p1=(W/2,0), p2=(3*W/2,W/2), p3=(4*W/5.,L))
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
L = 3.0
|
|
L = 3.0
|
|
|
W = 4.0
|
|
W = 4.0
|
|
|
triangle = Triangle(p1=(W/2,0), p2=(3*W/2,W/2), p3=(4*W/5.,L))
|
|
triangle = Triangle(p1=(W/2,0), p2=(3*W/2,W/2), p3=(4*W/5.,L))
|
|
|
|
|
+triangle.set_name("triangle")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Distance with text
|
|
## Distance with text
|
|
|
[home](#list-of-shapes) Defines a sizing mark with a label
|
|
[home](#list-of-shapes) Defines a sizing mark with a label
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-fontsize: 14
|
|
|
|
|
-t: r'$ 2\pi R^2 $' # sample text
|
|
|
|
|
-dwt: Distance_wText((-4,0), (8, 5), t, fontsize)
|
|
|
|
|
|
|
+name: dwt
|
|
|
|
|
+shapes:
|
|
|
|
|
+ fontsize: 14
|
|
|
|
|
+ t: r'$ 2\pi R^2 $' # sample text
|
|
|
|
|
+ dwt: Distance_wText((-4,0), (8, 5), t, fontsize)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
fontsize=14
|
|
fontsize=14
|
|
|
t = r'$ 2\pi R^2 $' # sample text
|
|
t = r'$ 2\pi R^2 $' # sample text
|
|
|
dwt = Distance_wText((-4,0), (8, 5), t, fontsize)
|
|
dwt = Distance_wText((-4,0), (8, 5), t, fontsize)
|
|
|
|
|
+dwt.set_name("dwt")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Text
|
|
## Text
|
|
|
[home](#list-of-shapes) Defines a given text positionned at the provided point
|
|
[home](#list-of-shapes) Defines a given text positionned at the provided point
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-text: Text(r'$c$', point(0,0))
|
|
|
|
|
|
|
+name: text
|
|
|
|
|
+shapes:
|
|
|
|
|
+ text: Text(r'$c$', point(0,0))
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
text = Text(r'$c$', point(0,0))
|
|
text = Text(r'$c$', point(0,0))
|
|
|
|
|
+text.set_name("text")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
## Cross
|
|
## Cross
|
|
|
[home](#list-of-shapes) Defines a cross positionned at the provided point
|
|
[home](#list-of-shapes) Defines a cross positionned at the provided point
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-cross: Cross(point(0,0))
|
|
|
|
|
|
|
+name: cross
|
|
|
|
|
+shapes:
|
|
|
|
|
+ cross: Cross(point(0,0))
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
cross = Cross(point(1,0))
|
|
cross = Cross(point(1,0))
|
|
|
|
|
+cross.set_name("cross")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -117,11 +138,14 @@ cross = Cross(point(1,0))
|
|
|
[home](#list-of-shapes) Defines an axis at the given point with a given label
|
|
[home](#list-of-shapes) Defines an axis at the given point with a given label
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-axis: Axis((0,0), 5, 'x', rotation_angle=0)
|
|
|
|
|
|
|
+name: axis
|
|
|
|
|
+shapes:
|
|
|
|
|
+ axis: Axis((0,0), 5, 'x', rotation_angle=0)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
axis = Axis((0,0), 5, 'x', rotation_angle=0)
|
|
axis = Axis((0,0), 5, 'x', rotation_angle=0)
|
|
|
|
|
+axis.set_name("axis")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -129,12 +153,14 @@ axis = Axis((0,0), 5, 'x', rotation_angle=0)
|
|
|
[home](#list-of-shapes) Defines an Arc providing a center point, a radius, a starting angle and an angle (rotates clock-wise)
|
|
[home](#list-of-shapes) Defines an Arc providing a center point, a radius, a starting angle and an angle (rotates clock-wise)
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-center: point(0,0)
|
|
|
|
|
-radius: 1
|
|
|
|
|
-angle: 120
|
|
|
|
|
-start_angle: 180-angle
|
|
|
|
|
-arc_angle: angle
|
|
|
|
|
-arc: Arc(center, radius, start_angle, arc_angle)
|
|
|
|
|
|
|
+name: arc
|
|
|
|
|
+shapes:
|
|
|
|
|
+ center: point(0,0)
|
|
|
|
|
+ radius: 1
|
|
|
|
|
+ angle: 120
|
|
|
|
|
+ start_angle: 180-angle
|
|
|
|
|
+ arc_angle: angle
|
|
|
|
|
+ arc: Arc(center, radius, start_angle, arc_angle)
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
@@ -144,6 +170,7 @@ angle = 120
|
|
|
start_angle = 180-angle
|
|
start_angle = 180-angle
|
|
|
arc_angle = angle
|
|
arc_angle = angle
|
|
|
arc = Arc(center, radius, start_angle, arc_angle)
|
|
arc = Arc(center, radius, start_angle, arc_angle)
|
|
|
|
|
+arc.set_name("arc")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -151,12 +178,14 @@ arc = Arc(center, radius, start_angle, arc_angle)
|
|
|
[home](#list-of-shapes) Defines an arc with text positionned left (moving clock-wise) of arc half-way
|
|
[home](#list-of-shapes) Defines an arc with text positionned left (moving clock-wise) of arc half-way
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-center: point(0,0)
|
|
|
|
|
-radius: 1
|
|
|
|
|
-angle: 120
|
|
|
|
|
-start_angle: 180-angle
|
|
|
|
|
-arc_angle: angle
|
|
|
|
|
-arc_wtxt: "Arc_wText(r'$<bslash>theta$', center, radius, start_angle, arc_angle)"
|
|
|
|
|
|
|
+name: arc_wtxt
|
|
|
|
|
+shapes:
|
|
|
|
|
+ center: point(0,0)
|
|
|
|
|
+ radius: 1
|
|
|
|
|
+ angle: 120
|
|
|
|
|
+ start_angle: 180-angle
|
|
|
|
|
+ arc_angle: angle
|
|
|
|
|
+ arc_wtxt: "Arc_wText(r'$<bslash>theta$', center, radius, start_angle, arc_angle)"
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
@@ -166,6 +195,7 @@ angle = 120
|
|
|
start_angle = 180-angle
|
|
start_angle = 180-angle
|
|
|
arc_angle = angle
|
|
arc_angle = angle
|
|
|
arc_wtxt = Arc_wText(r'$\theta$', center, radius, start_angle, arc_angle)
|
|
arc_wtxt = Arc_wText(r'$\theta$', center, radius, start_angle, arc_angle)
|
|
|
|
|
+arc_wtxt.set_name("arcwtxt")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -173,15 +203,18 @@ arc_wtxt = Arc_wText(r'$\theta$', center, radius, start_angle, arc_angle)
|
|
|
[home](#list-of-shapes) defines a line with arrow(s) given starting and ending point and arrow termination(s) ->, \<->, \<-
|
|
[home](#list-of-shapes) defines a line with arrow(s) given starting and ending point and arrow termination(s) ->, \<->, \<-
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-start: point(0,0)
|
|
|
|
|
-end: point(5,5)
|
|
|
|
|
-arrow1: Arrow1(start, end, style='<->')
|
|
|
|
|
|
|
+name: arrow1
|
|
|
|
|
+shapes:
|
|
|
|
|
+ start: point(0,0)
|
|
|
|
|
+ end: point(5,5)
|
|
|
|
|
+ arrow1: Arrow1(start, end, style='<->')
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
|
start = point(0,0)
|
|
start = point(0,0)
|
|
|
end = point(5,5)
|
|
end = point(5,5)
|
|
|
arrow1 = Arrow1(start, end, style='<->')
|
|
arrow1 = Arrow1(start, end, style='<->')
|
|
|
|
|
+arrow1.set_name("arrow1")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -190,11 +223,13 @@ arrow1 = Arrow1(start, end, style='<->')
|
|
|
|
|
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```yaml
|
|
```yaml
|
|
|
-x: 0
|
|
|
|
|
-y: 0
|
|
|
|
|
-contact: point(x, y)
|
|
|
|
|
-vector: point(-3,-5)
|
|
|
|
|
-force: Force(contact - vector, contact, r'$Force$', text_pos='start')
|
|
|
|
|
|
|
+name: force
|
|
|
|
|
+shapes:
|
|
|
|
|
+ x: 0
|
|
|
|
|
+ y: 0
|
|
|
|
|
+ contact: point(x, y)
|
|
|
|
|
+ vector: point(-3,-5)
|
|
|
|
|
+ force: Force(contact - vector, contact, r'$Force$', text_pos='start')
|
|
|
```
|
|
```
|
|
|
### Python
|
|
### Python
|
|
|
```python
|
|
```python
|
|
@@ -203,6 +238,7 @@ y = 0
|
|
|
contact = point(x, y)
|
|
contact = point(x, y)
|
|
|
vector = point(-3,-5)
|
|
vector = point(-3,-5)
|
|
|
force = Force(contact - vector, contact, r'$Force$', text_pos='start')
|
|
force = Force(contact - vector, contact, r'$Force$', text_pos='start')
|
|
|
|
|
+force.set_name("force")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|
|
@@ -211,14 +247,16 @@ force = Force(contact - vector, contact, r'$Force$', text_pos='start')
|
|
|
|
|
|
|
|
### Yaml
|
|
### Yaml
|
|
|
```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
|
|
|
|
|
|
|
+name: wall
|
|
|
|
|
+shapes:
|
|
|
|
|
+ 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
|
|
|
```python
|
|
```python
|
|
@@ -228,6 +266,7 @@ B = point(L-4,-2) # wall right end
|
|
|
A = point(-4,tan(radians(theta))*L-2) # wall left 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= Wall(x=[A[0], B[0]], y=[A[1], B[1]], thickness=-0.5,transparent=False)
|
|
|
wall.set_linecolor('black')
|
|
wall.set_linecolor('black')
|
|
|
|
|
+wall.set_name("wall")
|
|
|
```
|
|
```
|
|
|

|
|

|
|
|
|
|
|