0

I have created a 3d mesh in plotly.

import plotly.graph_objects as go

fig = go.Figure(data=[
    go.Mesh3d(
        x=[0, 1, 2, 0],
        y=[0, 0, 1, 2],
        z=[0, 2, 0, 1],
        i=[0, 0, 0, 1],
        j=[1, 2, 3, 2],
        k=[2, 3, 1, 3],
    )
])

fig.show()

enter image description here

Is there an easy way to calculate the volume (in cubic meters) of this mesh in plotly / python?

The object I showed should serve as an example. I am searching for a general approch for any object (not soleley for triangle/tetrahedral objects).

Kind Regards

Raphael
  • 673
  • 1
  • 9
  • 27
  • Take a look at this answer: https://stackoverflow.com/questions/61638966/find-volume-of-object-given-a-triangular-mesh – Davide_sd May 31 '22 at 11:32
  • Thanks for your reply and the helpful link :) The object I showed should serve as an example. I am searching for a general approch for any object (not soleley for triangle/tetrahedral objects). But maybe there is a way to reuse this also for my problem. – Raphael Jun 01 '22 at 06:04

0 Answers0