Add light highlighting to round anything docs

This commit is contained in:
Kurt Hutten
2021-06-07 20:37:38 +10:00
parent d93326f672
commit ec68b8827c

View File

@@ -45,7 +45,10 @@ Arguments are:
```cpp ```cpp
radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]]; radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]];
polygon(polyRound(radiiPoints,30)); polygon(
// highlight-next-line
polyRound(radiiPoints,30)
);
``` ```
By default `polyRound` will reduce radii to stop any two subsequent radii from conflicting. By default `polyRound` will reduce radii to stop any two subsequent radii from conflicting.
To further understand how the radii conflict resolution works here's an example of that. To further understand how the radii conflict resolution works here's an example of that.
@@ -95,6 +98,7 @@ It is recommended over `extrudeWithRadius` where possible.
```cpp ```cpp
radiiPoints=[[10,0,10],[20,20,1.1],[8,7,10],[0,7,0.3],[5,3,0.1],[-4,0,1]]; radiiPoints=[[10,0,10],[20,20,1.1],[8,7,10],[0,7,0.3],[5,3,0.1],[-4,0,1]];
// highlight-next-line
polyRoundExtrude(radiiPoints,2,0.5,-0.8,fn=50); polyRoundExtrude(radiiPoints,2,0.5,-0.8,fn=50);
``` ```
@@ -134,8 +138,10 @@ function nutCapture(startAndEndRadius=0)=[
]; ];
translate([-5,0,0])polygon(polyRound(nutCapture(),20)); translate([-5,0,0])polygon(polyRound(nutCapture(),20));
// highlight-start
negativeNutCapture=translateRadiiPoints(nutCapture(),tran=[5,0]); negativeNutCapture=translateRadiiPoints(nutCapture(),tran=[5,0]);
rotatedNegativeNutCapture=translateRadiiPoints(nutCapture(1),tran=[20,5],rot=90); rotatedNegativeNutCapture=translateRadiiPoints(nutCapture(1),tran=[20,5],rot=90);
// highlight-end
aSquare=concat( aSquare=concat(
[[0,0,0]], [[0,0,0]],
negativeNutCapture, negativeNutCapture,
@@ -174,6 +180,7 @@ Here's a simple example.
```cpp ```cpp
radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]]; radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]];
shell2d(-0.5)polygon(polyRound(radiiPoints,30)); shell2d(-0.5)polygon(polyRound(radiiPoints,30));
// highlight-next-line
translate([0,-10,0])shell2d(-0.5){ translate([0,-10,0])shell2d(-0.5){
polygon(polyRound(radiiPoints,30)); polygon(polyRound(radiiPoints,30));
translate([8,8])gridpattern(memberW = 0.3, sqW = 1, iter = 17, r = 0.2); translate([8,8])gridpattern(memberW = 0.3, sqW = 1, iter = 17, r = 0.2);
@@ -314,6 +321,7 @@ use: `mirroredRadiiPoints = mirrorPoints(radiiPoints, rot, endAttenuation)`
```cpp ```cpp
centerRadius=7; centerRadius=7;
points=[[0,0,0],[2,8,0],[5,4,3],[15,10,0.5],[10,2,centerRadius]]; points=[[0,0,0],[2,8,0],[5,4,3],[15,10,0.5],[10,2,centerRadius]];
// highlight-next-line
mirroredPoints=mirrorPoints(points,0,[0,0]); mirroredPoints=mirrorPoints(points,0,[0,0]);
translate([0,-20,0])polygon(polyRound(mirroredPoints,20)); translate([0,-20,0])polygon(polyRound(mirroredPoints,20));
``` ```
@@ -340,7 +348,9 @@ extrudeWithRadius(length,r1=0,r2=0,fn=30){
```cpp ```cpp
radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]]; radiiPoints=[[-4,0,1],[5,3,1.5],[0,7,0.1],[8,7,10],[20,20,0.8],[10,0,10]];
extrudeWithRadius(3,0.5,0.5,50)polygon(polyRound(radiiPoints,30)); // highlight-next-line
extrudeWithRadius(3,0.5,0.5,50)
polygon(polyRound(radiiPoints,30));
#translate([7,4,3])extrudeWithRadius(3,-0.5,0.95,50)circle(1,$fn=30); #translate([7,4,3])extrudeWithRadius(3,-0.5,0.95,50)circle(1,$fn=30);
``` ```