Skip to content

Commit

Permalink
Fix points_to_polydata
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Jan 1, 2024
1 parent 4941737 commit ae79c88
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions PVGeo/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,11 @@ def points_to_poly_data(points, copy_z=False):
pdata = pv.PolyData(points)

# Add attributes if given
scalSet = False
for i, key in enumerate(keys):
data = convert_array(atts[:, i], name=key)
pdata.GetPointData().AddArray(data)
if not scalSet:
pdata.GetPointData().SetActiveScalars(key)
scalSet = True
pdata.point_data[key] = convert_array(atts[:, i])
if copy_z:
z = convert_array(points[:, 2], name='Elevation')
pdata.GetPointData().AddArray(z)
pdata.point_data['Elevation'] = z
return pv.wrap(pdata)


Expand Down

0 comments on commit ae79c88

Please sign in to comment.