-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest.py
More file actions
63 lines (53 loc) · 1.5 KB
/
test.py
File metadata and controls
63 lines (53 loc) · 1.5 KB
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
import geom
# two triangles
#a1 = geom.Area()
#c = geom.Curve()
#c.Append(geom.Point(0,0))
#c.Append(geom.Point(10,0))
#c.Append(geom.Point(5,10))
#c.Append(geom.Point(0,0))
#a1.Append(c)
#a2 = geom.Area()
#c = geom.Curve()
#c.Append(geom.Point(5,5))
#c.Append(geom.Point(10,15))
#c.Append(geom.Point(0,15))
#c.Append(geom.Point(5,5))
#a2.Append(c)
#a1.Union(a2)
#a3 = geom.Area()
#c = geom.Curve()
#c.Append(geom.Point(0, 0))
#c.Append(geom.Point(10, 0))
#c.Append(geom.Point(6.25, 7.5))
#c.Append(geom.Point(10, 15))
#c.Append(geom.Point(0, 15))
#c.Append(geom.Point(3.75, 7.5))
#c.Append(geom.Point(0, 0))
#a3.Append(c)
#print(str(a1) == str(a3))
# two doughnuts
a1 = geom.Area()
c = geom.Curve()
c.Append(geom.Point(0, -14))
c.Append(geom.Vertex(1, geom.Point(0,14), geom.Point(0,0)))
c.Append(geom.Vertex(1, geom.Point(0,-14), geom.Point(0,0)))
a1.Append(c)
c = geom.Curve()
c.Append(geom.Point(0, -10))
c.Append(geom.Vertex(-1, geom.Point(0,10), geom.Point(0,0)))
c.Append(geom.Vertex(-1, geom.Point(0,-10), geom.Point(0,0)))
a1.Append(c)
a2 = geom.Area()
c = geom.Curve()
c.Append(geom.Point(10, -14))
c.Append(geom.Vertex(1, geom.Point(10,14), geom.Point(10,0)))
c.Append(geom.Vertex(1, geom.Point(10,-14), geom.Point(10,0)))
a2.Append(c)
c = geom.Curve()
c.Append(geom.Point(10, -10))
c.Append(geom.Vertex(-1, geom.Point(10,10), geom.Point(10,0)))
c.Append(geom.Vertex(-1, geom.Point(10,-10), geom.Point(10,0)))
a2.Append(c)
a1.Union(a2)
print(str(a1))