File: test_244_large_radial_dimension.py

package info (click to toggle)
ezdxf 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,528 kB
  • sloc: python: 182,341; makefile: 116; lisp: 20; ansic: 4
file content (110 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Copyright (c) 2020, Manfred Moitzi
# License: MIT License

import pytest

import ezdxf
from ezdxf.entities.dimension import RadialDimensionLarge
from ezdxf.lldxf.const import DXF2010
from ezdxf.lldxf.tagwriter import TagCollector

ezdxf.options.preserve_proxy_graphics()


@pytest.fixture()
def dim():
    return RadialDimensionLarge.from_text(LARGE_RADIAL_DIM)


def test_load_dimension(dim):
    assert dim.dxf.defpoint == (46, 54, 0)
    assert dim.dxf.chord_point == (46, 54, 0)
    assert dim.dxf.override_center == (47, 53, 0)
    assert dim.dxf.jog_point == (49, 52, 0)
    assert dim.dxf.unknown2 == 0.0


def test_export_dimension(dim):
    tagwriter = TagCollector(dxfversion=DXF2010)
    dim.export_dxf(tagwriter)
    assert (10, 46) in tagwriter.tags
    assert (13, 46) in tagwriter.tags
    assert (14, 47) in tagwriter.tags
    assert (15, 49) in tagwriter.tags
    assert (40, 0.0) in tagwriter.tags


LARGE_RADIAL_DIM = """  0
LARGE_RADIAL_DIMENSION
5
37C
102
{ACAD_REACTORS
330
393
102
}
330
1F
100
AcDbEntity
8
0
100
AcDbDimension
280
0
2
*D15
10
46.0
20
54.0
30
0.0
11
48.0
21
53.0
31
0.0
70
169
71
5
42
3.089400503595107
73
0
74
0
75
0
3
Standard
100
AcDbRadialDimensionLarge
13
46.0
23
54.0
33
0.0
14
47.0
24
53.0
34
0.0
15
49.0
25
52.0
35
0.0
40
0.0
"""

if __name__ == "__main__":
    pytest.main([__file__])