Skip to content

Commit 05d41b0

Browse files
authored
add setup blocks for imports
1 parent 5a7d6e2 commit 05d41b0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/src/primitives.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ They are defined by an origin and a radius.
3838
While you can technically create a HyperSphere of any dimension, decomposition
3939
is only defined in 2D and 3D.
4040

41+
```@setup hypersphere
42+
using GeometryBasics
43+
```
4144
```@repl hypersphere
4245
s1 = HyperSphere{4, Int}(Point{4, Int}(0), 5)
4346
s2 = Sphere(Point3f(0, 0, 1), 1)
@@ -51,6 +54,10 @@ The coordinates of Circle are defined in anti-clockwise order.
5154

5255
A `Cylinder` is a 3D shape defined by two points and a radius.
5356

57+
58+
```@setup cylinder
59+
using GeometryBasics
60+
```
5461
```@repl cylinder
5562
c = Cylinder(Point3f(-1, 0, 0), Point3f(0, 0, 1), 0.3f0) # start point, end point, radius
5663
```
@@ -63,6 +70,10 @@ Cylinder supports normals an Tessellation, but currently no texture coordinates.
6370
coming together into a sharp point.
6471
It is defined by by the center point of the base, its height and its width.
6572

73+
74+
```@setup pyramid
75+
using GeometryBasics
76+
```
6677
```@repl pyramid
6778
p = Pyramid(Point3f(0), 1f0, 0.3f0) # center, height, width
6879
```
@@ -74,6 +85,9 @@ Pyramid supports normals, but currently no texture coordinates or tessellation
7485
In GeometryBasics `Tessellation` is a wrapper type for primitives which communicates
7586
how dense the mesh generated from one should be.
7687

88+
```@setup tessellation
89+
using GeometryBasics
90+
```
7791
```@repl tessellation
7892
t = Tessellation(Cylinder(Point3f(0), Point3f(0,0,1), 0.2), 32) # 32 vertices for each circle
7993
normal_mesh(t)
@@ -178,4 +192,4 @@ function GeometryBasics.texturecoordinates(::Parallelepiped{T}) where {T}
178192
]
179193
return FaceView(uvs, fs)
180194
end
181-
```
195+
```

0 commit comments

Comments
 (0)