/[escript]/trunk/pycad/py_src/shapes.py
ViewVC logotype

Contents of /trunk/pycad/py_src/shapes.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 932 - (show annotations)
Fri Jan 19 09:27:15 2007 UTC (12 years, 7 months ago) by gross
File MIME type: text/x-python
File size: 1738 byte(s)
Design added. The loops tests are switched off to allow faults.
1 # $Id:$
2
3 """
4 some basic shapes.
5
6 @var __author__: name of author
7 @var __copyright__: copyrights
8 @var __license__: licence agreement
9 @var __url__: url entry point on documentation
10 @var __version__: version
11 @var __date__: date of the version
12 """
13
14
15 __author__="Lutz Gross, l.gross@uq.edu.au"
16 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
17 http://www.access.edu.au
18 Primary Business: Queensland, Australia"""
19 __license__="""Licensed under the Open Software License version 3.0
20 http://www.opensource.org/licenses/osl-3.0.php"""
21 __url__="http://www.iservo.edu.au/esys/escript"
22 __version__="$Revision:$"
23 __date__="$Date:$"
24
25 from primitives import *
26
27 def Brick(start,end):
28 """
29 create brick with start and end point.
30 """
31 dx=end.getCoordinates()-start.getCoordinates()
32 p000=start+[ 0.,0.,0.]
33 p100=start+[dx[0],0.,0.]
34 p010=start+[0.,dx[1],0.]
35 p110=start+[dx[0],dx[1],0.]
36 p001=start+[0.,0.,dx[2]]
37 p101=start+[dx[0],0.,dx[2]]
38 p011=start+[0.,dx[1],dx[2]]
39 p111=start+[dx[0],dx[1],dx[2]]
40 l10=Line(p000,p100)
41 l20=Line(p100,p110)
42 l30=Line(p110,p010)
43 l40=Line(p010,p000)
44 l11=Line(p000,p001)
45 l21=Line(p100,p101)
46 l31=Line(p110,p111)
47 l41=Line(p010,p011)
48 l12=Line(p001,p101)
49 l22=Line(p101,p111)
50 l32=Line(p111,p011)
51 l42=Line(p011,p001)
52 bottom=PlaneSurface(CurveLoop(-l10,-l40,-l30,-l20))
53 top=PlaneSurface(CurveLoop(l12,l22,l32,l42))
54 front=PlaneSurface(CurveLoop(-l11,l10,l21,-l12))
55 back=PlaneSurface(CurveLoop(l30,l41,-l32,-l31))
56 left=PlaneSurface(CurveLoop(l11,-l42,-l41,l40))
57 right=PlaneSurface(CurveLoop(-l21,l20,l31,-l22))
58 return SurfaceLoop(bottom,top,front,back,left,right)

  ViewVC Help
Powered by ViewVC 1.1.26