Quote:
// Define polygon shape here, cross section.
module shape()
{
polygon(points=[[0,0],[0,5],[10,10],[5,0]], paths=[[0,1,2,3]]);
}
module corner(Quadrant, CentretoShape,CornerRadius)
{
rotate(Quadrant*90,0,0)
translate ([CentretoShape,CentretoShape,0])
for (c = [0:90])
{
rotate (a = [0, 0, c])
{
rotate(a = [90, 0, 0])
{
linear_extrude(height = 1, center = true, convexity = 10, twist = 0)
translate([CornerRadius, 0, 0])
shape();
}
}
}
}
module side(Quadrant, CentretoShape, CornerRadius)
{
rotate(a = [0, 0, Quadrant*90])
{
rotate(a = [90, 0, 0])
{
linear_extrude(height = 2*CentretoShape, center = true, convexity = 10, twist = 0)
translate([CornerRadius+CentretoShape, 0, 0])
shape();
}
}
}
module toroid(CentretoShape,CornerRadius)
{
corner (1, CentretoShape,CornerRadius);
corner (2, CentretoShape,CornerRadius);
corner (3, CentretoShape,CornerRadius);
corner (4, CentretoShape,CornerRadius);
side (1, CentretoShape,CornerRadius);
side (2, CentretoShape,CornerRadius);
side (3, CentretoShape,CornerRadius);
side (4, CentretoShape,CornerRadius);
}
//CentretoShape,CornerRadius
toroid (25,10);
If you go big you need to increase the extrusion of the shape so as not to have gaps in it.