Compare commits

...

11 commits

Author SHA1 Message Date
adrianVmariano
2ece6dcddc
Merge 6b50f2d373 into c442c5159a 2024-12-07 18:57:28 +00:00
Adrian Mariano
6b50f2d373 bug fix for specified knots case 2024-12-07 13:57:15 -05:00
Revar Desmera
c442c5159a
Merge pull request #1513 from adrianVmariano/master
ghosting, etc
2024-11-29 00:17:58 -08:00
Revar Desmera
bbf4bc38c0
Merge pull request #1509 from adrianVmariano/master
polyhedron fix
2024-11-19 16:27:11 -08:00
Revar Desmera
ab2d381034
Merge pull request #1507 from adrianVmariano/master
Will hirth fixes never cease?
2024-11-17 21:41:15 -08:00
Revar Desmera
606b6acde2
Merge pull request #1506 from adrianVmariano/master
Tube Rounding
2024-11-13 19:34:47 -08:00
Revar Desmera
94583da672
Merge pull request #1504 from adrianVmariano/master
doc fixes
2024-11-11 15:55:29 -08:00
Revar Desmera
802059f2cb
Merge pull request #1502 from adrianVmariano/master
hirth update
2024-11-08 22:17:41 -08:00
Revar Desmera
ccccd39160
Merge pull request #1501 from adrianVmariano/master
dox fixes
2024-11-05 19:51:34 -08:00
Revar Desmera
0f6a321568
Merge pull request #1500 from adrianVmariano/master
doc fix
2024-11-05 18:10:30 -08:00
Revar Desmera
73a8033316
Merge pull request #1498 from adrianVmariano/master
NURBS
2024-11-03 21:30:04 -08:00

View file

@ -137,7 +137,7 @@ include<BOSL2/beziers.scad>
// Example(2D,NoAxes): Explicitly specified knots only change the quadratic clamped curve slightly. Knot count is len(control)-degree+1 = 9. // Example(2D,NoAxes): Explicitly specified knots only change the quadratic clamped curve slightly. Knot count is len(control)-degree+1 = 9.
// pts = [[5,0],[0,20],[33,43],[37,88],[60,62],[44,22],[77,44],[79,22],[44,3],[22,7]]; // pts = [[5,0],[0,20],[33,43],[37,88],[60,62],[44,22],[77,44],[79,22],[44,3],[22,7]];
// knots = [0,1,3,5,9,13,14,19,21]; // knots = [0,1,3,5,9,13,14,19,21];
// debug_nurbs(pts,2); // debug_nurbs(pts,2,knots=knots);
// Example(2D,NoAxes): Combining explicit knots with mult for the quadratic curve to add a corner // Example(2D,NoAxes): Combining explicit knots with mult for the quadratic curve to add a corner
// pts = [[5,0],[0,20],[33,43],[37,88],[60,62],[44,22],[77,44],[79,22],[44,3],[22,7]]; // pts = [[5,0],[0,20],[33,43],[37,88],[60,62],[44,22],[77,44],[79,22],[44,3],[22,7]];
// knots = [0,1,3,9,13,14,19,21]; // knots = [0,1,3,9,13,14,19,21];
@ -288,7 +288,8 @@ function nurbs_curve(control,degree,splinesteps,u, mult,weights,type="clamped",
; ;
!done !done
; ;
output = (uind<len(adjusted_u) && approx(adjusted_u[uind],knot[kind]) && ((kmultind>=len(kmult)-1 || kind+kmult[kmultind]>=len(control)))) ? kind-kmult[kmultind-1] output = (uind<len(adjusted_u) && approx(adjusted_u[uind],knot[kind]) && kind>kmult[0]-1 && ((kmultind>=len(kmult)-1 || kind+kmult[kmultind]>=len(control))))
?kind-kmult[kmultind-1]
: (uind<len(adjusted_u) && adjusted_u[uind]>=knot[kind] && adjusted_u[uind]>=knot[kind] && adjusted_u[uind]<knot[kind+kmult[kmultind]]) ? kind : (uind<len(adjusted_u) && adjusted_u[uind]>=knot[kind] && adjusted_u[uind]>=knot[kind] && adjusted_u[uind]<knot[kind+kmult[kmultind]]) ? kind
: undef, : undef,
done = uind==len(adjusted_u), done = uind==len(adjusted_u),
@ -300,7 +301,7 @@ function nurbs_curve(control,degree,splinesteps,u, mult,weights,type="clamped",
if (is_def(output)) output] if (is_def(output)) output]
) )
[for(i=idx(adjusted_u)) [for(i=idx(adjusted_u))
_nurbs_pt(knot,select(control, knotidx[i]-degree,knotidx[i]), adjusted_u[i], 1, degree, knotidx[i]) _nurbs_pt(knot,slice(control, knotidx[i]-degree,knotidx[i]), adjusted_u[i], 1, degree, knotidx[i])
]; ];