1 |
# |
2 |
# $Id$ |
3 |
# |
4 |
####################################################### |
5 |
# |
6 |
# Copyright 2003-2007 by ACceSS MNRF |
7 |
# Copyright 2007 by University of Queensland |
8 |
# |
9 |
# http://esscc.uq.edu.au |
10 |
# Primary Business: Queensland, Australia |
11 |
# Licensed under the Open Software License version 3.0 |
12 |
# http://www.opensource.org/licenses/osl-3.0.php |
13 |
# |
14 |
####################################################### |
15 |
# |
16 |
|
17 |
""" |
18 |
some basic shapes. |
19 |
|
20 |
@var __author__: name of author |
21 |
@var __copyright__: copyrights |
22 |
@var __license__: licence agreement |
23 |
@var __url__: url entry point on documentation |
24 |
@var __version__: version |
25 |
@var __date__: date of the version |
26 |
""" |
27 |
|
28 |
|
29 |
__author__="Lutz Gross, l.gross@uq.edu.au" |
30 |
__copyright__=""" Copyright (c) 2006 by ACcESS MNRF |
31 |
http://www.access.edu.au |
32 |
Primary Business: Queensland, Australia""" |
33 |
__license__="""Licensed under the Open Software License version 3.0 |
34 |
http://www.opensource.org/licenses/osl-3.0.php""" |
35 |
__url__="http://www.iservo.edu.au/esys/escript" |
36 |
__version__="$Revision:$" |
37 |
__date__="$Date:$" |
38 |
|
39 |
from primitives import * |
40 |
|
41 |
def Brick(start,end): |
42 |
""" |
43 |
create brick with start and end point. |
44 |
""" |
45 |
dx=end.getCoordinates()-start.getCoordinates() |
46 |
p000=start+[ 0.,0.,0.] |
47 |
p100=start+[dx[0],0.,0.] |
48 |
p010=start+[0.,dx[1],0.] |
49 |
p110=start+[dx[0],dx[1],0.] |
50 |
p001=start+[0.,0.,dx[2]] |
51 |
p101=start+[dx[0],0.,dx[2]] |
52 |
p011=start+[0.,dx[1],dx[2]] |
53 |
p111=start+[dx[0],dx[1],dx[2]] |
54 |
l10=Line(p000,p100) |
55 |
l20=Line(p100,p110) |
56 |
l30=Line(p110,p010) |
57 |
l40=Line(p010,p000) |
58 |
l11=Line(p000,p001) |
59 |
l21=Line(p100,p101) |
60 |
l31=Line(p110,p111) |
61 |
l41=Line(p010,p011) |
62 |
l12=Line(p001,p101) |
63 |
l22=Line(p101,p111) |
64 |
l32=Line(p111,p011) |
65 |
l42=Line(p011,p001) |
66 |
bottom=PlaneSurface(CurveLoop(-l10,-l40,-l30,-l20)) |
67 |
top=PlaneSurface(CurveLoop(l12,l22,l32,l42)) |
68 |
front=PlaneSurface(CurveLoop(-l11,l10,l21,-l12)) |
69 |
back=PlaneSurface(CurveLoop(l30,l41,-l32,-l31)) |
70 |
left=PlaneSurface(CurveLoop(l11,-l42,-l41,l40)) |
71 |
right=PlaneSurface(CurveLoop(-l21,l20,l31,-l22)) |
72 |
return SurfaceLoop(bottom,top,front,back,left,right) |