1
0
mirror of https://github.com/Irev-Dev/Round-Anything.git synced 2025-09-09 22:51:17 +02:00

7 Commits
1.0.3 ... 1.0.4

Author SHA1 Message Date
Kurt Hutten
8ead00a2bf Merge pull request #28 from Irev-Dev/kurt/polyRoundExtrude-unbounded-26
Add error message when there are not enough polyRoundExtrude points
2021-05-31 05:20:34 +10:00
Kurt Hutten
66f30bed93 Add error message when there are not enough polyRoundExtrude points
Resolves #26
2021-05-30 14:54:29 +10:00
Kurt Hutten
f9928e36e1 Merge pull request #23 from damienmg/patch-1
Correctly instanciate recursion index
2021-05-03 11:39:05 +10:00
Damien Martin-Guillerez
26fb282626 Correctly instanciate recursion index
Caller of the flatternRecursion method does not set necessarily the index value and OpenSCAD complain that this result in adding number to undefined.
2021-05-02 11:43:31 +02:00
Kurt Hutten
c04a81f25c Update README.md 2021-01-28 18:28:26 +11:00
Kurt Hutten
e6d91c352b Update README.md 2021-01-03 18:51:22 +11:00
Kurt Hutten
297a7ce5dc Merge pull request #17 from Irev-Dev/issue16-fix-90deg-bug-in-findPoint
Fix 90 degree bug in findPoint
2020-11-02 18:14:50 +11:00
2 changed files with 18 additions and 6 deletions

View File

@@ -8,9 +8,16 @@ Round-Anything is primarily a set of OpenSCAD utilities that help with rounding
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 heart of the library revolves around the polygon, this is because we're leveraging the battle tested paradigm of extruding from 2d sketches of most CAD packages. I can't imagine making an OpenScad part without Round-Anything.
### Quick side-notes
I'm currently working on a community website for "Code-CAD" (like OpenSCAD). A good way to think of it is codepen crossed with a thing repository. You can check it out at [cadhub.xyz](https://cadhub.xyz/) or it's [repo](https://github.com/Irev-Dev/cadhub).
Also please submit examples of what you build with the library in the [discussions](https://github.com/Irev-Dev/Round-Anything/discussions), I'd love to see them. I also recommend you "watch" the repo with notifications turned on for the discussions to stay up-to-date.
## Documentation
See an overview of the library in [video form](https://www.youtube.com/watch?v=laxv2wFKq8Q)
<a href="https://www.youtube.com/watch?v=laxv2wFKq8Q"><img src="https://i.ytimg.com/vi/laxv2wFKq8Q/sddefault.jpg" width="100%" align="left"></a>
@@ -18,6 +25,8 @@ See an overview of the library in [video form](https://www.youtube.com/watch?v=l
[Full documentation of the API is here](https://kurthutten.com/blog/round-anything-api/).
[Installation instructions](https://github.com/Irev-Dev/Round-Anything/discussions/21)
## Extra
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 thanks to the library.

View File

@@ -90,7 +90,7 @@ let(
)
[polyhedronPoints, polyhedronFaces, layerLength];
function flatternRecursion(array, init=[], currentIndex)=
function flatternRecursion(array, init=[], currentIndex=0)=
// 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
// array= array to flattern by one level of nesting
@@ -165,12 +165,15 @@ let(
];
module polyRoundExtrude(radiiPoints,length=5,r1=1,r2=1,fn=10,convexity=10) {
orderedRadiiPoints = CWorCCW(radiiPoints) == 1
? reverseList(radiiPoints)
: radiiPoints;
assert(len(radiiPoints) > 2, str("There must be at least 3 radii points for polyRoundExtrude. ", radiiPoints, " is not long enough, you need ", 3 - len(radiiPoints), " more point/s. Example: polyRoundExtrude([[11,0,1],[20,20,1.1],[8,7,0.5]],2,0.5,-0.8,fn=8);"));
if(len(radiiPoints) > 2) {
orderedRadiiPoints = CWorCCW(radiiPoints) == 1
? reverseList(radiiPoints)
: radiiPoints;
polyhedronPointsNFaces=extrudePolygonWithRadius(orderedRadiiPoints,length,r1,r2,fn);
polyhedron(points=polyhedronPointsNFaces[0], faces=polyhedronPointsNFaces[1], convexity=convexity);
polyhedronPointsNFaces=extrudePolygonWithRadius(orderedRadiiPoints,length,r1,r2,fn);
polyhedron(points=polyhedronPointsNFaces[0], faces=polyhedronPointsNFaces[1], convexity=convexity);
}
}