Skip to content

Incorrect result on special paths. #23

Description

@TianLong1989

Hi, I set two paths as follows.
let path = UIBezierPath()
path.move(to: CGPoint(x: 445, y: 359))
path.addCurve(to: CGPoint(x: 381, y: 423), controlPoint1: CGPoint(x: 445, y: 394.3462239872), controlPoint2: CGPoint(x: 416.3462239872, y: 423))
path.addCurve(to: CGPoint(x: 317, y: 359), controlPoint1: CGPoint(x: 345.6537760128, y: 423), controlPoint2: CGPoint(x: 317, y: 394.3462239872))
path.addCurve(to: CGPoint(x: 381, y: 295), controlPoint1: CGPoint(x: 317, y: 323.6537760128), controlPoint2: CGPoint(x: 345.6537760128, y: 295))
path.addCurve(to: CGPoint(x: 445, y: 359), controlPoint1: CGPoint(x: 416.3462239872, y: 295), controlPoint2: CGPoint(x: 445, y: 323.6537760128))
path.close()

let path1 = UIBezierPath()
path1.move(to: CGPoint(x: 396.188153789188, y: 421.1869913808138))
path1.addCurve(to: CGPoint(x: 354, y: 361), controlPoint1: CGPoint(x: 371.580991406671, y: 412.2674684341148), controlPoint2: CGPoint(x: 354, y: 388.6868644969018))
path1.addCurve(to: CGPoint(x: 402.8118787893286, y: 298.813008615249), controlPoint1: CGPoint(x: 354, y: 330.8869397620923), controlPoint2: CGPoint(x: 374.7972348964752, y: 305.6313340004763))
path1.addCurve(to: CGPoint(x: 445, y: 359), controlPoint1: CGPoint(x: 427.419008593329, y: 307.7325315658853), controlPoint2: CGPoint(x: 445, y: 331.3131355030982))
path1.addCurve(to: CGPoint(x: 396.1881212105952, y: 421.1869913847696), controlPoint1: CGPoint(x: 445, y: 389.113060237935), controlPoint2: CGPoint(x: 424.2027651034871, y: 414.3686659995695))
path1.close()

And then I tried to get 'union', 'intersect' of these two paths.
Results are not correct.
image
image
'Union' result should be 'full circle'...
Anyone can fix this bug?
Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions