
bulia byak schrieb:
But a still better and more useful approach is to dedect a clockwise order, as I wrote before. This may not be always easy, but it's an interesting mathematical challenge. For example: calculate a center point of objects and rotate clockwise a ray from this center, and process objects in the order in which this ray crosses their bbox centers.
Using the center point of all selected objects is a good starting point. With this it seems to be pretty easy to compute a clockwise sorting order. (Much easier than I thought first) I've just coded following sorting algorithm and am about to create a new patch: - First compute the angle of a vector from overall center point to the center points of the selected objects and sort this (lowest first gives a clockwise order) - If object vectors have the same angle, sort according to the length of the vector (longest first) - If the vector length is also identical, sort according to the z-order.
Roland