Dupliframes and accuracy

Hi folks

I’m currently modelling a chain and sprocket system which I hope to animate. Obviously this means that the sprockets being perfectly circular is pretty important, which means NURBS circles.

All is fine and dandy until I start to model the teeth on the sprocket. Using spindup gives me one of those not quite circular circles that Blender is so fond of. Fine for stills but not so good for animation. Dupliverts and a mesh circle gives the same problem.

So, the answer would appear to be dupliframes and a NURBS circle. However, there appears to be some inaccuracy in the way Blender places the teeth which means I get the wrong angle i.e. an inaccuracy in calculating the instantaneous angle of the circles circumference at the point where the tooth is.

In order to illustrate the problem I’ve dupliframed a stretched cube around a small NURBS circle as shown below. In theory the dark cubes should be evenly spaced but because of the angles being inaccurate, as you can see they are not. As you bring the dupliframed object closer to the path the problem becomes less obvious but it is still significant enough to cause problems at least in my case.

http://www.setanta.nildram.co.uk/clock.jpg

Anyway, is this inherent in the way Blender works or is there some way of getting around it (other than manually placing eack tooth :wink: )?

If it is inherent to Blender can it be fixed in code? I don’t know enough about the underlying maths used to know if it is simply down to rounding errors and/or approximations used.

TIA

Setanta

This is only due to IPO curve’s smooth interpolation. Select your curves in the IPO window, press the Tkey and select Linear.

Martin

Errrr, what curves?

I hadn’t created any myself and I can’t find any existing :-?

Setanta

Went in and created a new IPO for the curve.

Path length 32
IPO linear from 1,0 to 32,1 - Extend Cyclic

Dupliframes from 1-31

The problem is still there, though not quite so obviously

Setanta

Last time I created a toothed (bicycle-wheel style) sprocket, for whatever it may be worth I did it this way:

(1) I created a mesh circle as a reference, with a number of sides equal to the number of teeth in my gear and adjusted it to match the diameter desired.

(2) Using this as a reference, I created a second circle and adjusted it to match one gear profile, snapping the endpoints to the points of the reference circle to obtain as exact alignment as possible, then slightly eyeballing them back because the point of a gear won’t actually be a geometric point.

(3) Snapping my cursor to the center of the reference circle, I spinDup’d the tooth circle the appropriate number of times to create the teeth for my gear.

(4) I removed the reference circle.

(5) Laboriously, patiently, I stitched the teeth together.

(6) Joining the various teeth into a single object, I filled the circle and cleaned up the rather messy glob of polygons that Blender created to fill it.

(7) Finally, I extruded the whole thing to the appropriate depth of the gear.

As you observed, the geometry is not 100% perfect and I guess it depends on exactly how many points you choose to have, but I could certainly observe no glaring problems when rotating it for inspection.

Originally I used a very similar method, with a few modifications.

The actual tooth was modelled fairly accurately to scale using a variation on the method given at www.gizmology.net. I eyeballed the edges where the teeth were to join along a radius drawn from the centre of the reference circle.

I filled the profile by hand at this stage to avoid problems later.

Once this was done I created a linked duplicate and rotated it into position, then repositioned the edges between the two so they overlapped closely enough to be merged by a remove doubles later (saves all that stiching), then deleted the linked duplicate.

At that point a spin dup/remove doubles/extrude gave me a pretty good ring of teeth to work with (I modelled the inside of the sprocket with NURBS because I wanted bevels and voids).

At a small scale the slight non circularity in the ring wouldn’t be a problem, but when I came to add the chain to the sprocket the rollers refused to line up properly with the teeth, and in early attempts at animation the difference in path between the chain and the sprocket were quite noticable.

However, with a fair amount of tweaking of IPO curves and path lengths, I seem to have managed to get the dupliframes a lot closer than before. Visually for 32 frames I seem to have four groups of three and four groups of five, but the angles appear much closer than previously thanks to theeth’s tip.

I’ll post a pic if I get it right, I mean WHEN I get it right :wink:

Setanta

Hi again.

I’ve fallen back to my original teeth and spent quite some time tweaking the NURBS path I’m using for the chain. For a still, this seems to be the best answer for sure since I still can’t quite get the dupliframed teeth to behave.

However, I’ve found a few quirks with dupliframes while I’ve been messing around. If I can get a handle on them I’ll post some notes here. I think they would apply to ALL path based operations, not just dupliframes. Could be that they’re already well known but I haven’t come across them - oh well.

Anyway, a pic of the current state of play. The fit of the chain on the sprocket is still pretty rough, especially on the front sprocket, but it doesn’t show up too badly on the render. The chain is dupliframed (actually two sets of dupliframes on one path with a time offset - man am I glad I discovered THAT button) and the sprockets are a combination of NURBS and meshes.

http://www.setanta.nildram.co.uk/ChainTest.png

Setanta

I’ve been playing around with this some to see just what is actually causing the problem I’m having.

I was under the impression that NOT creating an IPO curve but just setting the path length to the appropriate value would be the same as creating a linear IPO curve with the appropriate values. In practice setting it manually DOES make a slight difference. However, it doesn’t seem to be caused by the interpolation mode as theeth suggested above - this would cause the teeth to cluster around the original tooth which isn’t what is happening.

Using a NURBS circle there seems to be some inaccuracy in the angle that the dupliframe is placed at, especially around the top, bottom and sides of the path. I have a feeling that it is related to the non-uniform way that a NURBS circle is drawn (If you don’t know what I mean, draw a NURBS circle and set the resolution to 2).

Switching to a Bezier circle I got MUCH better results, though there is some slight inconsistency in the positioning of the teeth, at least the angles seem to be fairly consistent.

The lesson seems to be, stick with Beziers and put up with them being a little out of shape if you’re trying to model something precisely.

Now if I can just figure out a good way to animate the system effectively…:wink:

Setanta