@@ -135,6 +135,11 @@ def __init__(self,
135135 if theta2 <= theta1 :
136136 raise ValueError ('theta2 must be greater than theta1.' )
137137
138+ # Determine whether the angle between theta1 and theta2 is a reflex
139+ # angle, in which case we need to use a union between the planar
140+ # half-spaces
141+ self ._reflex = (theta2 - theta1 > 180.0 )
142+
138143 phi1 = pi / 180 * theta1
139144 phi2 = pi / 180 * theta2
140145
@@ -169,6 +174,9 @@ def __init__(self,
169174 ** kwargs )
170175 self .plane2 = openmc .Plane .from_points (p1 , p2_plane2 , p3_plane2 ,
171176 ** kwargs )
177+ if axis == 'y' :
178+ self .plane1 .flip_normal ()
179+ self .plane2 .flip_normal ()
172180
173181 @classmethod
174182 def from_theta_alpha (cls ,
@@ -223,17 +231,11 @@ def from_theta_alpha(cls,
223231 return cls (r1 , r2 , theta1 , theta2 , center = center , axis = axis , ** kwargs )
224232
225233 def __neg__ (self ):
226- if isinstance ( self .inner_cyl , openmc . YCylinder ) :
227- return - self .outer_cyl & + self .inner_cyl & + self .plane1 & - self .plane2
234+ if self ._reflex :
235+ return - self .outer_cyl & + self .inner_cyl & ( - self .plane1 | + self .plane2 )
228236 else :
229237 return - self .outer_cyl & + self .inner_cyl & - self .plane1 & + self .plane2
230238
231- def __pos__ (self ):
232- if isinstance (self .inner_cyl , openmc .YCylinder ):
233- return + self .outer_cyl | - self .inner_cyl | - self .plane1 | + self .plane2
234- else :
235- return + self .outer_cyl | - self .inner_cyl | + self .plane1 | - self .plane2
236-
237239
238240class IsogonalOctagon (CompositeSurface ):
239241 r"""Infinite isogonal octagon composite surface
0 commit comments