From 25e0432b8011f4ee4e2cff076557e243afe3621d Mon Sep 17 00:00:00 2001 From: Lu Lu Date: Fri, 14 Jun 2019 11:57:19 -0400 Subject: [PATCH] Bug fix: support of Python 2 --- deepxde/geometry/geometry.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/deepxde/geometry/geometry.py b/deepxde/geometry/geometry.py index 554637ea9..c224f1e77 100644 --- a/deepxde/geometry/geometry.py +++ b/deepxde/geometry/geometry.py @@ -6,8 +6,6 @@ import numpy as np -from . import csg - class Geometry(object): def __init__(self, dim, bbox, diam): @@ -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)