Skip to content

Instantly share code, notes, and snippets.

@arnholm
Last active July 19, 2021 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnholm/24d750acf39b701f5c915d54fb7c8453 to your computer and use it in GitHub Desktop.
Save arnholm/24d750acf39b701f5c915d54fb7c8453 to your computer and use it in GitHub Desktop.
// AngelCAD code.
shape@ main_shape(as_args@ args)
{
double l = 20.5; // mm
double w = 10.5; // mm
double diam = 16.0; // mm
double tol = 0.75; // mm
solid@ pipe = rotate_y(deg:-90)
*translate(diam*1.5,0,10)
*cylinder(r:diam/2+tol,h:100);
solid@ leg = translate(-3,0,0)
* rotate_z(deg:-90)
* translate(0,0,diam)
* linear_extrude(rectangle(l+tol,w+tol,center:true),height:100);
solid@ cutoff = translate(-1.0*diam,0,2.4*diam)
* rotate_x(deg:90)
*cylinder(r:18,h:100,center:true);
solid@ box = translate(0,0,diam)
*cuboid(dx:2*diam,dy:1.5*diam,dz:2*diam,center:true);
return box - cutoff - translate(0.7*diam,0,-0.85*diam)*(pipe+leg);
}
void main()
{
shape@ obj = main_shape(GetArgs());
obj.write_xcsg(GetInputFullPath(),secant_tolerance:0.001);
}
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment