Mekanimo does not use any specific set of units and units cannot be set. The user has to choose an appropriate set of units. It is the user’s responsibility to pick a unit system and use it consistently. A common method of picking a unit set in engineering is picking force, length, and time (FLT) units and deriving all others from these. For example:
If you pick Force: N (newtons) Length: m (meters) Time: s (seconds)
Then velocity is L/T => m/s, density is F/L^3 => kg/m^3
Mekanimo uses global and local coordinates for defining positions, dimensions, and characteristics of the objects in the model.
Origin of the global coordinate system is located at the lower left corner of the system box by default (see Figure 1). When the cursor is moving around, global position of the cursor is reported in the status bar (see Figure 2).
The coordinate system indicator can be toggled on/of from the menus, toolbars (see Figure 3 and 4), or from the interpreter as shown below.
>>> system.showCS = False
Local coordinates are used for defining positions relative to a rigid body’s center of gravity. Local coordinates are primarily used for defining connector (spring, pin, link, etc.) positions.
Canvas
In Mekanimo all angles are defined in radians. To convert between radians and angles, you can use
In addition, Mekanimo provides two functions for converting radians to degrees and degrees to radians.
>>> radians(45)
0.78539816339744828
>>> degrees(pi/3)
59.999999999999993
system, canvas, and frame are the three main objects Mekanimo’s API is based on.
Mekanimo assigns default names and aliases to all created elements. For example if the user creates two rectangles and then a polygon, Mekanimo assigns rectangle1 (r1), rectangle2 (r2) and rectangle3 (r3) as names and aliases (shown in parantheses). Aliases are intended to be used mostly from the Python interpreter. Both names and aliases can be overwritten by users either from the Object Tree or code (either from the code panel or the Python interpreter). An example of renaming an element and then changing its alias is shown below.
>>> circle1.name = 'rear_wheel'
>>> rear_wheel.alias = 'rw'
All default names and aliases Mekanimo uses is listed in Table 1
Table 1: Default names
Element Type | Name | Alias |
Assembly | assembly1, assembly2, ... | a1, a2, ... |
Beam | beam1, beam2, ... | b1, b2, ... |
Belt | belt1, belt2, ... | bt1, bt2, ... |
Chain | chain1, chain2, ... | ch1, ch2, .... |
Circle | circle1, circle2, ... | c1, c2, ... |
Force | force1, force2, ... | f1, f2, ... |
Gap | gap1, gap2, ... | g1, g2, ... |
Hinge | hinge1, hinge2, ... | h1, h2, ... |
Horizontal Rail | hRail1, hRail2, ... | hr1, hr2, ... |
Horizontal Slider | hSlider1, hSlider2, ... | hs1, hs2, ... |
Link | link1, link2, ... | l1, l2, ... |
Motor | motor1, motor2, ... | m1, m2, ... |
Polygon | polygon1, polygon2, ... | p1, p2, ... |
Spring | spring1, spring2,... | s1, s2, ... |
Rectangle | rectangle1, rectangle2, ... | r1, r2, ... |
Torque | torque1, torque2, ... | tq1, tq2, ... |
Torsional Spring | torSpring1, torSpring2, ... | ts1, ts2, ... |
Trace | trace1, trace2, ... | t1, t2, ... |
Vertical Rail | vRail1, vRail2, ... | vr1, vr2, ... |
Vertical Slider | vSlider1, vSlider2, ... | vs1, vs2, ... |
Weld | weld1, weld2, ... | w1, w2, ... |
When Mekanimo starts it automatically executes the mekanimo_startup.py file located at the installation directory. When you need to customize the environment or perform some tasks everytime Mekanimo starts, you can modify the mekanimo_startup.py file. To find out where the installation directory resides in your PC you can type system.appDir at the Python interpreter as shown below.
>>> system.appDir
'C:\\Program Files\\Mekanimo\\'