Hi Matthew,
A unit seems to consist of multiple geometries - a rectangle, red lines and something like asterisk. If they have common identifier of belonging unit (e.g. UNIT_ID):
Transform them into collection type features using the Aggregator (Group By: UNIT_ID).
Extract bounds (xmin, xmax, ymin, ymax) of each collection feature with the BoundsExtractor.
Use the Rotator to rotate odd (or even) row features around their center coordinate (x = (xmin+xmax)*0.5, y = (ymin+ymax)*0.5).
If necessary, decompose the collection features to restore original geometry types (Deaggregator).
If they don't have common ID, consider create rectangle ID and give it to other associated features using the SpatialFilter.
Hope this helpd.
Takashi
Hi,
U can extract the coordinate from the location u wish to use as rotationcenter.
The use a 2d affiner to rotate round this point.
Here is the math for the 2d affiner:
Affiner_2 nAffiner] x' = A: @Evaluate(cos((@Value(Hoek)/180.0)*$(Pi)))x
B: @Evaluate(-sin((@Value(Hoek)/180.0)*$(Pi)))y
C: @Evaluate(@Value(_x)*(1 - cos ((@Value(Hoek)/180.0)*$(Pi))) + @Value(_y)*sin((@Value(Hoek)/180.0)*$(Pi)))
y' =
E: @Evaluate(sin((@Value(Hoek)/180.0)*$(Pi)))x
F: @Evaluate(cos((@Value(Hoek)/180.0)*$(Pi)))y +
G: @Evaluate(@Value(_y)*(1 - cos ((@Value(Hoek)/180.0)*$(Pi))) - @Value(_x)*sin((@Value(Hoek)/180.0)*$(Pi)))
Hoek = Angle (dutch) of rotation. In your case 180. I would do this using a creator.
(_x,_y) center of rotation.
U need to group the objects and ID the groups.
Extract the coordinates of the point of rotation.
Then merge the rotation point to the all the objects in a group.D
U can do that using a unconditional merger. ( i create a attribute on all objects like LinkAll+1 and later use it to merge all)
When u do this, each object should now have the same rotationcentre.
Now u can aply the 2d affiner on them.
Rotate these by 180
adn rotated.
workspace used:
Gio
i forgot to mention.
I have entered Pi in a global parameter. (navigator pane, user parameter create)
have funs!
works on any graphics or geometric object (collection):
;)
Enjoyable graphics, Gio :)
Alternatively, the 3DRotator with this settings can perform "flip" after calculating origin Y of the rotation axis.
y0 = (ymin + ymax)*0.5
Yes, good posture and place for tought...
That is a flipping or a mirror operation trough a mirror-axis. And one is required to aggregate objects.
Without need for aggrtegation:
2d affiner:
this is line trough y=0
Line trough bottom of objectgroup u need to use 2d affiner to move,
or multiply move matrix with mirror matrix.
My example was a rotator around arbitrary axis.
This is affinre same as your 3d rotator, without need for aggregating.
After boundsextractor.
Using _ymin will give reflect on bottomline etc.
If u use boundingboxaccumulator then boundsextractor and remerge extracted bounds unconditionaly to input objects u can perform it on all objects in groups.
Hey folks... a HUGE thanks to both Takashi and Gio. Gio you've got some amazing math that goes into this and I was "close" to your approach yesterday but ended up missing out on one or two components. I have to give the best answer to Takashi for ease of use/simplicity. Granted to get the bounds of each box individually I had to create a custom transformer and parallel process by the uniqueID (which consequently was embedded into each each line/point/polygon.)
Thanks again for the nudge in the right direction.
Oh and Gio, your graphics example totally made my day. I pretty much spit my coffee out when I saw it!