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.

This is partly an issue and partly a question. (I didn’t see anywhere else to ask questions.)

I would like to draw a set of points on the surface of a sphere. I tried this code, using a k3d.points with a large point size to draw the sphere:

import numpy as np
import k3d

points = np.random.standard_normal((1000,3))
points = points / np.linalg.norm(points,axis=1)[:,None]

plot = k3d.plot()

plot += k3d.points([0, 0, 0],point_size = 2,color=0xeeeeee)
plot += k3d.points(points, point_size=0.01,color=0x000000)

plot.display()

However, this doesn’t seem to work very well. If I zoom out the black points get absorbed inside the white sphere, while if I zoom in they seem to be above its surface.

This might be a bug, so I’m reporting it here, but it also might be that k3d.points isn’t supposed to be used this way.

If setting point_size this big isn’t supported, is there a canonical way to draw a sphere in k3d? Triangulating my own mesh seems like overkill, given that some perfectly nice sphere generating code exists already in k3d_points, so I’m wondering if there’s another way to do it.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
artur-trzesiokcommented, May 24, 2022

Please download new version of k3d@2.14.0:

https://pypi.org/project/k3d/

0reactions
artur-trzesiokcommented, May 24, 2022

So preparation of new k3d is here https://github.com/K3D-tools/K3D-jupyter/pull/351

Read more comments on GitHub >

github_iconTop Results From Across the Web

An Easy-to-Follow Sphere Drawing Tutorial
How to Draw a 3D Sphere in 10 Easy Steps · Step 1: Draw Your Base Circle · Step 2: Creating the Field...
Read more >
3 Ways to Draw a Sphere - wikiHow
1. Gather the materials you need to draw the sphere. This is a basic method for drawing a sphere, so minimal materials are...
Read more >
How to Draw A Sphere – A Step by Step Guide
Sphere Drawing in just 6 Easy Steps! · Step 1 · Step 2 – Plan out the light source · Step 3 –...
Read more >
How to Draw a Sphere Step by Step - Artists Network
The first step in learning to draw a sphere is to draw a circle. Lightly sketch a square, and then slice off the...
Read more >
How to Draw a 3D Sphere - Really Easy Drawing Tutorial
1. Begin by drawing three straight lines. The longest is horizontal, with diagonal lines extending downward from each end. The lines should partially...
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