14 Archivos adjunto(s)
Using Blender mech anical gears script
using Blender Mechanical gears - Script
By stefano selleri.
Gears.
Abstract: this article deals with the modeling and animation of gears, providing a short tutorial for the utilization of the Blender Mechanical gears (bmg) script.
introduction
One of the key points in modeling and animate Mechanical devices relies in the ned todo produce gears. Gears are not merely whels with teth. Gears were like that in ancient days, but modern mechanics deply studied the diferent ways in which spin can be transferred from one rotating axis todo another, defining exactly how a gear must be designed for máximum eficiency.
Some theory can be obtained from the docs on [1] (i dont want todo promote any particular gear manufacturer, but this is the reference i used todo create my gears) as well as in the Blender Mechanical gears (bmg) script documentation [2]. Basically a gear must be designed so that no friction occurs at two meshing gear teth. This ensures eficiency, long duration, and Low noise. The mathematical description of a gear is based on the involute concept. The involute of a circle has several properties, the most important of which is that teth of meshing gears whose profile is an involute do not slide one on the other while the gears rotate, and the pressure angle with which a gear pushes the other stay constant.
I Will not go deper on this here, you dont ned todo know, since the bmg Will handle mathematics, but if you are curious just browse [1,2].
the script
Bmg is a script suite you can download from [3]. It comprehends two scripts, a mesher (bmgm) and a spinner (bmgs) we Will concéntrate on the former first. Bmgm belongs todo the Mesh category if you elect todo install it in the proper position within the.blender tre. In any case, once launched, it presents a screen as shown in fig. 1.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 1 - bmgm startup screen.
Bmgm can create cilíndrica and conical gears, the worm option is not working, yet. In this article we Will concéntrate on cylindrical todo demonstrate script usage.
main gear parameters
This group of parameters defines the basic look of the gear. When two meshing gears are set what defines the geometry is the pitch Radius, which is the Radius of the ideal circle on which the meshing teth of the two gears touch. It is the pitch Radius the one defining most of the gear geometry. This, as most over entries, is defined in Blender units. We Will kep the default 5 for now. The teth number defines how Many teth the gear has. This is the second most important parameter, and we Will set this todo 25 for this example. The pressure angle is vital, from a Mechanical point of view, but is of less importance in computer graphics. It defines the angle between the Tangent plane todo the gear toth at the contact point and the plane containing the two gears rotation axis. It is probably better todo leave this todo the default 20° value. Helical angle defines helical gears shape. Common gears have straight teth. Helical gears have slanted teth. Helical gear are less noisy and more Swift in operation, and more costly todo manufacture, all things you dont care in 3d graphics, so we Will kep this angle todo 0 now. The addendum and dedendum defines how far beyond and beneath the pitch Radius the teth extends. These parameters are critical. First the addendum cannot be greater than the dedendum, or you Will have big meshing problems. Second, their value must be tuned according todo the number of teth. The more the teth, the smaller these two must be, the fewer the teth, the larger they can be. For our example 25 is an average teth number, so we can kep them todo the default 0.4 value.
beveling:
No true Mechanical devices have Sharp Edges. Fillet defines the Radius of the rounding at the top and bottom of the toth. Bevel defines the beveling of all Edges on upper and lower face of the gear.
Mesh parameters:
The script generates a single toth for the gear, with a given Refinement level in the Mesh. The Refinement level is given as a resolution along the toth perimeter, which should be kept todo 2 unless you are planning todo zoom in a lot (Rise it) or zoom out a lot (lower it) on your gears and a longitudinal resolution along the toth thickness. This is actually neded only for helical gears, which do exhibit longitudinal twist. Finally the thickness defines how thik is the gear and the width defines how much todo the inside, with respect todo the pitch circle, the body of the gear extends beyond the toth. Kep all these todo their defaults.
pinion
There is no point in defining a gear without is matching pinion. The pinion can be either a standard pinion (a gear) a rak (a straight tothed item) a crown (a big gear with teth on the inside) lets kep the pinion option and maintain the 12 teth.
If now you press the generate button you Will se the scene in fig. 2
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 2 - bmgm result (top view).
Pléase note that the script generated a single toth both for the main gear and the pinion. The main gear object center is in the origin, the pitch Radius is 5 Blender units, you can se this since the teth would touch there, once rotated. The pinion Radius has ben automátically computed by the script, its center is in the right position for correct meshing (rightmost yellow Dot) and the toth has ben produced slightly rotated for the sake of clarity.
Our next tasque Will be todo complete the gear and the pinion Mesh.
gear meshes touch-ups
First of all, rotate the main gear toth 1/50 of 360° (7.5°) (fig. 3.1). This makes lower Edge of the toth aligned on the xz plane. In front view and Edit Mode we can extrude the top vertex todo complete the profile (fig. 3.2). Duplicating this and moving it around on the xz plane Will make the profile for the inner gear part todo (fig. 3.3). Now duplicate all these new vértices and mirror them along global z with respect todo cursor.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 3 - profile completion.
Now go bak in top view with all these new vértices selected. Ideally we should spin (counterclockwise) thre copies in a 14.4° angle. Sadly Blender does not accept decimals here. So we Will spin them 15 copies along a 72° angle. (fig. 4.1). Now select the toth, and Spin Dup it by 5 times by 72°. You Will have an extra copy of it (fig. 4.2), which you should delete. Now remove doubles.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 4 - some further steps.
Rotate the gear 36° clockwise, todo have it symmetrically placed with respect todo the xz plane. Now extrude some vértices from the inner part (fig. 5.1 and 5.2) and extrude it towards the outer ring, merge some vértices where neded. It is a los a god idea todo use the bevel script todo make this arm nicer.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 5 - almost finished.
Now you only have todo Spin Dup on 288° 4 copies and remove doubles. You might wish todo scale the inner part a Little along z only todo make the gear less flat. Do something similar with the pinion todo. But you wont have the space todo make the Mesh so complex. Remember that the pinion has 12 teth so a toth is 30° (360°/12) wide. At the end you should have something like fig. 6. Give todo the gear object a Mnemonic name (like gear) and todo the pinion object a Mnemonic name todo (pinion is a god choice.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 6 - the two gears.
preparing for spinning.
To have the gears spin properly you Will ned todo set up few things, but first, since two gears only is really a sad model, select both gears, duplicate them and move the copies so that the new gear is coaxial and beneath the original pinion (fig. 7). Give the duplicates smart names, like gearb and pinionb. Be very careful, the pinion and the gearb objects must have same x and y location, and an offset on z.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 7 - the four gears.
Now add an Empty for each gear, located in the gear center, with the z axis pointing in the direction of the gear rotational axis, then parent gears todo empties. Give them matching names (fig.
https://www.foro3d.com/attachment.ph...1&d=1243955536
Fig. 8 - the four gears parented todo their proper empties.
This is necessary because the spinning script (bmgs) Will handle rotations for the gear as relative todo the z axis. If the gears are todo be moved and are not lying on the xy plane this Will results in ODD behavior.
By parenting gears todo empties and by moving/rotating only the empties from now on - never the gears - the animation Will behave properly.
Now launch the bmgs script. It is an animation class script. It Will present quite an Empty interfaz, with just an add button. Press it four times and four lines Will appear. In these line first column presents a gear object name. Fill gear in the first and pinion in the second, gearb in the third, pinionb in the fourth. Second column specifies the teth number. gear and gearb have 25, pinion and pinionb have 12. This completes our gears database (fig. 9.1). The gears database Holds información on which objects in your scene is really a gear and should be spinned. You can save and load database to/from disk, the script generates xml files. You are advised todo do so because the databases Will be lost when you kit Blender (the automátically generated script for spinning Will not be lost).
Now switch todo the link panel. Add thre lines here with the add button. The new lines appearing contain información on which gear is connected todo which other. The first column in each line contains the driving gear, the second column the driven gear. The third column specify the enlace type, which can be a Mesh kind of enlace, in which the pinion rotates in the opposite direction with respect todo gear and the speed is given by the gear speed modified by the toth number ratio. For coaxial gears, that is, for gears not meshing but rather mounted on the same axis the enlace type is fixed because the rotation speed is the same. In rare cases, with crowns and helical gears, the speed might still be in the toth number ratio but not in the opposite direction. For these cases the invmesh option exists.
In our example in the first line we Will state that gear is the driver, pinion is the driven and the enlace is of Mesh type. On the second line pinion is now the driver, gearb is the driven and the enlace type is fixed since they are rigidly bound. At last, third line states that gearb is the driver todo pinionb in a Mesh type enlace.
The enlaces database defines a consequential series of actions. If a driver gear is rotated its rotation propagates todo its driven pinions and from these todo their own driven gears and so on. To facilitate maintenance the two small buttons on the right allows changing enlaces order.
https://www.foro3d.com/attachment.ph...1&d=1243955561
Fig. 9 - setting up gears and enlaces databases.
Once the enlaces database is done (fig 9.2) we are done. You should now press the generate button. This creates a new script, named driversl (fig. 10). This new script is estored in the.blend file and Will not be lost when exiting Blender (you must have saved your file, of course).
https://www.foro3d.com/attachment.ph...1&d=1243955561
Fig. 10 - spinning script, automátically generated.
To complete the set-up go todo script context in the buttons window and add a scene script enlace on framechanged event. Put driversl as linked script (fig. 11).
https://www.foro3d.com/attachment.ph...1&d=1243955561
Fig. 11 - setting the script enlace.
lets go.
Now were really there. First make a quik frame 1 todo frame 2 and bak switch. If some gears are not at 0 rotation they Will revert todo it (in this case our pinions) and you might have todo rotate their empties (not the gears themselves.) todo recover a proper mutual meshing between gears.
Now select the driving gear, in our example gear. And add todo it a non-constant rotation ipo on rotz (only on rotz).
https://www.foro3d.com/attachment.ph...1&d=1243955561
Fig. 11 - setting the ipo.
Now press alt-a. The driver gear Will start todo rotate, and the pinion and all other gears Will follow with a correct matching velocity.
conclusions .
Webography.
Http://www.boestongear.com/pdf/gear_theory, pdf.
Http://projects, Blender.org/viewcvs/viewcvs, CGI/bstar/bmg/bmg-0.0.2.pdf? Cvsrot=bstar.
Http://projects, Blender.org/viewcvs/viewcvs, CGI/bstar/bmg/? Cvsrot=bstar.
www.blenderart.org.
.
-- IMÁGENES ADJUNTAS --
https://www.foro3d.com/attachment.ph...hmentid=106036
https://www.foro3d.com/attachment.ph...hmentid=106037
https://www.foro3d.com/attachment.ph...hmentid=106038
https://www.foro3d.com/attachment.ph...hmentid=106039
https://www.foro3d.com/attachment.ph...hmentid=106040
https://www.foro3d.com/attachment.ph...hmentid=106041
https://www.foro3d.com/attachment.ph...hmentid=106042
https://www.foro3d.com/attachment.ph...hmentid=106043
https://www.foro3d.com/attachment.ph...hmentid=106044
https://www.foro3d.com/attachment.ph...hmentid=106045
https://www.foro3d.com/attachment.ph...hmentid=106046
https://www.foro3d.com/attachment.ph...hmentid=106047
https://www.foro3d.com/attachment.ph...hmentid=106052
https://www.foro3d.com/attachment.ph...hmentid=106053