# How to draw triangles on the Mesh3D surface in Python

**URL:** <https://community.plotly.com/t/how-to-draw-triangles-on-the-mesh3d-surface-in-python/18100>\
**Category:** 📊 Plotly Python\
**Created:** [January 14, 2019, 8:21pm UTC](https://community.plotly.com/t/how-to-draw-triangles-on-the-mesh3d-surface-in-python/18100 "2019-01-14T20:21:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xjh](https://avatars.discourse-cdn.com/v4/letter/x/a4c791/32.png) [@xjh](https://community.plotly.com/u/xjh)\
**Post date:** [January 14, 2019, 8:21pm UTC](https://community.plotly.com/t/how-to-draw-triangles-on-the-mesh3d-surface-in-python/18100/1 "2019-01-14T20:21:56Z")

</div>

I used alphahull to draw a Mesh3D object shown as below. Is there a way to draw the triangle meshes on the surface?

The part of drawing code is

> go.Mesh3d(x=x,y=y,z=z,opacity=1.0, flatshading=True, intensity=z, colorscale = [[0, ‘rgb(255, 0, 0)’], [0.5, ‘rgb(0, 255, 0)’], [1, ‘rgb(0, 0, 255)’]], alphahull=1.35, showscale = True).

Thanks!

 ![reduced_state](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/6/6e20c992b09ea3911322ee5046a9c60c967250dd.png)

---

<div class="post-metadata">

**Author:** ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)\
**Post date:** [January 15, 2019, 10:57am UTC](https://community.plotly.com/t/how-to-draw-triangles-on-the-mesh3d-surface-in-python/18100/2 "2019-01-15T10:57:05Z")

</div>

@xjh To plot triangles on your surface, you should triangulate it first.  
In this notebook [https://plot.ly/~empet/15091](https://plot.ly/~empet/15091)  
is presented step by step how is triangulated a surface z=f(x,y)  
via the Delaunay triangulation (`scipy.spatial.Delaunay`) of the planar region  
where the function f is defined.

This a mesh3d plot associated to such a triangulation:  
[https://plot.ly/~empet/14743](https://plot.ly/~empet/14743).
