Skip to content

Fix for spline PathOptimizer::getSleeve #63

Description

@redexp

Good day

I was playing around with this lib and stuck with error that on this line

if (t.containsPoint(this.poly.end)) {

t is undefined It's because method private getSleeve(sourceTriangle: Tr) gets sourceTriangle === undefined. Looking in code I found that this method used only ones

    const sleeve: FrontEdge[] = this.getSleeve(this.findSourceTriangle(localCdt))
    if (sleeve == null) {

so result of this method could be null or undefined and I decided to add check for sourceTriangle like

  private getSleeve(sourceTriangle: Tr): FrontEdge[] {
    if (!sourceTriangle) return;

and error gone

Why this.findSourceTriangle(localCdt) returns undefined I don't know, but I can give you my graph in json and code how I use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions