本文整理汇总了Python中PathScripts.PathGeom.PathGeom.wiresForPath方法的典型用法代码示例。如果您正苦于以下问题:Python PathGeom.wiresForPath方法的具体用法?Python PathGeom.wiresForPath怎么用?Python PathGeom.wiresForPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathScripts.PathGeom.PathGeom
的用法示例。
在下文中一共展示了PathGeom.wiresForPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test50
# 需要导入模块: from PathScripts.PathGeom import PathGeom [as 别名]
# 或者: from PathScripts.PathGeom.PathGeom import wiresForPath [as 别名]
def test50(self):
"""Verify proper wire(s) aggregation from a Path."""
commands = []
commands.append(Path.Command('G1', {'X': 1}))
commands.append(Path.Command('G1', {'Y': 1}))
commands.append(Path.Command('G0', {'X': 0}))
commands.append(Path.Command('G1', {'Y': 0}))
wire = PathGeom.wireForPath(Path.Path(commands))
self.assertEqual(len(wire.Edges), 4)
self.assertLine(wire.Edges[0], Vector(0,0,0), Vector(1,0,0))
self.assertLine(wire.Edges[1], Vector(1,0,0), Vector(1,1,0))
self.assertLine(wire.Edges[2], Vector(1,1,0), Vector(0,1,0))
self.assertLine(wire.Edges[3], Vector(0,1,0), Vector(0,0,0))
wires = PathGeom.wiresForPath(Path.Path(commands))
self.assertEqual(len(wires), 2)
self.assertEqual(len(wires[0].Edges), 2)
self.assertLine(wires[0].Edges[0], Vector(0,0,0), Vector(1,0,0))
self.assertLine(wires[0].Edges[1], Vector(1,0,0), Vector(1,1,0))
self.assertEqual(len(wires[1].Edges), 1)
self.assertLine(wires[1].Edges[0], Vector(0,1,0), Vector(0,0,0))