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.

More subdivision options for icosahedron geometry

See original GitHub issue

About the icosahedron geometry, I understand that the detail parameter is an option for subdividing each edge into more vertices, which are projected onto a sphere. However it seems that some possible subdivision are not allowed.

For example, this is the subdivision with detail = 1 :

2020-08-27_125429

And this is with detail = 2 :

2020-08-27_125402

It looks like the following in-between subdivision would be possible but is not currently allowed :

Untitled-1

Is there an issue with this kind of subdivision ? If not, would you be interested in a PR ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
marcofugarocommented, Aug 28, 2020

I use this code to generate a sphere with more fine-tuned picking of the level of detail, maybe this can be useful to you

const segments = 2000
const geometry = new THREE.BufferGeometry()
const positions = new Float32Array(segments * 3)

// Uniform distribution of points on the surface of a sphere
// https://gist.github.com/AngeloYazar/6091095
let inc = Math.PI * (3 - Math.sqrt(5))
let off = 2 / segments
let radius = 1.5

for (let i = 0; i < segments; i++) {
  let y = i * off - 1 + off / 2
  let r = Math.sqrt(1 - y * y)
  let phi = i * inc

  positions[3 * i] = radius * Math.cos(phi) * r
  positions[3 * i + 1] = radius * y
  positions[3 * i + 2] = radius * Math.sin(phi) * r
}

geometry.setAttribute('position', new THREE.BufferAttribute(positions, 3))
1reaction
mrdoobcommented, Sep 2, 2020

I think a PR would be great 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Regular icosahedron - Wikipedia
Cartesian coordinates​​ The 12 edges of a regular octahedron can be subdivided in the golden ratio so that the resulting vertices define a...
Read more >
Subdivided icosahedron points do not lie on circumscribed ...
How do we subdivide an icosahedron so that the new vertices created on each subdivision also lie on the circumscribed sphere.
Read more >
How to generate a subdivided icosahedron? - Stack Overflow
The essential idea is to start with an icosahedron (which has 20 triangular faces) and to repeatedly subdivide each triangular face into ...
Read more >
Icosadeltahedral Geometry of Geodesic Domes, Fullerenes ...
Icosa(delta)hedral Geodesic Domes​​ Each side of the (starting) icosahedron can be iteratively subdivided into equilateral triangles. The new ...
Read more >
Sphere | ProBuilder | 5.0.6 - Unity - Manual
When you increase the subdivisions, the shape looks smoother, more sphere-like, but the geometry also becomes more complex.
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