From 4176c41670270e9c6f189e4ce9c8d3c72a1c14b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Wed, 11 Nov 2015 18:44:05 +0100 Subject: [PATCH] bcs for rectangle --- python/geom2d.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/geom2d.py b/python/geom2d.py index 92c58be8..5211c118 100644 --- a/python/geom2d.py +++ b/python/geom2d.py @@ -21,14 +21,16 @@ for l1,l2,bc in lines: unit_square.Append( ["line", pnums[l1], pnums[l2]], bc=bc) -def MakeRectangle (geo, p1, p2, **args): +def MakeRectangle (geo, p1, p2, bc=None, bcs=None, **args): p1x, p1y = p1 p2x, p2y = p2 p1x,p2x = min(p1x,p2x), max(p1x, p2x) p1y,p2y = min(p1y,p2y), max(p1y, p2y) + if not bcs: bcs=4*[bc] + print ("bcs = ", bcs) pts = [geo.AppendPoint(*p) for p in [(p1x,p1y), (p2x, p1y), (p2x, p2y), (p1x, p2y)]] - for p1,p2 in [(0,1), (1, 2), (2, 3), (3, 0)]: - geo.Append( ["line", pts[p1], pts[p2]], **args) + for p1,p2,bc in [(0,1,bcs[0]), (1, 2, bcs[1]), (2, 3, bcs[2]), (3, 0, bcs[3])]: + geo.Append( ["line", pts[p1], pts[p2]], bc=bc, **args) def MakeCircle (geo, c, r, **args): cx,cy = c