1
0
mirror of https://github.com/Irev-Dev/Round-Anything.git synced 2025-01-29 08:57:39 +01:00

Merge pull request #28 from Irev-Dev/kurt/polyRoundExtrude-unbounded-26

Add error message when there are not enough polyRoundExtrude points
This commit is contained in:
Kurt Hutten 2021-05-31 05:20:34 +10:00 committed by GitHub
commit 8ead00a2bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,12 +165,15 @@ let(
]; ];
module polyRoundExtrude(radiiPoints,length=5,r1=1,r2=1,fn=10,convexity=10) { module polyRoundExtrude(radiiPoints,length=5,r1=1,r2=1,fn=10,convexity=10) {
orderedRadiiPoints = CWorCCW(radiiPoints) == 1 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);"));
? reverseList(radiiPoints) if(len(radiiPoints) > 2) {
: radiiPoints; orderedRadiiPoints = CWorCCW(radiiPoints) == 1
? reverseList(radiiPoints)
: radiiPoints;
polyhedronPointsNFaces=extrudePolygonWithRadius(orderedRadiiPoints,length,r1,r2,fn); polyhedronPointsNFaces=extrudePolygonWithRadius(orderedRadiiPoints,length,r1,r2,fn);
polyhedron(points=polyhedronPointsNFaces[0], faces=polyhedronPointsNFaces[1], convexity=convexity); polyhedron(points=polyhedronPointsNFaces[0], faces=polyhedronPointsNFaces[1], convexity=convexity);
}
} }