Being a fairly new user of AngelCad, I've been looking for suitable objects to model, and also 3d print, or machine. One such item is a standard steel oil-drum. The history of steel oil-drums is quite interesting, and the design soon became a world wide 'standard' The basic dimensions are 34 inches high and 23 inches in diameter, and capacity is 55 gallons (USA), 48 gallons (Imperial). They have a couple of ridges around the circumference, to add strength, and make them easy to roll.

see

https://bizfluent.com/info-tip-8098511-dimensions-55gallon-oil-drum.htmlThe goal, is to make a model of a drum, in either 7mm to the foot scale, or 4mm to the foot.

Always, in cad, model in full size dimensions, and apply a scale factor at the end to get to the size of the object needed. Most cad programs, cnc (g-code) are unit-less, although obviously the machine will be set to convert the numbers into standard units of measurement.

So, this is how I've gone about the modelling of the oil drum. I'm putting in a fair bit of detail of my method, so that if you are a raw beginner, you can understand the process. Of course, there are dozens of ways of doing this, I'm not pretending this is 'the best', but it works for me.

We start with the main cylinder, 34 inches high by 23 inches diameter

so we can write

`solid@ cyl1()`

{

return cylinder (34,11.5);

}

that is followed, as always by

`void main()`

{

shape@ obj = cyl(1);

obj.write_xcsg(GetInputFullPath(),secant_tolerance:.05);

}

which will generate an stl file, and show the representation on screen, in the xcsg viewer.

So far, so good. What else is needed? Well there is a recess at the ends of the drum, where the top is folded into the sides in manufacturing. In reality, the steel is about 0.125 inches thick, but as we are trying to model this at a small scale, and 3d printing the results, then it will pay initially to allow that lip to be thicker. (Generally in modelling, details have to be exaggerated, for various reasons) (OK, I maybe breaking the rule about always model in full size dimensions ...

)

So we can subtract a cylinder from each end of the main drum, giving us

`solid@ cyl1()`

{

return cylinder(34,11.5)- translate(0,0,33)*cylinder(1,11) - cylinder(1,11);

}

the translate (0,0,33) puts the recess at top of cylinder.

Now, in the top of the drum, there are usually two caps, a filler and a vent, so that the drum does not collapse when the contents are sucked out, or an air lock does not form when being poured. A couple of small cylinders will suffice for that.

so, we can add the script for these caps as

`solid@ caps()`

{

solid@ cap = cylinder (1,1.7);

solid@ cap2 =cylinder(1,1.2);

return translate(9,0,33)*cap + translate(-9,0,33)*cap2;

}

As the drum is centred on the origin, it is easy to get the caps evenly spaced on a diameter line, 9 inches either side of the centre.

Now, we want a couple of the reinforcement ridges, which are equally spaced on the circumference of the drum. Now, these are sort of smooth in profile, but at the small scale we are ultimately dealing with, we can represent them by a triangular profile. Thinking of a cone as being a circular triangle, and thinking of the top of one of these ridges, then the sort of shape we need is given by cone(1.1,12.2,11.3) which is saying that it is 1.1 high, and the bottom radius is 12.2, (0.7 bigger than the drum) and the inner radius is 11.3, 0.2 smaller than drum. This gives the sort of angle we are looking for, and since this shape will be added to the drum, the over lap in the diameters will not matter. We need a bottom edge of the ridge, so simply rotate the top edge around the x axis (or y) and add the top and bottom together

`solid@ ridge()`

{

solid@ top= cone(1.1,12.2,11.3);

solid@ bot= rotate_x(180)*top;

return top + bot ;

}

You can now add together what we have so far, and view the result.

So, we now have to position the two ridges, but if If you look at an image of an oil drum, you can see there is also a lip at the top and bottom, so we may as well show that, too

so, we can make the lips 0.2inches wide, and position the ridges at 11 and 22 inches from the bottom of the drum

`solid@ ridges()`

{

solid@ lip = cylinder(1,11.7)-cylinder (1,11.5);

solid@ toplip = translate(0,0,33)*lip;

return translate(0,0,11)*ridge()+ translate(0,0,22)*ridge() + lip + toplip;

}

That is the drum components completed, so add it all together

`solid@ drum()`

{

return cyl1() + caps()+ridges();

}

remember, that if you have gone through this procedure outlined above, and viewed the results at each stage, you will need to modify the name of the object you are creating in main(). Also, secant_tolerance, adjusts the smoothness of the surface for curved objects, see

https://github.com/arnholm/xcsg/wiki/secant_toleranceNow, part of the design features of standard oil drums, is that four of them sit quite nicely on a standard pallet, with one inch spacing between them (It is not clear if that is one inch between each drum body, or one inch between ridges).

So, we can position four of them, (The rotates make sure that the fillers are not lined up, I do not think they would be in reality, unless perhaps new empty drums from the manufacturer)

`solid@ four()`

{

solid@ first = drum();

solid@ second = translate(0,24.5,0)*rotate_z(25)* first;

solid@ third = translate(24.5,0,0)*rotate_z(50)* first;

solid@ fourth = translate(24.5,24.5,0)*rotate_z(150)*first;

return first+second+third+fourth;

}

You may as well print four of these pallet-fulls. As an exercise, use translate and rotate so that none of the fillers line up. (In my example, I've not done the rotates.)

so, at 7mm to the foot, and most 3d printers expect mm dimensions, then the scale is 7/12 mm to the inch a scale of 58.3%, near enough.

Applying the AngelCad scaling transform we can have something like - scale(0.583)*four() in the main function.

I've attached the complete script (barrel.as). (attached as barrel.txt - you can rename it)

In practice, I may take care of the scaling in the slicing program, if wanting different scaled models.

I hope this has helped you, if you realise the power of Angel Cad, but can't make much sense of github, and the rest of the help system.

A few additional print related comments. The lips need to be far larger than the scaled full size, since the detail is too fine for a slicer, such as Cura to slice properly. The two fillers need to be bigger, too, they just look wrong. There are certain aspects in models, that need to be exaggerated, in order for them to 'look right'. In the same way that colours generally need to be more subdued, and matt finish paint, not gloss, etc, is preferred. Equally, there are some things that can not be readily modeled to scale, working tolerances, for example, sound too.

---

**Edit** (by Carsten Arnholm): I put your code snippets in code tags to make the post easier to read. Please use the # button for this purpose.