I’m tired and I have a headache, but if I understand your
problem right then it sounds like a special case of a problem I just solved
last night and wrote a tool for:

http://www.humus.name/index.php?page=News&ID=266

So you’d just input your polygon directly (instead of inputting
a particle texture and generate a polygon from that) and optimize for 4
vertices and that would solve it, no?

-Emil

**From:**
Stefan.Daenzer@gmail.com [mailto:Stefan.Daenzer@gmail.com]

**Sent:** 22 May 2009 14:59

**To:** Game Development Algorithms

**Subject:** [Algorithms] Best fit of polygon inside another polygon

Hi,

I've been thinking about an algorithm which fits a given polygon into a quad.
I've stumbled upon this while trying to fit the largest possible polygon out of
a set of different polygons into a quadliteral. What I want to find is the
best-fit-polygon which can be contained completely in the quadliteral. The
polygon and quad can be assumed to be convex. An nice feature would be to
calculate the error as a function of the area which doesn't fit into the quad
for every polygon I throw at the quad.

I'm working in 2D right now, but might want to expand the problem for a later
application into a 3D case (fit a polyhedra into a hexahedron).

Any ideas how to solve this problem?

Stefan