Official Release - mcjMechAnim - D|S1,2,3,4 Script to Animate Arms and Piston mechanisms
Manual and download here :
https://sites.google.com/site/mcasualsdazscripts5/mcjmechanim
-=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=-
History
-=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=-
Dec 6 - Rush release, the ds1/ds2 version was not dunctional
Dec 7 improved robustness and implemented DS1/DS2 compatibility, completed the manual
example: you animate the master wheel,
select some of the mechanical components
ex:
the push-rod is parented to the master wheel
you select
the piston end node : a null node parented to the extremity of the piston
the push-rod end node : a null node parented to the extremity of the push-rod
before using the script, the push-rod
swings wildly around the master wheel
after using the script
for each frame of the animation,
the script rotated the push-rod precisely as needed
so that the end of the push-rod meets the line of action of the piston
and it moved the piston
precisely as needed so that the end of the push-rod
meets the origin of the piston
Comments
the source code for now
the final version will adapt to other configurations
mcjKeepOrientation
was used to keep the rod connecting the 3 wheels horizontal
that connecting rod is parented to the master wheel
mcjKeepOrientation was also used to keep the piston horizontal
the piston is parented to the push-rod
the push-rod is parented to the master wheel
before running this script i selected
1 - the push-Rod
2 - the piston
3 - the cylinder
the slave wheels copy the master wheel rotation
i locked their translations then copy-pasted the master wheel X rotation
Amy inspecting a Sterling engine ( hot/cold air based )
hi casual
I have win 7 IE11
and I cant see the animations of your gifs in browser
but when I download with irfanview I can
should they work in browser ?
in win7 google-chrome, the animations are running when i open this page
and if i click the animated gifs, they pop-up in a separate window and are animated there too
i have ... lets see ... IE11 too and ....
the 2 animated gifs at the top of the page work
so .. mmmmmmmaybe there's a setting in IE to block animated gifs?
the displacer mechanism of a Sterling engine
note that this design is absolutely not guaranteed to work in real life
but it's the general configuration for a Sterling engine
the displacer pushrod will be parented to the flyWheel
the displacer will be parented to the displacer pushrod
the script will keep the displacer sliding up and down along the Y Axis of the displacerGuide
this is achieved by rotating the displacer pushrod and the displacer around their respective X Axis
===================
Figure 2 , your sole task is to animate the wheel rotation
---------------------------------
Figure 3, there ya go i was able to make it work for Y-Axis piston action
i just have to make it work for any configuration, including , in movement !, for example, a train climbing hills, and following curvy paths
4 important states of a Sterling engine
demonstration video oh yay
https://www.youtube.com/watch?v=FhgCemjxEjA
i'm not sure the script will be able to solve a complex mechanism like that but , that's the experimental setup
the script will probably be called mcjArticulate
and is probably best described as a planar mechanism solver
=========
figure 2 - it can also be seen as a case of two coupled wheels
fig 3 it boils down to a triangle
fig4 2 solutions satisfy the constraints so we must chose the nearest from the previous frame pose
looks like it will be a lot of fun
can we get some of the props with it ?
there comes a related idea to mind
can you tell how quick a person moves (translation ) from the movement of the feet ?
to prevent it from sliding
you have so many scripts
perhaps its already existing
yes i'll probably post the machines as free props
note that the last test setup is made mostly using the very morphable props
https://sites.google.com/site/mcasualsdazscripts3/mcjlinks
https://sites.google.com/site/mcasualsdazscripts3/mcjroundrods
there's also
https://sites.google.com/site/mcasualsdazscripts3/mcjovalrods
https://sites.google.com/site/mcasualsdazscripts3/mcjovals
about walks
you can look into
https://sites.google.com/site/mcasualsdazscripts3/mcjtoebasedfootpose
https://sites.google.com/site/mcasualsdazscripts3/mcjtoewalker
my main animation tool for walks and dances is
https://sites.google.com/site/mcasualsdazscripts3/mcjautolimb2014
along with
https://sites.google.com/site/mcasualsdazscripts/mcjmaketarget
https://sites.google.com/site/mcasualsdazscripts/mcjkeeporient
there will possibly be 2 scripts
this one where the hinge position is the ending constraint
and one for piston+cylinder where the constraint is the piston's travel axis
it works i just have to make sure it works for any axis configuration
for example, the FreeRod ( which is in fact attached to the wheel ) uses YRotation to solve the arm position
the FollowRod ( which is anchored to the floor hinge ) also uses the YRotation
but using other props will yield other axis
actually i didn't expect the script to pass this acid-test
the whole mechanisms swings and the script doesn't get confused
In the second test i animated a node along a circular trajectory
the FreeRod is the Shoulder, the FollowRod is the foreArm and the Hinge is the null node
the flat segment of the resulting trajectory is due to the fact that the target node was out of reach
in fact i had to delete those keyframes because the script was spitting out a few nan ( not a number )
i'll fix that and the script will be able to handle the impossible :)
so there will be a function to solve an arm type of linkage : shoulder / foreArm / hand
and there will be one for a piston type of linkage : pushRod / piston / cylinder
fig 2. eventually this will be on my site as morphing props
this should be useful, next , adjustable lengths
pretty good song right there https://www.youtube.com/watch?v=1ny4XvhoMMc
figure 2 - the L-Shaped morphable props ... coming soon ( which is way before never )
now that i made a mountain of mechanical props, work can resume on the machine animator!
solving is done using trigonometry, not simulations
getting closer to the ready-to-animate build
the problem with the 1816 Stirling engine is that everyone ( and that's not a lot of people ) only show it in plan view
Fig 2 - yes one of the arms in fig 1 would break, but in fig 2 it wont
Fig 5 - so this was done in 4 script runs - the tedious part is positioning and parenting the "end" nodes
( using mcjMakeTarget and mcjParent ) )
the piston-action was "simulated" using mcjKeepOrient
almost there !
the movie !
https://www.youtube.com/watch?v=QEwpUlsqDGI
so, the script may end up being named mcjMechAnim or mcjArticulate and/or mcjPiston
or fancier would be
mcjMechAnim.arms
and
mcjMechAnim.pistons
will there be a Poser version?
probably not in the near future , but when i'll try my hand at poser scripting, i may start with this one
i did some python programming for the DazStudio-to-Blender scripts and Poser uses Python too
probably not in the near future , but when i'll try my hand at poser scripting, i may start with this one
i did some python programming for the DazStudio-to-Blender scripts and Poser uses Python too
a Poser version would be awesome, so i will beg and drool
mcjMechAnim ( name was chosen )
will have at least 4 tabs
1 - a solver for 2 planar-rotation rods and a joint
2 - a solver for a push-rod and a piston
3 - a solver where you chose the endpoints of 2 rods
the script will keep rodA pointing at rodB's origin
4 - a utility that creates a null-node at the center of a circle
this circle is computed based on 3 points
the 3 points are the positions of a node of your choice at the
beginning, midpoint and endpoint of the animation playrange
Fig. 1 shows an example of tab 4, i needed to find the center of rotation for a rod
and tab 3 will be used to keep that rod oriented correctly
the length of the rod is fixed and adjusted "manually" by me
---
i'll probably "force" you to supply a primitive plane which tells the script
the rotation plane for your machine, because that's what is is, a solver for planar mechanisms
if your machine is aboard a train, that plane must be aboard too !
the "joint solver"
basically finds the intersection of 2 circles
after having projected the machine onto the machine's "plane" of action
since there's 0, 1 or 2 solutions to this, i want to make sure the script chooses wisely
-----
in figure 3 a challenging test for the ''joint solver''
since the large torus turns 5 times slower than the small torus, i was expecting 5 loops or something
instead we got 4 blades
note that the trace is courtesy of mcjTracer
https://sites.google.com/site/mcasualsdazscripts/mcgtracepath-for-mcjtracer
https://sites.google.com/site/mcasualsdazscripts2/mcjtracerv2
the constant rotation speed is obtained using
https://sites.google.com/site/mcasualsdazscripts/setinterpolation-for-ds2-3
which is a pretty indispensable tool for animators by the way
i'm adding the reach solver
which is a bit like mcjAutoLimb
you select a 'hand' node ( in this case a null node parented to the green "foreArm" cylinder )
and you select a target node, in this case a null node parented to a rotating torus
and the script will solve the elbow bend angle of the foreArm for each frame of the animation
Fig 3 - the "reach" solver seems to be ready
next is to re-implement the piston solver and make sure it can handle equivocal configurations
configuration for the "piston solver" tests
note that the origin of the piston is often in the middle of the piston cup
Figure 2, the "Help" panel
Figure 3 - The Piston Solver's good work
there's little delays because
the same exact machine animation test works perfectly in DS4.7 and spuriously fails in DS 3.0
the issue seems to be, that some Quaternions are rejected by the setWSRot() function
well ... i should get through that bug but i was almost ready to post the script !
if i get stuck i'll post it as it is, before noon
and work on the DS 1, 2, 3 versions tomorrow
case in point, in DS3
this doesn't work
this ( equivalent) works
after long and painful (nah s'not that bad) trials in DS3
apparently, doing
Q.w -= 0.00001;
before calling setWSRot( t, Q )
gets rid of errors
though i suspect i need to use abs()
** Rush Release **** Rush Release **** Rush Release **** Rush Release **
https://sites.google.com/site/mcasualsdazscripts5/mcjmechanim
or you could call it a Beta'ish release
------------
Demonstration Videos :
https://www.youtube.com/watch?v=QEwpUlsqDGI
and
https://www.youtube.com/watch?v=FhgCemjxEjA