Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect result on special paths. #23

Open
TianLong1989 opened this issue Apr 15, 2022 · 0 comments
Open

Incorrect result on special paths. #23

TianLong1989 opened this issue Apr 15, 2022 · 0 comments

Comments

@TianLong1989
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant