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.

Very high aspect ratio meshes

See original GitHub issue

Hello,

my application might generate meshes with very high aspect ratio. An example is given with the code below:

import k3d
import numpy as np
from matplotlib.tri import Triangulation

f = lambda z: (z**2 + 1) / (z**2 - 1)
x = y = np.linspace(-2, 2, 300)
xx, yy = np.meshgrid(x, y)
zz = f(xx + 1j * yy)
mag = np.absolute(zz)
phase = np.angle(zz)

fig = k3d.plot()
xx, yy, mag, phase = [t.flatten().astype(np.float32) for t in [xx, yy, mag, phase]]
vertices = np.vstack([xx, yy, mag]).T.astype(np.float32)
indices = Triangulation(xx, yy).triangles.astype(np.uint32)

surf = k3d.mesh(vertices, indices,
    side = "double",
    volume_bounds = (min(xx), max(xx), min(yy), max(yy), min(phase), max(phase)),
    color_map = k3d.paraview_color_maps.Erdc_iceFire_H,
    attribute = phase)

fig += surf
fig.display()

Notice that the mesh ranges from -2 to 2 in the X/Y axis:

K3D-1623147202928

Here the problem is that I can’t zoom in enough to view the details. Zooming in all the way I get this:

K3D-1623147251200

What can I try?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
artur-trzesiokcommented, Jul 9, 2021

Hi David!

It is hard to say where old version are stored. I will guess that in web browser cache.

I recommend also re run:

jupyter nbextension install --py k3d
jupyter nbextension enable --py k3d

0reactions
Davide-sdcommented, Jul 9, 2021

Thanks @artur-trzesiok . Those two lines solved the problem!!!

Going back to the issue, now the situation is greatly improved! I consider this issue resolved. Thank you very much!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ANSYS Meshing] Very high aspect ratio - CFD Online
Hi, I used Ansys meshing to create a mesh with 10E-6 m first boundary layer height. There are few elements with crazy aspect...
Read more >
Aspect ratio - CENOS Documentation
Aspect ratio is the measure of mesh element's deviation from having all sides of equal length. A high aspect ratio occurs within long,...
Read more >
Meshing high aspect ratio geometry - COMSOL
I'm trying to mesh a geometry with a very high aspect ratio (see screenshot) with a vertical dimension ~1 km and horizontal dimension...
Read more >
Mesh quality : r/CFD - Reddit
A high aspect ratio is not ALWAYS bad mesh. If the high aspect ratio exists with the longer dimension in the direction of...
Read more >
Notes on CFD: General Principles - 8.2 Aspect ratio
Meshes include cells with high aspect ratio for efficiency, by exploiting a prior understanding that the gradients in some flow properties ...
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