question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError with mesh isobands

See original GitHub issue

Hi there!

I’m getting this error when I try to use the isobands() mesh method:

<vedo.plotter.Plotter object at 0x7f6a45f44590>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jonathancorcutt/anaconda3/envs/wellplan/lib/python3.7/site-packages/vedo/mesh.py", line 1814, in isobands
    bcf.GetOutput().GetCellData().GetScalars().SetName("IsoBands")
AttributeError: 'NoneType' object has no attribute 'SetName'

I’m loading in a (n, 3) array of vertices and creating a (flat surface) mesh with:

mesh = vedo.delaunay2D(vertices)

There’s 233,358 vertices and when plotted with:

vedo.show(mesh)

They look like this: image

But I’d like to shade this surface like this: image

It’d also be nice to make the surface a bit smoother.

Any suggeestions? 😃

Jonny

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jonnymaseraticommented, Mar 31, 2021

Great, thank you!

I keep learning more and more stuff I can do with this excellent library!

0reactions
marcomusycommented, Mar 26, 2021

just realized i forgot to answer this

It’s not documented in the examples how to assign the scalar since the imported shape already has that data assigned.

you can assign any number of arrays to points or cells of a mesh with mymesh.addPointArray(arr, "arrname") and/or mymesh.addCellArray(arr, "arrname")

Also mymesh.cmap("jet", arr, on="points", arrayName="arrname") will automatically add it when setting the colormap.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vedo.mesh API documentation
Return a new Mesh representing the isobands of the active scalars. This is a new mesh where the scalar is now associated to...
Read more >
Getting an Attribute Error : 'Mesh' object has no attribute 'ufl_cell'
My code is as follows import dolfinx import meshio def create_mesh(mesh, cell_type, prune_z=False): cells = mesh.get_cells_type(cell_type) ...
Read more >
How to fix 'AttributeError: 'Mesh' object has no attribute ...
Show activity on this post. The mesh is not a collection and has no active_index, hence the error.
Read more >
AttributeError: 'MeshPlotter' object has no attribute 'tk'
I have the following script, which uses Tkinter. class MeshPlotter(tk.Frame): def __init__(self, parent, filename): ...
Read more >
Script not working : AttributeError - ParaView Support
AttributeError : Attribute PartArrayStatus does not exist. This class does not allow ... AttributeError: 'NoneType' object has no attribute 'MeshParts'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found