mapbox / mapbox/mapbox-scenekit

Crash in BezierSpline3D -> getProgressProperties

Open
#62 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
232
Forks
50
PR merge metrics
No merged PRs in 30d

Description

The code crashed in line 58, which is:

```let spineSegmentStartIndex: Int = min(Int(absoluteProgress), curvePoints.count - 2 - pad * 2) // Integer time for the index of the starting curvePoint```

`absoluteProgress` is `NaN`, `curvePoints.count` is `4`, `pad` is `1`.

Unfortunately, I'm not sure why `absoluteProgress` isn't a number. However, at the moment, it is happening in 100% cases I'm trying to render a route.

Contributor guide

Open the contributing guide

Research direction

Start in BezierSpline3D.getProgressProperties at line 58, where absoluteProgress is passed to Int while rendering a route. Reproduce the route-rendering crash and trace why absoluteProgress becomes NaN; done means the route renders without this crash and the invalid-progress case is handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.