11Geometry
2- ========
2+ ********
33
44* :mod: `compas.geometry `
55
@@ -10,6 +10,27 @@ The primitives and transformations provide an object-oriented interface to the g
1010Basic examples
1111==============
1212
13+ .. code-block :: python
14+
15+ >> > x = [1.0 , 0.0 , 0.0 ]
16+ >> > y = [0.0 , 1.0 , 0.0 ]
17+ >> > add_vectors(x, y)
18+ [1.0 , 1.0 , 0.0 ]
19+
20+ .. code-block :: python
21+
22+ >> > x = Vector(1.0 , 0.0 , 0.0 )
23+ >> > y = Vector(0.0 , 1.0 , 0.0 )
24+ >> > add_vectors(x, y)
25+ [1.0 , 1.0 , 0.0 ]
26+
27+ .. code-block :: python
28+
29+ >> > x = Vector(1.0 , 0.0 , 0.0 )
30+ >> > y = Vector(0.0 , 1.0 , 0.0 )
31+ >> > x + y
32+ Vector(1.000 , 1.000 , 0.000 )
33+
1334 .. code-block :: python
1435
1536 >> > x = [1.0 , 0.0 , 0.0 ]
@@ -40,8 +61,7 @@ Basic examples
4061.. code- block:: python
4162
4263 >> > points = [[0.0 , 0.0 , 0.0 ], [1.0 , 0.0 , 0.0 ], [1.0 , 1.0 , 0.0 ], [0.0 , 1.0 , 0.0 ]]
43- >> > polygon = Polygon(points)
44- >> > area_polygon(points) == polygon.area()
64+ >> > area_polygon(points) == Polygon(points).area()
4565 True
4666
4767.. code- block:: python
@@ -50,6 +70,7 @@ Basic examples
5070 >> > X = matrix_from_axis_and_angle([0.0 , 0.0 , 1.0 ], radians(30 ))
5171 >> > transform_points(points, X)
5272
73+
5374.. intersections
5475
5576.. shape transformations
@@ -58,37 +79,3 @@ Basic examples
5879
5980.. numpy
6081
61-
62-
63- Primitives
64- ==========
65-
66- .. autosummary::
67- :toctree: generated/
68- :nosignatures:
69-
70- compas.geometry.Circle
71- compas.geometry.Frame
72- compas.geometry.Line
73- compas.geometry.Plane
74- compas.geometry.Point
75- compas.geometry.Polygon
76- compas.geometry.Polyline
77- compas.geometry.Vector
78-
79-
80- Shapes
81- ======
82-
83- .. autosummary::
84- :toctree: generated/
85- :nosignatures:
86-
87- compas.geometry.Box
88- compas.geometry.Capsule
89- compas.geometry.Cone
90- compas.geometry.Cylinder
91- compas.geometry.Polyhedron
92- compas.geometry.Sphere
93- compas.geometry.Torus
94-
0 commit comments