Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

side='both' for k3d.factory.mesh does not seem to take effect #392

Closed
BALOGHBence opened this issue Dec 12, 2022 · 3 comments
Closed

side='both' for k3d.factory.mesh does not seem to take effect #392

BALOGHBence opened this issue Dec 12, 2022 · 3 comments
Assignees

Comments

@BALOGHBence
Copy link

  • K3D version: 2.14.5
  • Python version: 2.14.5
  • Operating System: Windows 11

Description

The parameter side='both' does not have an effect on the results for the example at the bottom of the page here:
http://k3d-jupyter.org/reference/factory.mesh.html

What I Did

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

n_radii = 8
n_angles = 36

radii = np.linspace(0.125, 1.0, n_radii, dtype=np.float32)
angles = np.linspace(0, 2 * np.pi, n_angles, endpoint=False, dtype=np.float32)[..., np.newaxis]

x = np.append(np.float32(0), (radii * np.cos(angles)).flatten())
y = np.append(np.float32(0), (radii * np.sin(angles)).flatten())
z = np.sin(-x * y)

vertices = np.vstack([x, y, z]).T
indices = Triangulation(x, y).triangles.astype(np.uint32)

plt_mesh = k3d.mesh(vertices, indices,
                    color_map=matplotlib_color_maps.Jet,
                    attribute=z,
                    color_range=[-1.1, 2.01],
                    side='both')

plot = k3d.plot()
plot += plt_mesh
plot

One side is OK:
image
The other side is not rendered:
image

@artur-trzesiok
Copy link
Collaborator

Thanks! That is my mistake in documentation. Should be:

side='double' 

It is already fixed in devel.

@artur-trzesiok
Copy link
Collaborator

@artur-trzesiok
Copy link
Collaborator

Hi! Please check a 2.15.3 version of k3d. It is already available :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants