-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
I'm not very high level in math and not sure what the proper fix should be, but in Path+Shapes.swift extrusionContours there is a check for point count being bigger than 1, while later on in tries to access points[2] which fails if the count is 2 and it was causing crashes on my end. I changed the count check to 2 which fixed it, but again not sure if it's a correct solution here.
...
let count = points.count
guard count > 1 else {
return [translated(by: p0.position)]
}
...
if along.isClosed {
for i in 1 ..< count {
addShape(points[(i < count - 1) ? i + 1 : 1])
}
addShape(points[2])
shape = shapes.last!
shapes[shapes.count - 1] = shapes[0]
} else {
addShape(p0, nil)
for point in points.dropFirst(2) {
addShape(point)
}
let last2 = points.suffix(2).map { $0.position }
twistShape(last2[1] - last2[0])
addShape(points.last!, nil)
shape = shapes.last!
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels