Skip to content

Instantly share code, notes, and snippets.

@LeSpocky
Last active September 24, 2024 18:39
Show Gist options
  • Save LeSpocky/7880703 to your computer and use it in GitHub Desktop.
Save LeSpocky/7880703 to your computer and use it in GitHub Desktop.
rounded square in openscad
module rounded_square( width, radius_corner ) {
translate( [ radius_corner, radius_corner, 0 ] )
minkowski() {
square( width - 2 * radius_corner );
circle( radius_corner );
}
}
module alternative_square( width, r_c ) {
hull() {
translate( [r_c, r_c, 0] ) circle( r_c );
translate( [r_c, width - r_c, 0 ] ) circle( r_c );
translate( [width - r_c, r_c, 0] ) circle( r_c );
translate( [width - r_c, width - r_c, 0] ) circle( r_c );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment