路径上的布尔操作。
项目描述
布尔运算
路径上的布尔运算,使用 Angus Johnson 开发的超快速 多边形裁剪库。
您可以从 PyPI 下载最新版本
https://pypi.ac.cn/project/booleanOperations.
安装
Pip 是安装 booleanOperations 推荐的工具。
要安装最新版本
pip install booleanOperations
BooleanOperations 依赖于以下包
所有依赖项均可在 PyPI 上找到,因此它们将在安装 booleanOperations 时自动解决。
BooleanOperationManager
包含一个处理路径上所有布尔运算的 BooleanOperationManager。路径必须类似于 defcon、robofab 外轮廓。管理器在 pointPen 中绘制结果。
from booleanOperations import BooleanOperationManager
manager = BooleanOperationManager()
BooleanOperationManager()
创建一个 BooleanOperationManager。
manager.union(contours, pointPen)
对所有 contours 执行并集并在 pointPen 中绘制它。(这是移除重叠的操作)
manager.difference(contours, clipContours, pointPen)
从 contours 中移除 clipContours 并在 pointPen 中绘制它。
manager.intersection(contours, clipContours, pointPen)
仅从 contours 与 clipContours 的重叠部分绘制并绘制在 pointPen 中。
manager.xor(contours, clipContours, pointPen)
仅从 contours 与 clipContours 不重叠的部分绘制并绘制在 pointPen 中。
manager.getIntersections(contours)
返回给定轮廓的所有交集
BooleanGlyph
具有布尔功能的类似符号的对象。
from booleanOperations.booleanGlyph import BooleanGlyph
booleanGlyph = BooleanGlyph(sourceGlyph)
BooleanGlyph(sourceGlyph)
从 sourceGlyph 创建一个 BooleanGlyph 对象。这是一个非常浅层的符号对象,具有基本支持。
booleanGlyph.union(other)
与 other 执行 并集。其他必须是符号或 BooleanGlyph 对象。
result = BooleanGlyph(glyph).union(BooleanGlyph(glyph2))
result = BooleanGlyph(glyph) | BooleanGlyph(glyph2)
booleanGlyph.difference(other)
与 other 执行 差集。其他必须是符号或 BooleanGlyph 对象。
result = BooleanGlyph(glyph).difference(BooleanGlyph(glyph2))
result = BooleanGlyph(glyph) % BooleanGlyph(glyph2)
booleanGlyph.intersection(other)
与 other 执行 交集。其他必须是符号或 BooleanGlyph 对象。
result = BooleanGlyph(glyph).intersection(BooleanGlyph(glyph2))
result = BooleanGlyph(glyph) & BooleanGlyph(glyph2)
booleanGlyph.xor(other)
与 other 执行 对称差集。其他必须是符号或 BooleanGlyph 对象。
result = BooleanGlyph(glyph).xor(BooleanGlyph(glyph2))
result = BooleanGlyph(glyph) ^ BooleanGlyph(glyph2)
booleanGlyph.removeOverlap()
对自己执行 并集。这将移除所有重叠轮廓和自相交轮廓。
result = BooleanGlyph(glyph).removeOverlap()
booleanGlyph.name
源符号的 名称。
booleanGlyph.unicodes
源符号的 Unicode。
booleanGlyph.width
源符号的 宽度。
booleanGlyph.lib
源符号的 库。
booleanGlyph.note
源符号的 备注。
booleanGlyph.contours
列出符号的 轮廓。
booleanGlyph.components
列出符号的 组件。
booleanGlyph.anchors
列出符号的 锚点。
项目详情
下载文件
下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源代码分发
构建分发
booleanOperations-0.9.0.zip的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8cfa821c32ad374fa120d6b2e0b444ebeac57c91e6631528645fa19ac2a281b8 |
|
MD5 | a5bbdb108b0fc58a6f7effcc27c51285 |
|
BLAKE2b-256 | 57d99eae7bc4ba3a38ab7426522fb08e12df54aec27595d7bcd1bc0670aec873 |
booleanOperations-0.9.0-py3-none-any.whl的哈希
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 86c291c2fba9faedff6f007c932d7f242dd9b4304e9c6ca8149f864d07877a59 |
|
MD5 | fb70caeb3a1a0fe29ed20b4362d0a283 |
|
BLAKE2b-256 | fcc6c4cae54f482465a33c5f011d95ec64293dce9e012dac7873147c2dc85396 |