RG ( Trimm 420 App )
Trimm is the German word for trim.
You need to learn just a tiny little bit of German in order to use the program.
( The variable names in the data file are derived from German language terms. )
The hull tetrahedron and the spreader tetrahedron are connected by three wires (forestay and shrouds) and one rod - the lower part of the mast. It is assumed that both tetrahedrons are rigid bodies, and that symmetry in regard to the mid ship plane is maintained.
The kinematic model of the structure is a six-bar linkage. You should imagine the mechanism under tension - internal tension only - with no external forces applied. With the elastic properties known, you could cut through the forestay and draw the relaxed position of the structure, with no tension in the shrouds and the mast a straight line. This part of the computation is not in the program, but you should know that the mechanism as drawn is thought of as under tension - the tension you can measure at the real boat.
The input parameters of the model you can change are: length of forestay, length of shroud, the spreader triangle, and the position of the foot of the mast.
On the output side of the computation you have: declination of the mast (Mastfall) and bending/displacement of the mast (Biegung).
All input parameters are independent of each other. When you change the length of the forestay, the length of the shrouds and the shape of the spreader triangle will remain unchanged.
However, when you select Mastfall (F0C) or Biegung (Bie) as the current parameter, length of forestay and shrouds are changed to fit.
The graph can be implemented in different ways, depending on how easy it is made by the development tool used to compile for the target platform.
Perspective or orthographic projection, it is not clear which is better. You can expect that graphics will change, perhaps even improve. But the computation behind the scene will mostly stay the same.
Here is a short list of the operations with the mouse:
=== scroll wheel = current parameter +/- 10 === shift scroll wheel = current parameter +/- 1 === control scroll wheel = zoom === control left button drag = panning === left button drag (in x or y direction) = rotation X / Y === right button drag (in x direction) = rotation Z ===
(You should start dragging the mouse over the background of the graph.)
With the touch screen everything is similar. Rotation Z is done using the upper touch bar. Zoom is accomplished with help of the lower touch bar. Touch bars left and right do the same job as the mouse wheel.
How do you want your touch bars - medium purple !
The desktop version of the program should support keyboard shortcuts as follows:
=== //Input-Parameter slection v = Button VO (Vorstag / Forestay) w = Button WA (Wante / Shroud) o = Button WO (Wante oben / Shroud, upper part) h = Button SH (Saling Höhe, Spreader Height) a = Button SA (Saling Abstand, Spreader Distance) === // Param value changing i = + 1 I = + 10 j = - 1 J = - 10 === //Memory slots 0 = T0 (Trim 0) Base-Trim 1 = T1 (Trim 1) 2 = T2 (Trim 2) 3 = T3 (Trim 3) 4 = T4 (Trim 4) 5 = T5 (Trim 5) 6 = T6 (Trim 6) 7 = 420 (Trim 7) 8 = Logo (Trim 8) M = M (Update Trim) Copy and Paste Z = MT0 (Update Trim 0) === //Fix points d = Point D D = Point D0 e = Point E E = Point E0 f = Point F F = Point F0 === //Display u = data (display of trim Data on / off) U = diff (display of trim Diff on / off) === //Background color c = c+ (color scheme plus) C = c+ (color scheme minus) === //Hull H = hull (on / off) === //Hull texture # = be (bitmap escape) b = b+ (bitmap plus) B = b- (bitmap minus) n = (random bitmap black) N = (random bitmap white) t = t1 (texture param t1 Offset) T = t2 (texture param t2 Width) === //Navigation * = (page minus) + = (page plus) ! = (page 1) === //Export / Import R = rtf (Read trim file) Ctrl c = ^c (copy trim item) Ctrl v = ^v (paste trim item) ===
Actions for Buttons
Every button on the rim of the window may have an action assigned to it. The mapping of actions to buttons can change with every release.
Each action has a short caption which fits on a button, and a more verbose description, which can be used on a menu item.
I found that - when you know the available actions - the short caption on the buttons are no longer a problem.
The following list contains actions currently mapped to buttons:
=== //Input parameter (model) V0, WA, WO = Forestay, Shroud, Shroud upper SH, SA, SW, SL = spreader triangle (height, distance, angle, length). F0X = mast foot position. === //Output parameter (model) F0C = Mastfall F0C Bie = Displacement of mast at point D === //Other model parameters - try it out MV = MastfallVorlauf WI = Angle / Winkel Co = Controller === //Options mod = toggle between Demo mode and Pro mode. fs = fixed spreaders / Feste Salinge (spreader triangle is rigid) ds = pivoting spreaders / Drehbare Salinge os = without spreaders / ohne Salinge === //Pivot points for rotation of graph A0, A, and so on = important points of the model === //Memory slots for trims T0-T6 = Memory Recall for trims held in main memory 420 = special slot for example 420 Logo = special slot for Logo example === //Export / Import cti = Copy current Trimm-Item pti = Paste current Trimm-Item ctf = Copy Trimm-File rtf = Read Trimm-File stf = Save Trimm-File === //Graph, Background and Text esc = reset rotation of graph (Escape key) pan = move graph on screen (this is a view parameter) data = display of Data on / off diff = display of Diff on / off c+ = cycle through color scheme for background and text plus c- = cycle through color scheme minus jc+ = cycle through all defined background colors (web colors) plus jc- = cycle through background colors (Joker-Color) minus wtx = white text gtx = gray text btx = black text === //Hull hull = display of hull on / of b+ und b- = cycle through texture bitmaps t1 und t2 = texture mapping parameters t1 (offset) and t2 (stretch) br+ und br- = increase / decrease blind ring count (count of hidden rings) ct = contour toggle, hide or show contour pixels in hull texture ===
The format of the data is still under development. Typically, data can be read from a Trimm-File.txt in the document directory. Perhaps a Trimm-File-Auto.txt can be saved. And maybe this Trimm-File-Auto.txt is automatically read at program startup.
Trim 420 could no problem deal with a 470 or Cadet. But at this time there is no data available for these classes, not yet. In particular, I am missing data for the mesh of the hull for these classes and other classes.
There is the intention to make example data available for different classes, similar to what is available now for the 420.
But I will unlikely implement internet access for downloading data unless there is enough tested data available, provided by the user of the app, including hull mesh data for the boat.
Tips and Tricks
Imagine you have a simple triangle and the current parameter is the length of one side of that triangle. Now, when you make this side longer than the sum of the two other sides, the triangle can no longer be drawn. This is about the same in Trim 420, only a little more complex.
In Demo mode the state of the model will be reset at every change of the current parameter. It has the advantage that the valid range for changes is well known, and can be rather big.
In Pro mode you can change the model as you like, and drive it out of range easily.
The actions for Export and Import are implemented differently or not at all, depending on the platform.
In the current version for iPad and Android I have implemented Copy and Paste, but not M, not yet. But Copy and Paste - executed in a sequence - have the same effect: the current memory slot will be overridden with the current state of the model (operation M). In future button M will be surfaced in all targets.
Buttons for page navigation located in top left and top right corners of the button frame do not have fixed captions. Instead these buttons both show the current page number. Page navigation is a cycle through the available button pages.
For interactive manipulation of the color on the hull I was able to reuse features from the Federgraph App, which may be explained there.
Notice one exception to the rule: When parameter Pan is selected, operations on the left and right touch bar are remapped to offset X and offset Y.
What happens when you change the spreader type (fs, ds or os)? You can test that out and see. The spreader type (Salingtyp) is currently not stored. It is a feature added back in, to be used later with the Cadet class.
Maybe the step width for changing the value of the currently selected parameter was optimized down from 10 to 5, e.g on a touch screen device.
If there is a keyboard available, test out keys i, I, j, and J.
Spreader triangle vs. spreader trapeze
The spreader triangle is an abstraction. The spreader triangle is one side of the spreader tetrahedron.
Two independent pieces of information need to be specified for the abstract spreader triangle, standard is SH and SA.
- The spreader triangle is the triangle ABD.
- SA, SH, SW, SL, all are related to the spreader triangle.
- Point D - the abstract pivot center for the spreader - is located inside the mast, on the neutral axis (Biegelinie) of the mast.
- Point P is the midpoint on line AB, you measure variable h1 from P.
At the real boat you have a spreader trapeze, consisting of points A, B, and the two real pivot points outside of the mast.
Spreader length and spreader angle, as measured on the boat, need to be transformed.
variation 1) SA and h1 given SH := h0 + h1; variation 2) l3 and w3 given h3 := l3 * sin(w3 * pi / 180); SH := h2 + h3; SA := 2 * (l2 + l3 * cos(w3 * pi / 180));
Constants h0, l2, h2 as well as variables h1, h3, l3, w3 can be used to compute values for the abstract spreader triangle, based on measurements. Usually this is something the computer program should do, and guess what, in the Trimm-File you can optionally provide measured values, h1 and SA, or even l3 and w3.
Ok, with this clarification you should have no problem to make sense of the Trimm-File(s), when you see them.