Skip to content

Commit

Permalink
fix: use the open uniform knot vector for spline (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarikjabiri authored May 6, 2023
1 parent c1ddbe3 commit 3c24094
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Sections/EntitiesSection/Entities/Spline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,10 @@ export class Spline extends Entity {
const eknl = dc + cpl + 1 // Expected knots length.

if (this.knots.length === 0) {
for (let i = 0; i < edc; i++) {
this.knots.push(0)
}
for (let i = 1; i < cpl - dc; i++) {
this.knots.push(i)
}
for (let i = 0; i < edc; i++) {
this.knots.push(cpl - dc)
let k = 0
for (let i = 0; i < eknl; i++) {
if (i <= dc || i >= cpl + 1) this.knots.push(k)
else this.knots.push(++k)
}
}

Expand Down

0 comments on commit 3c24094

Please sign in to comment.