Volume Integral of extruded Surface
See original GitHub issueI am trying to compute the volume of a extruded surface within a minimal example to validate for future computation.
Therfore I export a pyramid-like mesh.ply file from Rhino3D and import with PyVista and extrude the PolySurfac in Y-Direction.
Unfortunatly the mesh.volume dose not give the right volume.
Its supposed to be: 2mm x 2mm x 1mm = 4mm³ (the tip of the pyramd has the same volume as the cut-out) and Rhino3D validates that.
To Reproduce
import pyvista as pv
import numpy as np
path = 'Path/To/File'
mesh = pv.read(path + "/pyramid.ply")
ext = mesh.extrude([0, 1, 0], capping=True)
print("Volume = ", ext.volume)
strangely enough, the volume is dependet in the position of the polySurface in space, its orientation.
and the direction of the extrusion (mesh.extrude([0, 1, 0]
vs. mesh.extrude([0, -1, 0]
)
Also: like in the examples, the computation of primitieves worke just fine.
Dose anybody know if the is some Known issue, with the volume of extruded surfaces from PolyData, or probably more easy, somthing fundamental, which I’m doing wrong?
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@banesullivan @akaszynski @tkoyama010 I did some poking around in
PolyDataFilters.extrude
and it looks like switching tovtkLinearCellExtrusionFilter
and using that interface fixes the issue, but I am not familiar enough with how this would impact the use ofextrude
downstream. Any thoughts?Would you mind submitting a basic PR with these changes? Don’t worry about testing or quality, but if you get it at least in a draft I can take a look.