Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@arnholm
Last active May 26, 2020 11:09
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/de50168cd1a477be1de116e100a8066a to your computer and use it in GitHub Desktop.
Save arnholm/de50168cd1a477be1de116e100a8066a to your computer and use it in GitHub Desktop.
// AngelCAD code: USB-winkeler.as
// https://arnholm.github.io/angelcad-docs/
// (Adapted from USB-Winkeler-bug.scad by Dietrich)

// calbe diameter
double d1 = 5;
// 90º Radius
double r1= 20;
//wall thickness
double wt = 2;
// tolerance
double tol = .4;//.1

solid@ connector() 
{
   shape2d@ cs = translate(r1,0)*circle(r:0.5*(d1+tol));
   return translate(r1,0)* rotate_y(deg:-90)*rotate_extrude(cs, deg:90);
}

solid@ tubify()
{
   solid@ c = connector();
   return minkowski3d(c,sphere(r:wt)) - c;
}

shape@ main_shape()
{
   return tubify();
}

void main()
{
   shape@ obj = main_shape();
   obj.write_xcsg(GetInputFullPath(),secant_tolerance:-1.0);
}
Display the source blob
Display the rendered blob
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment