创建2个贝塞尔曲线路径的并集 [英] Creating a union of 2 bezier paths

查看:67
本文介绍了创建2个贝塞尔曲线路径的并集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个贝塞尔曲线路径,我想将它们组合起来以形成一个并集,以便可以描画整个外形。就我而言,这是一个带有尾巴的讲话泡泡,因此,尽管它不是一个复杂的形状,但实际上很难使用一条路径来创建它。

I have two bezier paths that i'd like to combine to form a union, so that I can stroke the entire outer shape. In my case, it's a speech bubble with a tail, so although it's not a complex shape it would actually be quite hard to create it using one single path.

似乎不是用于创建联合的Core Graphics API。我错了吗?

There doesn't appear to be a Core Graphics API for creating unions. Am I wrong?

如果我没有错,那么有人知道可以处理这个问题的图书馆吗?我搜索GitHub无济于事。

If I'm not, does anyone know of a library that can handle this? I've search GitHub to no avail.

推荐答案

如果您使用的是封闭形状,UIBezierPath会这样做。

UIBezierPath does that if you are working with closed shapes.

UIBezierPath *firstPath = [UIBezierPath bezierPath];
// build your path

UIBezierPath *secondPath = [UIBezierPath bezierPath];
// build your path

[firstPath appendPath:secondPath];

这篇关于创建2个贝塞尔曲线路径的并集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆