3
$\begingroup$

I have a 2d flat mesh that i would like to manipulate without any distortion to create a 3D shape. Typically for the pie below, joining the 2 edges together would make a 3D cone. Do you have any idea of which modifier to use ? enter image description here Cone paper pattern

$\endgroup$
  • $\begingroup$ I don't understand what result do you expect. Could you provide screenshot with something similar to your expectation? $\endgroup$ – cgslav Oct 2 '16 at 16:11
  • $\begingroup$ Sorry it was not very clear :) I added an illustration on how we do this manipulation with a real piece of paper, hope it helps understanding $\endgroup$ – CLeOpatra Oct 2 '16 at 16:38
  • 1
    $\begingroup$ I'm not sure constraints work on vertex groups. Perhaps a shape key or, possibly, a set of several shape keys. Rigging may work as well. Or pinning the centre vertex and using cloth sim to have the paper fall onto a cone with collision physics. $\endgroup$ – user27640 Oct 2 '16 at 17:12
  • 2
    $\begingroup$ The proportional editing would distord my mesh, wouldn't it ? I am sorry i am fairly new to blender... Actually i am not interested in creating cones but the physic simulation behind this operation and if it could be done in blender. Would the armature modifier or the laplacian deform modifier be useful here ? $\endgroup$ – CLeOpatra Oct 2 '16 at 17:32
  • 2
    $\begingroup$ @Duane OK, I can see the point now :) But to do that animation, you'd still need both the dimensions of the flat piece of paper and the dimensions of the final cone. It seems easier to start from a cone and make it flat than to start from a flat piece. $\endgroup$ – Karolina Oct 2 '16 at 17:37
4
$\begingroup$

Managed to approximate this with Shape Keys, starting out with a cone, it's easier than starting out with a flat shape and bending it into your will.

Cone Final

  1. Add a cone mesh with whatever final dimensions you want it to have
  2. Move it in edit mode so it's center is on the center of the base (not mid height)
  3. Erase the left part and the bottom face and then add a Mirror modifier

Add Cone

  1. Add two new shape keys one is the base as it currently is, and another (Key 1) will be it's flat shape.
  2. Now some math, in edit mode check the length of one of the cone large side edges with the 3D view > Properties Region > Mesh Display > Length that will determine the radius of the final flat shape
  3. Add a new mesh circle object, it's radius should be the length of the previously measured edge, and it the number radius vertices should be 1 1/4 the number of vertices of the cone. So if by default a cone has 32 vertex so the circle should have 1.25 x 32 = 40 vertices.
  4. Erase one quarter of the circle's edges so that they are centered around the edge you ripped in Step 3

Circle

  1. Now with shape Key 1 selected enter edit mode on the cone, move the central vertex down until it is flat
  2. Scale all the vertex in the cone base so that they reach the circle radius (use snap for better precision)

Flatten

  1. Press .(Period Key) to transform centered in 3D Cursor
  2. Hide all the cone vertex but the outer rim of the base, including the vertex at X=0
  3. With Proportional Edit set to Connected and the Fallof type set to Linear, select only the lower vertex and rotate them all 1/8 of a turn, so they snap to the open end of the circle. Adjust the Proportional Edit radius with the mouse wheel.

Rotate

13.Profit! (Adjust progression with the shapekey Value Slider)

Final resul

You may then give it a more natural or organic looking transition with some modifiers or with manually bending the shape a little with more shapekeys

| improve this answer | |
$\endgroup$
5
$\begingroup$

Using a script to make the two shape keys. Change the r and h of result cone.

enter image description here

Example of radius 1, height 2, 1 and 0.5 cones.

import bpy
import bmesh
from mathutils import Vector
from math import radians, sin, cos, sqrt

from bpy import context # for testing

r = 1 # radius of cone
h = 1 # height of cone
sectors = 16
l = sqrt(r**2 + h**2) # hypotenuse
# sector will have angle 

theta = radians(360) * r / l
dtheta = theta / sectors

# build the base

bm = bmesh.new()

verts = []
for i in range(sectors + 1):
    a = i * dtheta
    verts.append(bm.verts.new((l * cos(a), l * sin(a), 0)))

topvert = bm.verts.new((0, 0, 0))
for i in range(sectors):
    bm.faces.new([verts[i + 1], topvert, verts[i]])

cone_mesh = bpy.data.meshes.new("Cone")
cone = bpy.data.objects.new("Cone", cone_mesh)         
bm.to_mesh(cone_mesh)


# add base as basis shape key
basis_shape_key = cone.shape_key_add("Basis")

# add second shape key

cone_shape_key = cone.shape_key_add("Cone")
offset = (radians(360) - theta) / 2
dtheta = radians(360) / sectors
for v in verts:
    a = v.index * dtheta - offset
    cone_shape_key.data[v.index].co = ((r * cos(a), r * sin(a), 0))
cone_shape_key.data[topvert.index].co = (0, 0, h)

# link to scene

scene = context.scene
scene.objects.link(cone)
scene.objects.active = cone
cone.select = True
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.