Skip to content

Commit

Permalink
Bug fix: support of Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
lululxvi committed Jun 14, 2019
1 parent 2ffba09 commit 25e0432
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deepxde/geometry/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import numpy as np

from . import csg


class Geometry(object):
def __init__(self, dim, bbox, diam):
Expand Down Expand Up @@ -86,24 +84,36 @@ def background_points(self, x, dirn, dist2npt, shift):

def union(self, other):
"""CSG Union."""
from . import csg

return csg.CSGUnion(self, other)

def __or__(self, other):
"""CSG Union."""
from . import csg

return csg.CSGUnion(self, other)

def difference(self, other):
"""CSG Difference."""
from . import csg

return csg.CSGDifference(self, other)

def __sub__(self, other):
"""CSG Difference."""
from . import csg

return csg.CSGDifference(self, other)

def intersection(self, other):
"""CSG Intersection."""
from . import csg

return csg.CSGIntersection(self, other)

def __and__(self, other):
"""CSG Intersection."""
from . import csg

return csg.CSGIntersection(self, other)

0 comments on commit 25e0432

Please sign in to comment.