@@ -69,7 +69,8 @@ To create a mesh one can provide one the following.
6969First, let's create four points and four faces. Each face is an integer connecting the points according to their array index.
7070
7171``` @example
72- mypoints = [
72+ using GeometryBasics, GLMakie
73+ points = [
7374 Point3f(0,0,0),
7475 Point3f(0,0,1),
7576 Point3f(0,1,0),
@@ -83,42 +84,15 @@ myfaces = [
8384 TriangleFace(2,3,4)
8485 ]
8586
86- mymesh = Mesh(mypoints, myfaces)
87- ```
88-
89- As seen above, the mesh is just a sequence of triangles. Next, let's create a similar ` Mesh ` by providing the triangles directly.
90-
91- ``` @example
92- mytriangles = [
93- Triangle(pts[[1,2,3]]...),
94- Triangle(pts[[1,2,4]]...),
95- Triangle(pts[[1,3,4]]...),
96- Triangle(pts[[2,3,4]]...)
97- ]
98-
99- mymesh2 = Mesh(mytriangles)
100- GeometryBasics.faces(mymesh)
87+ mymesh = Mesh(points, myfaces)
88+ GLMakie.mesh(mymesh)
10189```
10290
91+ As seen above, the mesh is just a sequence of points connected by triangle faces.
10392``` @example
10493GeometryBasics.coordinates(mymesh)
10594```
10695
107- Note that these functions may not apply to all meshes. For example, ` mymesh2 `
108- above was not created with ` Faces ` so ` faces ` will return ` nothing ` .
109-
110- ``` @example
111- GeometryBasics.faces(mymesh2)
112- ```
113-
114- With [ Makie.jl] ( https://docs.makie.org ) and it's backend GLMakie, one can visualize the mesh:
115-
116- ``` @example
117- using GLMakie
118-
119- GLMakie.mesh(mymesh)
120- ```
121-
12296
12397### Meshing.jl
12498
0 commit comments