20
$\begingroup$

So I'm making a 2d animation in blender, using the z space as layers, and the camera is in orthographic view.
I'm trying to morph a square plane to be a flat circle, but I have no idea how to even approach it.

$\endgroup$
2
  • 1
    $\begingroup$ Start with a circle, it is easier to go from a circle to a square than the other way. You can then reverse the keyframes $\endgroup$
    – J Sargent
    Commented May 11, 2015 at 17:21
  • $\begingroup$ How would I go about morphing the circle to a square? $\endgroup$ Commented May 11, 2015 at 17:23

6 Answers 6

16
$\begingroup$

Add a cube to your scene, enter edit mode, and delete the top and bottom faces. Select all and press Ctrl+N and check the Inside checkbox in the Tools menu.

making Cube Target

Now add a circle and add a Shrinkwrap modifier to it. Select the cube as the Target and set the mode to Project. Now press the Apply as Shape Key option.

Shape Keys

You can now go to the Object Data panel and change the influence of your new shapekey. You can also animate it by hovering and pressing I. To go from a square to a circle, sart with an influence of 1 and then animate it going to 0. You can also delete the cube mesh now, it is not needed for the animation to work.

Final Result:

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ This one wins for flexibility as you could make any shape as a target. $\endgroup$
    – 3pointedit
    Commented May 11, 2015 at 22:25
24
$\begingroup$

The easiest way, in my opinion, is to use the 'Cast' modifier. Using a subdivided plane you can cast/warp an object from one shape, to another, preset shape:

enter image description here

Animating the 'Factor' allows you to switch between the original shape and the 'cast' shape.

$\endgroup$
2
  • 3
    $\begingroup$ Oh my gosh! These answers are amazing! Thank you guys for your quick responses, and I love your videos, Ray Mairlot, btw. $\endgroup$ Commented May 11, 2015 at 18:08
  • $\begingroup$ + 1 for not applying any modifiers $\endgroup$ Commented May 12, 2015 at 14:51
13
$\begingroup$

Mapping a disc to a square


Journal of Computer Graphics Techniques Vol. 5, No. 2, 2016 http://jcgt.org. Mappings between Sphere, Disc, and Square. Martin Lambers. outlines a number of disc to square, and square to disc mappings

enter image description here

One of which is the elliptical square to disc mapping

$$\begin{align} u = x\sqrt(1 - y^2/2)\\ v = y\sqrt(1 - x^2/2)\\ \end{align}$$

Test script that adds a 16 x 16 grid (basis "square" shapekey) and it's elliptical mapping as a shapekey "circle"

import bpy
import bmesh
from math import sqrt
from bpy import context
collection = context.collection
me = bpy.data.meshes.new("Squircle")
obj = bpy.data.objects.new("Squircle", me)

bm = bmesh.new()
bmesh.ops.create_grid(bm, x_segments=16, y_segments=16, size=1)
def squircle(x, y):
    u = x * sqrt(1 - y * y / 2)
    v = y * sqrt(1 - x * x / 2)
    return u, v

bm.to_mesh(me)
sk = obj.shape_key_add(name="Square")
ci = obj.shape_key_add(name="Circle")    
for v in bm.verts:
    ci.data[v.index].co.xy = squircle(*v.co.xy)
collection.objects.link(obj)

Test on all mappings. Elliptic mapping above is row 1 column 4.

enter image description here

$\endgroup$
1
  • $\begingroup$ Many thanks, I've been searching for this for ages (to use with the node Animation nodes plugin and scatter random vectors on a circle / tube) $\endgroup$ Commented Apr 15, 2020 at 22:03
11
$\begingroup$

If all you need is a shape you can use the To Sphere tool.

Add a plane, subdivide it and press ShiftAlt S

enter image description here

To animate create a shape key for the square part and a second shape key for the circle and animate the value for the second shape key.

Shape keys are created in object mode.

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ And just when the hopes were highest that nobody had mentioned the old to Sphere, Well remembered. $\endgroup$ Commented Mar 9, 2018 at 17:01
4
$\begingroup$

Same as the answer of Ray Mairlot, but with shrinkwrap (as Cast modifier can go too far and make it like a clover). NᴏᴠɪᴄᴇIɴDɪsɢᴜɪsᴇ pointed it out, but here's a way to do it in less steps.

shrinkwrap technique with less steps

  1. New plane
  2. New circle
  3. Extrude and fill the hole of the circle.
  4. Subdivide plane by 10
  5. Add modifier Shrinkwrap to plane
  6. Set the target of the Shrinkwrap to be the circle
  7. Apply as shape key done
$\endgroup$
3
$\begingroup$

Another non destructive way of doing this is using a subdivision modifier. enter image description here

  • Add plane
  • Add a Subdivision surface Modifier
  • Switch the Subdivision algorithm from Catmull-Clark to Simple
  • Add Cast Modifier
  • Use factor to liking (1.00 means a complete circle)
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .