# How to inflate geometry?

I have a shape containing vertices and triangles

I want to inflate that geometry using some radius to get something like that

I should move each point along vector center-vertex. I suppose each point should be moved using quadratic function (closer to center, further it will be moved)

How should I calculate the offset of each point?

• It sounds like you have an algorithm already: "move each point along the line joining it to the center, by a distance determined by a quadratic function of its distance from the center" — have you tried implementing that algorithm? Did you get stuck anywhere, or observe behaviour that you don't want? – DMGregory Oct 31 '18 at 11:54
• The simplest way to inflate it is to move each vertex to the same distance from center - you'll get something like a low-poly sphere. If you want something else we need more info. – kolenda Oct 31 '18 at 15:02
• @kolenda moving each vertex the same distance from the center will scale the shape up in size, but won't change the relative shape of the outline. The examples OP gave shows the outline deforming as it inflates. – Pikalek Oct 31 '18 at 15:13
• @Pikalek I meant moving each vertex TO the same distance from center, not BY. It's like normalizing center-vertex distances. – kolenda Oct 31 '18 at 15:27
• @kolenda Ah, I misread that. Yes, something like normalizing them (maybe with a bit of variance mixed in) would be a good thing to try. – Pikalek Oct 31 '18 at 18:01

To inflate the shape:

1. For all edges, find how well aligned it is with the neighbour edge, using the dot product between their normalized directions.
2. Determine the lowest and highest values.
3. For the edge with highest dot value (smallest angle between edges), push out the vertex between them, away from center, with a certain percentage.
4. For the edge with the lowest (negative in your example) dotproduct value, push in the vertex between them, towards the center, with the same percentage.

To visualize it in your example shape:

The left most vertex has most acute angle, and will be pushed in.

The second most left vertex has the shallowest angle, and will be pushed out.

Then rinse and repeat, to slowly converge. Note that this has some basis in real world physics too: the surface tension in a fold is very low, and will be the part of the inflatable to move.