コード例 #1
0
 def test_to_hatches_with_ocs(self, path1):
     m = Matrix44.x_rotate(math.pi / 4)
     path = path1.transform(m)
     extrusion = m.transform((0, 0, 1))
     hatches = list(to_hatches(path, extrusion=extrusion))
     h0 = hatches[0]
     assert h0.dxf.elevation == (0, 0, 1)
     assert h0.dxf.extrusion.isclose(extrusion)
     polypath0 = h0.paths[0]
     assert polypath0.vertices[0] == (0, 0, 0)  # x, y, bulge
     assert polypath0.vertices[-1] == (0, 0, 0), "should be closed automatically"
コード例 #2
0
 def test_to_edge_path_hatches(self, path):
     hatches = list(to_hatches(path, edge_path=True))
     assert len(hatches) == 1
     h0 = hatches[0]
     assert h0.dxftype() == 'HATCH'
     assert len(h0.paths) == 1
     edge_path = h0.paths[0]
     assert edge_path.PATH_TYPE == 'EdgePath'
     line, spline = edge_path.edges
     assert line.EDGE_TYPE == 'LineEdge'
     assert line.start == (0, 0)
     assert line.end == (4, 0)
     assert spline.EDGE_TYPE == 'SplineEdge'
     assert spline.control_points[0] == (4, 0)
     assert spline.control_points[1] == (3, 1)  # 2D OCS entity
     assert spline.control_points[2] == (1, 1)  # 2D OCS entity
     assert spline.control_points[3] == (0, 0)
コード例 #3
0
ファイル: test_708b_path_tools.py プロジェクト: mhenr18/ezdxf
 def test_to_poly_path_hatches_with_wcs_elevation(self, path1):
     hatches = list(to_hatches(path1, edge_path=False))
     ho = hatches[0]
     assert ho.dxf.elevation == (0, 0, 1)
コード例 #4
0
ファイル: test_708b_path_tools.py プロジェクト: mhenr18/ezdxf
 def test_to_poly_path_hatches(self, path):
     hatches = list(to_hatches(path, edge_path=False))
     assert len(hatches) == 1
     h0 = hatches[0]
     assert h0.dxftype() == 'HATCH'
     assert len(h0.paths) == 1
コード例 #5
0
ファイル: test_708b_path_tools.py プロジェクト: mhenr18/ezdxf
 def test_empty_to_hatches(self):
     assert list(to_hatches([])) == []
コード例 #6
0
 def test_to_hatches_with_wcs_elevation(self, path1):
     hatches = list(to_hatches(path1))
     ho = hatches[0]
     assert ho.dxf.elevation == (0, 0, 1)
コード例 #7
0
 def test_to_hatches(self, path):
     hatches = list(to_hatches(path))
     assert len(hatches) == 1
     h0 = hatches[0]
     assert h0.dxftype() == 'HATCH'
     assert len(h0.paths) == 1