Skip to content

Instantly share code, notes, and snippets.



Last active Nov 22, 2019
What would you like to do?
// AngelCAD code. Demonstrate fillet between two plates

solid@ fillet(solid@ obj, double r)
   // create a cube enclosing the object completely
   // with an internal void shaped by the object
   boundingbox@ box =;
   pos3d@ c  =; 
   solid@ d1 = translate(c.x(),c.y(),c.z())*cube(box.diagonal()*2,center:true) - obj;
   // make the void smaller
   solid@ m1 = minkowski3d(d1,sphere(r));
   //  subtract from the object
   return obj - m1;

shape@ main_shape()
   double r = 3;  // fillet radius
   // add fillet radius thickness on all sides of the cubes
   // since we will "machine" it away later in fillet operation
   double rth = 2*r;
   // bottom plate and center point
   solid@ plate = cuboid(20+rth,50+rth,2+rth);  
   pos3d@ cp    =; 
   // extrusion and extrusion height
   solid@ extr  = cuboid(10+rth,2+rth,10+rth,center:true); 
   double eh    =; 
   // union the two and machine away to create fillet
   return fillet(plate+translate(cp.x(),cp.y(),cp.z()+eh/2)*extr,r);

void main()
   shape@ obj = main_shape();
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
You can’t perform that action at this time.