Skip to content

Instantly share code, notes, and snippets.

@arnholm

arnholm/USB-winkeler.md

Last active May 26, 2020
Embed
What would you like to do?
// 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);
}
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.