Polygon offset/scaling?

Back once again with a toplogy issue.

I’d like to scale a polygon inwards towards its centre. Initially I tried the normal:

	local v1 = Vector3.new(point.x, 0, point.y)
	local v2 = v1 - centroid
	        v2 = v2 * scale + centroid

where ‘centroid’ is the centre of the polygon, and ‘scale’ is the scaling factor. Unfortunately, this does not produce optimal results.

I am now achieving this through offsetting the polygon and doing boolean polygon operations but obviously this isn’t ideal for a game, esp. as I would like to use it in runtime for user-created polygons.

Any ideas on how to achieve this in a less computationally expensive manner?

If anyone else struggles with this in the future, it turns out this is unfortunately a fairly complex problem. I didn’t need incredible accuracy, so I settled for getting the straight skeleton of the polygon and computing it from that. However, as mentioned in the OP, you can utilise more computationally expensive methods such as this

1 Like