Exemplo n.º 1
0
def test_2d_polyline_has_default_width():
    assert Polyline().has_width is False
    assert (Polyline.new(dxfattribs={
        "default_start_width": 0.1
    }).has_width is True)
    assert Polyline.new(dxfattribs={
        "default_end_width": 0.1
    }).has_width is True
Exemplo n.º 2
0
def test_polyline2d_transform_interface():
    pline = Polyline()
    pline.append_vertices([(0, 0, 0), (2, 0, 0), (1, 1, 0)])
    pline.translate(1, 1, 1)
    vertices = list(v.dxf.location for v in pline.vertices)
    assert pline.is_2d_polyline is True
    assert vertices[0] == (1, 1, 1)
    assert vertices[1] == (3, 1, 1)
    assert vertices[2] == (2, 2, 1)
    assert pline.dxf.elevation == (0, 0, 1)
    assert Vec3(0, 0, 1).isclose(pline.dxf.extrusion)
Exemplo n.º 3
0
def test_default_constructor():
    entity = Polyline()
    assert entity.dxftype() == "POLYLINE"
    assert entity.is_virtual is True
    assert entity.seqend is None, "SEQEND must not exist"
Exemplo n.º 4
0
def test_2d_polyline_has_any_arc():
    pline = Polyline()
    assert pline.has_arc is False
    pline.append_formatted_vertices([(0, 0, 1.0)], format="xyb")
    assert pline.has_arc is True
Exemplo n.º 5
0
def test_2d_polyline_has_any_end_width():
    pline = Polyline()
    pline.append_formatted_vertices([(0, 0, 0.1)], format="xye")
    assert pline.has_width is True
Exemplo n.º 6
0
def test_2d_polyline_has_any_start_width():
    pline = Polyline()
    pline.append_formatted_vertices([(0, 0, .1)], format='xys')
    assert pline.has_width is True