Crash in BezierSpline3D -> getProgressProperties

Open
#62 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

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.

Dominant language
Swift
Stars
232
Forks
51
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mapbox/mapbox-scenekit

All issues in mapbox/mapbox-scenekit

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.