PKStrokePont issue (iOS15.0, Xcode13.0)

I would like to adjust the PKStrokePoint of the canvas drawing in the PencilKit API. The code below should generate the same strokes, but the drawing doesn't generate well depending on the type of pen selected.

func generate_sameDrawing(drawing :PKDrawing) -> PKDrawing{
    var newDrawingStrokes : [PKStroke] = []
     
    for stroke in drawing.strokes {
      var newPoints : [PKStrokePoint] = []
      stroke.path.forEach { (point) in
        let newPoint = PKStrokePoint(location: point.location,
                       timeOffset: point.timeOffset,
                       size: point.size,
                       opacity: point.opacity,
                       force: point.force,
                       azimuth: point.azimuth,
                       altitude: point.altitude)
        newPoints.append(newPoint)
      }
      let newPath = PKStrokePath(controlPoints: newPoints, creationDate: Date())
      let newStroke = PKStroke(ink: PKInk(stroke.ink.inkType, color: stroke.ink.color), path: newPath)
         
      newDrawingStrokes.append(newStroke)
       
    }
    let newDrawing = PKDrawing(strokes: newDrawingStrokes)
    return newDrawing
  }

Here is an image showing the result.

The pen and marker generate exactly the same drawing, but with pencil type, the thickness and opacity of the stroke change, and the stroke location also moves a little. If you find any bugs/mistakes do let me know.

Please see below for the selected pen type.  (pen, marker, pencil)

PKInkingTool.InkType  

https://developer.apple.com/documentation/pencilkit/pkinkingtool/inktype

Yeah, I know this, it's a bug from PencilKit. If you create a new stroke from another stroke, even if you have the same path with stroke points - the pencil stroke will looks different. It's not only different in texture but also in width and opacity.

Sadly we couldn't do anything about it. I was hoping they will release new PencilKit version in WWDC 20 but nothing happended

PKStrokePont issue (iOS15.0, Xcode13.0)
 
 
Q