title: Plotly Mesh3d plot from a Wavefront OBJ file
body: <p><strong>I am trying to plot a 3D scan of a leg using Plotly's <code>Mesh3D</code>.</strong></p>
  
  <p>I have used <code>scatter_3d</code> with the XYZ points to show this concept using:</p>
  
  <pre><code>fig = px.scatter_3d(df, x='x', y='y', z='z', opacity = 0.8)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/J6qr3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/J6qr3.png" alt="Plotly 3D Scatter Plot of XYZ points"></a></p>
  
  <p>However, it does not look like a surface. Therefore, I tried <code>Mesh3d</code>, using:</p>
  
  <pre><code>fig = go.Figure(data=[go.Mesh3d(x=x, y=y, z=z, color='lightpink', opacity=0.50)])
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1LtUe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1LtUe.png" alt="Plotly 3D Mesh of XYZ points"></a></p>
  
  <p>Obviously, this plot is not smooth. I've tried to sort the df before rendering the plots but it did not help. </p>
  
  <p>To reiterate, I am looking for a smooth surface plot of this XYZ data. </p>
  
  <p>Here is the scan's <a href="https://pastebin.com/ZiZy1AEy" rel="nofollow noreferrer">XYZ data</a>.</p>
  
  <p><strong>Edit: Continued Information on Introduction of Surface Plot</strong></p>
  
  <p>I implemented the Surface plot with the code below. Unfortunately, no plot is rendered (no error is accompanied, either).</p>
  
  <pre><code>colnames = ['x', 'y', 'z']
  df = pd.read_csv('sandbox\leg.txt', sep = ' ', header = None, names = colnames)
  x, y = np.array(df['x'].tolist()), np.array(df['y'].tolist())
  df2 = df.pivot(index = 'x', columns = 'y', values = 'z')
  z = df2.values
  fig = go.Figure(data=[go.Surface(z=z, x=x, y=y)])
  fig.show()
  </code></pre>