【发布时间】:2015-11-17 21:23:02
【问题描述】:
我正在尝试使用Clipper Python bindings 使用多边形来剪裁一条线。但是进程在绑定或裁剪器库中崩溃:
import pyclipper
pc = pyclipper.Pyclipper()
# Add a single line as the subject.
pc.AddPath([(-1, -1), (2, 1)], pyclipper.PT_SUBJECT, False)
# Add a square as the clipping region.
pc.AddPath([(0, 0), (1, 0), (1, 1), (0, 1)], pyclipper.PT_CLIP, True)
# Clip the line using the rectangle.
solution = pc.Execute(pyclipper.CT_INTERSECTION, pyclipper.PFT_NONZERO, pyclipper.PFT_NONZERO)
print(solution)
当我运行上述代码时,进程在调用pc.Execute() 期间终止,并将以下消息写入标准错误:
libc++abi.dylib: terminate called throwing an exception
我在 OS X 10.8.5 上使用 Python 3.4.3 以及 PyPI 上可用的最新版本 pyclipper (0.9.3b0),它使用 Clipper 6.2.1。
我做错了什么还是这是 Clipper 或 pyclipper 中的错误?
【问题讨论】:
标签: python clipperlib