# Mesh Parametric Surface

**URL:** https://discourse.julialang.org/t/mesh-parametric-surface/84579
**Category:** Visualization
**Tags:** question, mesh
**Created:** [July 21, 2022, 5:57am UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579 "2022-07-21T05:57:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Veenty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/veenty/32/50940_2.png) [@Veenty](https://discourse.julialang.org/u/Veenty)
#### Post date: [July 21, 2022, 5:57am UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579/1 "2022-07-21T05:57:33Z")

</div>

I have a surface that can be described by f(u,v), and I would like to generate a mesh of this object (so that I can later put it in Blender/Paraview). Any guidelines on how to do it in Julia?

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [July 21, 2022, 9:56am UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579/2 "2022-07-21T09:56:02Z")

</div>

There are multiple ways of doing it. If you are doing a lot of geometry processing try:

> **[GitHub - JuliaGeometry/Meshes.jl: Computational geometry and meshing...](https://github.com/JuliaGeometry/Meshes.jl)**
>
> Computational geometry and meshing algorithms in Julia - GitHub - JuliaGeometry/Meshes.jl: Computational geometry and meshing algorithms in Julia

Maybe you can instantiate specific vertices in the Cartesian product of the parameter space (u,v) and connect with quadrangles?

---

<div class="post-metadata">

### Author: ![Veenty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/veenty/32/50940_2.png) [@Veenty](https://discourse.julialang.org/u/Veenty)
#### Post date: [July 21, 2022, 2:26pm UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579/3 "2022-07-21T14:26:04Z")

</div>

I can’t seem to find quadrangles in the documentation? I was reading this library, but I can’t figure out how to do this from the documentation. (Also I’ve never had to manually construct a mesh)

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [July 22, 2022, 11:13am UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579/4 "2022-07-22T11:13:32Z")

</div>

Try to read the tests of the package as they are quite exhaustive.

I understand that you can simply instantiate vertices with your parametrization, for instance you have a function:

```julia
f(u,v) = Point3(x(u,v), y(u,v), z(u,v))

```

So you can create a lattice:

```julia
vertices = [f(u,v) for u in us for v in vs]

```

and connect a few of them, for example with a grid topology:

```julia
topology = GridTopology(length(us)-1, length(vs)-1)

```

The simple mesh is then:

```julia
mesh = SimpleMesh(vertices, topology)

```

---

<div class="post-metadata">

### Author: ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)
#### Post date: [November 9, 2022, 12:04pm UTC](https://discourse.julialang.org/t/mesh-parametric-surface/84579/5 "2022-11-09T12:04:46Z")

</div>

In more recent versions, you can also use `RectilinearGrid(x, y, z)` as an alternative where `x`, `y` and `z` are vectors.
