Regressions fixes for changes to teardrop2d()

This commit is contained in:
Garth Minette 2022-01-17 00:28:22 -08:00
parent c796087372
commit b436dba2d3
2 changed files with 4 additions and 5 deletions

View file

@ -857,7 +857,6 @@ function trapezoid(h, w1, w2, angle, shift=0, chamfer=0, rounding=0, flip=false,
angs = [ang1, ang2, ang2, ang1],
qdirs = [[1,1], [-1,1], [-1,-1], [1,-1]],
hyps = [for (i=[0:3]) adj_ang_to_hyp(rads[i],angs[i])],
fluh=echo(),
offs = [
for (i=[0:3]) let(
xoff = adj_ang_to_opp(rads[i],angs[i]),

View file

@ -90,10 +90,10 @@ test_octagon();
module test_teardrop2d() {
$fn=24;
assert_approx(teardrop2d(r=50), [[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593],[0,70.7106781187],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551]]);
assert_approx(teardrop2d(d=100), [[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593],[0,70.7106781187],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551]]);
assert_approx(teardrop2d(r=50,cap_h=50), [[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593],[-20.7106781187,50],[20.7106781187,50],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551]]);
assert_approx(teardrop2d(r=50,cap_h=50,ang=30), [[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-28.8675134595,50],[28.8675134595,50],[43.3012701892,25],[48.2962913145,12.9409522551]]);
assert_approx(teardrop2d(r=50), [[0,70.7106781187],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551],[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593]]);
assert_approx(teardrop2d(d=100), [[0,70.7106781187],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551],[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593]]);
assert_approx(teardrop2d(r=50,cap_h=50), [[20.7106781187,50],[35.3553390593,35.3553390593],[43.3012701892,25],[48.2962913145,12.9409522551],[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-35.3553390593,35.3553390593],[-20.7106781187,50]]);
assert_approx(teardrop2d(r=50,cap_h=50,ang=30), [[28.8675134595,50],[43.3012701892,25],[48.2962913145,12.9409522551],[50,0],[48.2962913145,-12.9409522551],[43.3012701892,-25],[35.3553390593,-35.3553390593],[25,-43.3012701892],[12.9409522551,-48.2962913145],[0,-50],[-12.9409522551,-48.2962913145],[-25,-43.3012701892],[-35.3553390593,-35.3553390593],[-43.3012701892,-25],[-48.2962913145,-12.9409522551],[-50,0],[-48.2962913145,12.9409522551],[-43.3012701892,25],[-28.8675134595,50]]);
}
test_teardrop2d();