I've not heard of polyfix, but will try it. Anyway, I found the problem area, and resolved it, but not before I'd produced a print that fell apart when I lifted it from the print bed. (It looked OK in the slicer.)// AngelCAD code.
// makes a spoked handwheel
double bore =8.2;// bore
double shaft=20;//shaft od
double shaftlen=40;//shaft length
double borelen=25;//bore length
double rimod=50;// rim od
double rimid=38;//rim id
double rimthick=8;// rim thickness
double spokes=5;//no of spokes
double fixloc=8;//fix location from boss end
double fixdiam=2;//fix diam
double grips=12;//number of grips
double round =3.5;// diameter of fillet
solid@ rim(double h,double d2,double d1, double rc)
{
// get tube
solid@ arim= cylinder (h,d2/2) - cylinder(h,d1/2);
//fillet inside
return arim;
}
solid@ aspoke(double t,double d, double n, double ch)
// get spoke
{
double thick = (t-ch)*0.5; //spoke width
// make quarter spoke with rounded edge
// use offset, radius ch/2 of square for profile, then extrude
solid@ spr= linear_extrude(offset2d(square(thick),r:ch/2),(d+(t))/2);
solid@ spk = translate(0,-(thick/2),thick+ch/2)*rotate_y(90)*spr;
// rotate and add spokes
array <solid@> total;
for (int j=1;j<n+1;j++)
{
solid@ rotsp = rotate_z(j*360/n)* spk;
total.push_back(rotsp);
}
return union3d(total);
}
solid@ grip(double t,double d, double n)
// puts n balls on circle of diameter d. ball diameter is t
{
array <solid@> balls;
for (int j=1;j<=n;j++)
{
solid@ rotb = rotate_z(j*360/n)*translate(d/2,0,t/2)*sphere((t)*0.8/2);
balls.push_back(rotb);
}
return union3d(balls);
}
shape2d@ corner_poly(double filletdiam,double bigdiameter)
{
// generates polygon for rounding corners of tubes
double r= filletdiam/2;
double br= bigdiameter/2;
shape2d@ block = square(2*r);
@block = block - translate(0,2*r)*circle(r);
@block = block - translate(0,0)*circle(r);
@block = block - translate(2*r,0)*circle(r);
@block = block - translate(2*r,2*r)*circle(r);
return translate(br,0)*translate(-r,-r)*block;
return block;
}
solid@ round_over(double filletdiam, double circlediam)
{// makes the profile to be subtracted from square ends
shape2d@ poly = corner_poly(filletdiam,circlediam);
solid@ curv = rotate_extrude(poly,360,0);
@curv = rotate_x(90)*translate(0,filletdiam,0)*curv ;
return translate(0,0,-filletdiam)*curv;
}
solid@ rwboss(double sl,double sd,double bl, double bo,double fixl, double fixd, double ch)
// calc centre boss with fix hole
{
solid@ shf=cylinder(sl,sd/2)-translate(0,0, sl-bl)*cylinder( bl, bo/2);
//fixing hole
solid@ fix = rotate_y(90)*cylinder(sd*8,fixd/2);
return shf - translate(-sd*3,0,sl-fixl)*fix ;
}
shape@ main_shape()
{
solid@ os=rim(rimthick,rimod,rimid, round);
solid@ gripper =translate(0,0,0)*grip(rimthick,rimod,grips);
// fillet bottom of rim
@os=os + gripper;
@os = os - round_over(round,rimod);
@os = os - round_over(round,rimid);
//fillet top of rim
@os = os - translate(0,0,rimthick)*round_over(round,rimod);;
@os = os - translate(0,0,rimthick)*round_over(round,rimid);;
@os=os + gripper;
// get shaft
solid@ shft = rwboss(shaftlen,shaft, borelen,bore,fixloc,fixdiam,round);
@shft= shft -round_over(round,shaft);
// bigger radius at shaft end
@shft = shft - translate(0,0,shaftlen)* round_over(round*2,shaft);
// get spokes
solid@ spk = aspoke(rimthick,rimid,spokes,round);
return os + spk + shft ;
}
void main()
{
shape@ obj = main_shape();
obj.write_xcsg(GetInputFullPath(),secant_tolerance:.01);
}
The above code works. Previous version problem was caused by the gripper balls diameter, and the order the handwheel was assembled. If the spheres were big, they did not merge properly with the rounded edge of the rim, and although everything looked fine in meshlab, and on the slicer, it looked good enough to print, but the object was not watertight. The spheres need to be less than the flat area of the rim to be certain it builds correctly, but in some situations they can be a bit larger. I'm pretty sure there are other combinations that fail, too.