@@ -48,7 +48,6 @@ public void CreateHatch()
48
48
} ;
49
49
edges . Add ( edge4 ) ;
50
50
51
-
52
51
Hatch . BoundaryPath path = new Hatch . BoundaryPath ( ) ;
53
52
foreach ( var item in edges )
54
53
{
@@ -85,7 +84,7 @@ public void CreatePolylineHatch()
85
84
}
86
85
87
86
[ Fact ]
88
- public void PolylineHatchNotAllowMoreEdges ( )
87
+ public void ExplodeTest ( )
89
88
{
90
89
Hatch hatch = new Hatch ( ) ;
91
90
hatch . IsSolid = true ;
@@ -100,18 +99,12 @@ public void PolylineHatchNotAllowMoreEdges()
100
99
pline . Vertices . Add ( new XYZ ( 0 , 0 , 0 ) ) ;
101
100
102
101
path . Edges . Add ( pline ) ;
102
+ path . Flags = path . Flags . AddFlag ( BoundaryPathFlags . Polyline ) ;
103
+ hatch . Paths . Add ( path ) ;
103
104
104
- Assert . Throws < InvalidOperationException > ( ( ) =>
105
- {
106
- path . Edges . Add ( new Hatch . BoundaryPath . Line ( ) ) ;
107
- }
108
- ) ;
105
+ var entities = hatch . Explode ( ) ;
109
106
110
- Assert . Throws < InvalidOperationException > ( ( ) =>
111
- {
112
- path . Edges . Add ( new Hatch . BoundaryPath . Polyline ( ) ) ;
113
- }
114
- ) ;
107
+ Assert . NotEmpty ( entities ) ;
115
108
}
116
109
117
110
[ Fact ]
@@ -138,5 +131,35 @@ public void GetBoundingBoxTest()
138
131
Assert . Equal ( new XYZ ( 0 , 0 , 0 ) , box . Min ) ;
139
132
Assert . Equal ( new XYZ ( 1 , 1 , 0 ) , box . Max ) ;
140
133
}
134
+
135
+ [ Fact ]
136
+ public void PolylineHatchNotAllowMoreEdges ( )
137
+ {
138
+ Hatch hatch = new Hatch ( ) ;
139
+ hatch . IsSolid = true ;
140
+
141
+ Hatch . BoundaryPath path = new Hatch . BoundaryPath ( ) ;
142
+
143
+ Hatch . BoundaryPath . Polyline pline = new Hatch . BoundaryPath . Polyline ( ) ;
144
+ pline . Vertices . Add ( new XYZ ( 0 , 0 , 0 ) ) ;
145
+ pline . Vertices . Add ( new XYZ ( 1 , 0 , 0 ) ) ;
146
+ pline . Vertices . Add ( new XYZ ( 1 , 1 , 0 ) ) ;
147
+ pline . Vertices . Add ( new XYZ ( 0 , 1 , 0 ) ) ;
148
+ pline . Vertices . Add ( new XYZ ( 0 , 0 , 0 ) ) ;
149
+
150
+ path . Edges . Add ( pline ) ;
151
+
152
+ Assert . Throws < InvalidOperationException > ( ( ) =>
153
+ {
154
+ path . Edges . Add ( new Hatch . BoundaryPath . Line ( ) ) ;
155
+ }
156
+ ) ;
157
+
158
+ Assert . Throws < InvalidOperationException > ( ( ) =>
159
+ {
160
+ path . Edges . Add ( new Hatch . BoundaryPath . Polyline ( ) ) ;
161
+ }
162
+ ) ;
163
+ }
141
164
}
142
- }
165
+ }
0 commit comments