def closed_edge_hatch(request): _hatch = Hatch.new() _path = _hatch.paths.add_edge_path() if request.param == 'arc': _path.add_arc((0, 0), radius=1, start_angle=0, end_angle=360, ccw=1) elif request.param == 'ellipse': _path.add_ellipse((0, 0), major_axis=(5, 0), ratio=0.2, start_angle=0, end_angle=360) return _hatch
def test_default_new(): entity = Hatch.new( handle="ABBA", owner="0", dxfattribs={ "color": 7, }, ) assert entity.dxf.layer == "0" assert entity.dxf.color == 7
def hatch(): return Hatch.new()
def test_default_new(): entity = Hatch.new(handle='ABBA', owner='0', dxfattribs={ 'color': 7, }) assert entity.dxf.layer == '0' assert entity.dxf.color == 7
def test_full_circle_edge_scaling(): _hatch = Hatch.new() _path = _hatch.paths.add_edge_path() _arc = _path.add_arc((0, 0), radius=1, start_angle=0, end_angle=360, ccw=1) _hatch.transform(Matrix44.scale(0.5, 0.5, 0.5)) assert _arc.radius == pytest.approx(0.5)