Getting centroids in icosahedral projection

Hello, I’m trying to put a dot on the centroid of each face of an icosahedral projection.

I tried to get geometries using projection.polygons().features, but the returned geometries does not align with the rendered faces and they are neither the inverse icosahedral:

I’m quite puzzled.

here the code: Filtrable icosahedral projection II / Michele Mauri | Observable

Thank you!

would you mind migrating these questions to github discussions? we’re trying to centralize the knowledge there. thanks in advance

re. your question, the clipping polygon is taken with the rotation aspect [0, 0, 0], which might not be the same as your map’s aspect.

Sure, good to know that that is the place.

I’ll post the questions there.

Btw i updated the post with the current code. so i should apply a rotation also to the polygons?

Because i imagined that but applygin a rotation of 0,0,0 still polygons are not aligned

the default rotation aspect for this projection is not [0, 0]; you could try path2 = d3.geoPath(d3.geoIcosahedral().rotate([0, 0])) and use that to draw the polygons and their centroids.

2 Likes