Thinking a bit deeper it appeared to me that alignment of images would be ideal.
In drawing programs I use, we have the ability to align on the horizontal and vertical as well as distribute shapes within a bounding box (distributing makes the shapes equal spacing on horizontal or vertical axis).
`align(x_type$, y_type$, shapes())`
x_type = "empty, left, middle, right" (where empty = "")
y_type = "empty, top, middle, bottom" (where empty = "")
align is self explanatory - but distribute needs some further discussion.
If you passed: `align("left", "top", shapes())` it would align every shape in `shapes()` to the left and top at the same time. overlapping them all on top of each other.
If you passed: `align("left", "", shapes())` it would left align shape in `shapes()` to the left and if the shapes were already on different y positions, they may overlap, partially, but if they were at least height apart, they would not. but they would be flush left aligned.
If you passed: `align("", "top", shapes())` it would top align shape in `shapes()` to the top and if the shapes were already on different x positions, they may overlap, partially, but if they were at least width apart, they would not. but they would be flush top aligned.
`distribute(x_type$, y_type$, shapes())`
x_type = "empty, left, middle, right" (where empty = "")
y_type = "empty, top, middle, bottom" (where empty = "")
Suppose you have 4 rectangles and they are identical sizes and positioned exactly (x and y all the same) on top of each other...
If you pass: `distribute("left", "", shapes())` nothing is going to happen - because they are already aligned like that.
If you pass: `distribute("", "top", shapes())` nothing is going to happen - because they are already aligned like that.
However, suppose you have 4 rectangles and they are different sizes scattered across the x axis randomly with no equi-distant spacing between them....
If you pass: `distribute("left", "", shapes())` each shape, except the left most, will be spaced equidistant to the extents of all the shapes combined width...
all the shapes combined width = combined width = combined width + shape().x + shape().width
However, suppose you have 4 rectangles and they are different sizes scattered across the y axis randomly with no equi-distant spacing between them....
If you pass: `distribute("", "top", shapes())` each shape, except the top most, will be spaced equidistant to the extents of all the shapes combined height...
all the shapes combined height = combined height = combined height + shape().y + shape().height
So this could be very useful for our shape layer but also useful for ANY kind of rectangle alignment or distribution. So we won't closely couple this either.
But we will want it.
So now we have
align, distribute, shape area, compound shape (add/subtract), that is a good start.
In drawing programs I use, we have the ability to align on the horizontal and vertical as well as distribute shapes within a bounding box (distributing makes the shapes equal spacing on horizontal or vertical axis).
`align(x_type$, y_type$, shapes())`
x_type = "empty, left, middle, right" (where empty = "")
y_type = "empty, top, middle, bottom" (where empty = "")
align is self explanatory - but distribute needs some further discussion.
If you passed: `align("left", "top", shapes())` it would align every shape in `shapes()` to the left and top at the same time. overlapping them all on top of each other.
If you passed: `align("left", "", shapes())` it would left align shape in `shapes()` to the left and if the shapes were already on different y positions, they may overlap, partially, but if they were at least height apart, they would not. but they would be flush left aligned.
If you passed: `align("", "top", shapes())` it would top align shape in `shapes()` to the top and if the shapes were already on different x positions, they may overlap, partially, but if they were at least width apart, they would not. but they would be flush top aligned.
`distribute(x_type$, y_type$, shapes())`
x_type = "empty, left, middle, right" (where empty = "")
y_type = "empty, top, middle, bottom" (where empty = "")
Suppose you have 4 rectangles and they are identical sizes and positioned exactly (x and y all the same) on top of each other...
If you pass: `distribute("left", "", shapes())` nothing is going to happen - because they are already aligned like that.
If you pass: `distribute("", "top", shapes())` nothing is going to happen - because they are already aligned like that.
However, suppose you have 4 rectangles and they are different sizes scattered across the x axis randomly with no equi-distant spacing between them....
If you pass: `distribute("left", "", shapes())` each shape, except the left most, will be spaced equidistant to the extents of all the shapes combined width...
all the shapes combined width = combined width = combined width + shape().x + shape().width
However, suppose you have 4 rectangles and they are different sizes scattered across the y axis randomly with no equi-distant spacing between them....
If you pass: `distribute("", "top", shapes())` each shape, except the top most, will be spaced equidistant to the extents of all the shapes combined height...
all the shapes combined height = combined height = combined height + shape().y + shape().height
So this could be very useful for our shape layer but also useful for ANY kind of rectangle alignment or distribution. So we won't closely couple this either.
But we will want it.
So now we have
align, distribute, shape area, compound shape (add/subtract), that is a good start.