8

Hoping to get some advice on modeling stereographic projections. I found a pretty manual process but it doesn't hold up if the model gets too complicated. To clarify, I'm working with meshes because this is ultimately meant to be a printable model. Doing texture mapping isn't the end goal.

For reference, I'm talking about these kinds of objects https://www.thingiverse.com/search?q=Stereographic+projection&type=things&sort=relevant.

enter image description here

These are the my manual steps:

Issues I'm having

The process I describe below works, but its not ideal. Its processing lots and lots of mesh intersections so its really slow and anything more complicated than a simple grid just breaks down. Blender crashes, basically.

End goal

It seems there should be a way to simply project a mesh onto a UV sphere. Some process that will allow much more complicated mesh designs to be used.

I've tried combinations of shrinkwrap, simple deforms, casts, surface deforms, and some other things but nothing is quite working. So far using a cast kind of almost works, but its widely distorted.

My current manual process (poor man's version)

What I have now is creating a mesh grid first.

enter image description here

Then I extrude the grid and scale it to a point. I then select and merge all of the vertices at the point.

enter image description here enter image description here

I then create a UV sphere, add a boolean intersect on the sphere with the extruded grid, then apply that.

enter image description here enter image description here

Lastly I delete the resulting top vertex from the modified sphere which leaves me the mesh of the intersection.

enter image description here enter image description here

And finally, I can get this after adding a light source (final product):

enter image description here

This process works but is nowhere near ideal. If I make the grid mesh any more detailed, or try to make the sphere smoother Blender can't keep up and takes forever or crashes.

I've looked all over and but the only information I've found is about projecting textures, using 2 simple deform modifiers (which doesn't give me the result I'm going for), or a 5+ year old python script that has never been updated.

Anyone have some ideas about how to do this efficiently?

Geuis
  • 200
  • 9

1 Answers1

2

Method 1: Halfway there but easy

You could kinda solve this by adding a shrinkwrap modifier to the plane with your design. Set "Wrap Method" to "Tangent Normal Project" and set the "Target" to a sphere sitting on top of the plane. The projection is correct, but this only gives you half a sphere.

enter image description here enter image description here

Method 2: Use Geometry Nodes! (I used Blender 3.2)

The Final Boss method of doing this is to use Geometry Nodes. Using trigonometry (see here https://www.omnicalculator.com/math/triangle-angle for all triangle equations), you can calculate an offset vector for each point towards the light source, such that it falls on a circle of radius r.

Step 1. Calculate angle between light source and a Point

You know the light source location, and you know the location of each point on the plane. Using the formula Beta = arctan(x/h), Calculate angle Beta shown below. You can also calculate the hypotenuse d using Pythagoras theorem a^2 + b^2 = c^2.

enter image description here

Step 2. Calculate the offset distance from the light source to the sphere perimeter

We now have ingredients for a new triangle: 2 sides and an angle. One side is the sphere's radius. Another side is the light's height minus the radius. The third side, which we want, is the offset distance between the light and the sphere perimeter.

enter image description here

Here is an excerpt from omnicalculator on how to calculate the third side:

enter image description here

Step 3. Calculate an offset vector to shift each point towards the light source so it lands on the sphere's edge

Finally, if we have a vector between each point and the light source, we can scale this vector by 1 - c/d and use this as an offset in the Set Position node of geometry nodes. We will end up warping our plane mesh into a sphere with a perfect projection.

Node Tree

This is the node tree I used. You can use your own plane design, and replace my grid generator in the node tree with your own geometry.

Here is the node tree: enter image description here

Blend file - have fun with it!:

Iloveplants
  • 133
  • 7