1
0
mirror of https://github.com/Irev-Dev/Round-Anything.git synced 2025-01-17 11:08:14 +01:00

Merge pull request #6 from Irev-Dev/update-readme

Update readme
This commit is contained in:
Kurt Hutten 2020-08-09 21:00:34 +10:00 committed by GitHub
commit 1d124289d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 30 deletions

View File

@ -1,34 +1,21 @@
# Round-Anything # Round-Anything
### minkowskiRound(); Round-Anything is primarily a set of OpenSCAD utilities that help with rounding parts, but it also embodies a robust approach to developing OpenSCAD parts. The heart of the library a list of polygon points, with a 3rd radius parameter at each point. That is a series of [x, y, radius] points.
Is an incredibly powerful module that will allow you to fillet any of your OpenSCAD modules retrospectively while keeping the original dimensions. You don't need design your part again, or start using rounded cube modules etc, just throw minkowskiRound() out the front of it and your good to go. Also I hope the example in the first picture demonstrates that besides convenience of not having to add each fillet yourself, it will also fillet some areas (internal corners in particular) that are near impossible to fillet with other methods in SCAD.
Biggest downside is that it is very computationally intensive, you will have to keep the $fn low (I would recommend 10-15 as a starting point) unless you are willing to wait a long time (12 hours plus). The modules have been made with an enable variable so that you can disable the module and keep designing and only add the fillets when you are ready to output your final model. <img src="https://cdn.sanity.io/images/2hqqc7om/production/5d73db6dfd44ab2606d5e3ff5d993361eba61c5e-1371x1567.png?w=500&h=571&fit=crop" width="100%" align="left">
There is also a minkowskiInsideRound() and minkowskiOutsideRound() which takes less time to render if you only need inside or outside radii
### round2d(); ## The Why
Allows you to round any 2d object in openscad
### polyRound(); The truth is radii, internal radii in particular can be a real pain to add in openscad. and the more you move away from shapes with 90 degree angles the more difficult it becomes, effectively puting a complexity ceiling on parts you can produce in OpenScad. Because of how important radii in both making a apealing and strong part, reducing stress concentration etc, A library that focuses on radii as a core principle makes for a solid foundation for your parts. Furthermore the heard of the library revolves around the polygon, this is because the we're leveraging the battle tested paradigm of extruding from 2d scatches of most CAD packages. I can't imagine making an OpenScad part without Round-Anything.
is used the same way that polygon(); is used, however along with a list of coordinates, a list of radiuses should also be supplied and the corners will be rounded with these radiuses.
This is can be incredible useful if you try and design parts using extruded 2d polygons instead of with primatives since radiuses are generally hard to implement in OpenSCAD (internal radiuses in particular). see examples below.
I would love if people sent me examples that I can upload along with the ones I have here. ## Documentation
[thingiverse page here](https://www.thingiverse.com/thing:2419664) [Here is an overview of the library's features](https://kurthutten.com/blog/round-anything-a-pragmatic-approach-to-openscad-design/).
### Examples [Full documentation of the API is here](https://kurthutten.com/blog/round-anything-api/).
##### minkowsikRound();
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/mainminkowski.png" width="100%" align="left">
##### minkowsikInsideRound(); & minkowsikOutsideRound(); ## Extra
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/InOutminkowski.png" width="100%" align="left">
##### round2d(); I [live streamed](https://www.youtube.com/watch?v=1Tegarwy69I&t=2s) the making of [this part](https://github.com/Irev-Dev/monitor-stand-turn-camera) using this library. I was able to make the bulk of this part quickly even with some complex radii involved.
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/round2d.png" width="100%" align="left">
##### polyRound();
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/example1.png" width="100%" align="left">
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/PolyRoundexample3fn.png" width="100%" align="left">
<img src="https://github.com/Irev-Dev/Round-Anything/blob/master/images/example2.png" width="100%" align="left">
<img src="https://cdn.thingiverse.com/assets/ea/fb/83/89/57/featured_preview_camera_mount.png" width="100%" align="left">

View File

@ -14,8 +14,8 @@ function translate3Dcoords(points,tran=[0,0,0],mult=[1,1,1])=[for(i=[0:len(point
]]; ]];
function offsetPolygonPoints(points, offset=0)= function offsetPolygonPoints(points, offset=0)=
// Work sthe same as the offset does, except for the fact that instead of a 2d shape // Work sthe same as the offset does, except for the fact that instead of a 2d shape
// It works directly on ploygon points // It works directly on polygon points
// it returns the same number of points just offset into or, away from the original shape. // It returns the same number of points just offset into or, away from the original shape.
// points= a series of x,y points[[x1,y1],[x2,y2],...] // points= a series of x,y points[[x1,y1],[x2,y2],...]
// offset= amount to offset by, negative numbers go inwards into the shape, positive numbers go out // offset= amount to offset by, negative numbers go inwards into the shape, positive numbers go out
// return= a series of x,y points[[x1,y1],[x2,y2],...] // return= a series of x,y points[[x1,y1],[x2,y2],...]
@ -34,8 +34,8 @@ function makeCurvedPartOfPolyHedron(radiiPoints,r,fn,minR=0.01)=
// radiiPoints= serise of x, y, r points // radiiPoints= serise of x, y, r points
// r= radius of curve that will be put on the end of the extrusion // r= radius of curve that will be put on the end of the extrusion
// fn= amount of subdivisions // fn= amount of subdivisions
// minR= if one of the points in radiiPoints is less than r, it's likely to converg and form a sharp edge, // minR= if one of the points in radiiPoints is less than r, it's likely to converge and form a sharp edge,
// the min radius on this these converge edges can be controled with minR, though because of legacy reasons it can't be 0, but can be a very small number. // the min radius on these converged edges can be controled with minR, though because of legacy reasons it can't be 0, but can be a very small number.
// return= array of [polyhedronPoints, Polyhedronfaces, theLength of a singe layer in the curve] // return= array of [polyhedronPoints, Polyhedronfaces, theLength of a singe layer in the curve]
let( let(
lp=len(radiiPoints), lp=len(radiiPoints),
@ -86,7 +86,7 @@ let(
[polyhedronPoints, polyhedronFaces, layerLength]; [polyhedronPoints, polyhedronFaces, layerLength];
function flatternRecursion(array, init=[], currentIndex)= function flatternRecursion(array, init=[], currentIndex)=
// this is a private function, init and currentIndex are for the function // this is a private function, init and currentIndex are for the function's use
// only for when it's calling itself, which is why there is a simplified version flatternArray that just calls this one // only for when it's calling itself, which is why there is a simplified version flatternArray that just calls this one
// array= array to flattern by one level of nesting // array= array to flattern by one level of nesting
// init= the array used to cancat with the next call, only for when the function calls itself // init= the array used to cancat with the next call, only for when the function calls itself
@ -108,7 +108,7 @@ function flatternArray(array)=
flatternRecursion(array); flatternRecursion(array);
function offsetAllFacesBy(array,offset)=[ function offsetAllFacesBy(array,offset)=[
// polyhedron faces are simply a list of indeices to points, if your concat points together than you probably need to offset // polyhedron faces are simply a list of indices to points, if your concat points together than you probably need to offset
// your faces array to points to the right place in the new list // your faces array to points to the right place in the new list
// array= array of point indicies // array= array of point indicies
// offset= number to offset all indecies by // offset= number to offset all indecies by
@ -120,7 +120,7 @@ function offsetAllFacesBy(array,offset)=[
function extrudePolygonWithRadius(radiiPoints,h=5,r1=1,r2=1,fn=4)= function extrudePolygonWithRadius(radiiPoints,h=5,r1=1,r2=1,fn=4)=
// this basically calls makeCurvedPartOfPolyHedron twice to get the curved section of the final polyhedron // this basically calls makeCurvedPartOfPolyHedron twice to get the curved section of the final polyhedron
// and then goes about assmbling them, as the side faces and the top and bottom faces are missing // and then goes about assmbling them, as the side faces and the top and bottom face caps are missing
// radiiPoints= series of [x,y,r] points, // radiiPoints= series of [x,y,r] points,
// h= height of the extrude (total including radius sections) // h= height of the extrude (total including radius sections)
// r1,r2= define the radius at the top and bottom of the extrud respectively, negative number flange out the extrude // r1,r2= define the radius at the top and bottom of the extrud respectively, negative number flange out the extrude