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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6939 - (hide annotations)
Mon Jan 20 03:37:18 2020 UTC (6 months, 3 weeks ago) by uqaeller
File MIME type: text/x-python
File size: 2353 byte(s)
Updated the copyright header.


1 ksteube 1809
2 jfenwick 3981 ##############################################################################
3 ksteube 1312 #
4 uqaeller 6939 # Copyright (c) 2003-2020 by The University of Queensland
5 jfenwick 3981 # http://www.uq.edu.au
6 ksteube 1312 #
7 ksteube 1809 # Primary Business: Queensland, Australia
8 jfenwick 6112 # Licensed under the Apache License, version 2.0
9     # http://www.apache.org/licenses/LICENSE-2.0
10 ksteube 1312 #
11 jfenwick 3981 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 jfenwick 4657 # Development 2012-2013 by School of Earth Sciences
13     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 uqaeller 6939 # Development from 2019 by School of Earth and Environmental Sciences
15 jfenwick 3981 #
16     ##############################################################################
17 gross 903
18 sshaw 5706 from __future__ import print_function, division
19    
20 uqaeller 6939 __copyright__="""Copyright (c) 2003-2020 by The University of Queensland
21 jfenwick 3981 http://www.uq.edu.au
22 ksteube 1809 Primary Business: Queensland, Australia"""
23 jfenwick 6112 __license__="""Licensed under the Apache License, version 2.0
24     http://www.apache.org/licenses/LICENSE-2.0"""
25 jfenwick 2344 __url__="https://launchpad.net/escript-finley"
26 ksteube 1809
27 gross 903 """
28     some basic shapes.
29    
30 jfenwick 2625 :var __author__: name of author
31     :var __copyright__: copyrights
32     :var __license__: licence agreement
33     :var __url__: url entry point on documentation
34     :var __version__: version
35     :var __date__: date of the version
36 gross 903 """
37    
38     __author__="Lutz Gross, l.gross@uq.edu.au"
39    
40 jfenwick 3774 from .primitives import *
41 gross 903
42 caltinay 2180 def Brick(start,end):
43 gross 903 """
44 caltinay 2180 Creates a brick with given start and end point.
45     """
46 gross 903 dx=end.getCoordinates()-start.getCoordinates()
47     p000=start+[ 0.,0.,0.]
48     p100=start+[dx[0],0.,0.]
49     p010=start+[0.,dx[1],0.]
50     p110=start+[dx[0],dx[1],0.]
51     p001=start+[0.,0.,dx[2]]
52     p101=start+[dx[0],0.,dx[2]]
53     p011=start+[0.,dx[1],dx[2]]
54     p111=start+[dx[0],dx[1],dx[2]]
55     l10=Line(p000,p100)
56     l20=Line(p100,p110)
57     l30=Line(p110,p010)
58     l40=Line(p010,p000)
59     l11=Line(p000,p001)
60     l21=Line(p100,p101)
61     l31=Line(p110,p111)
62     l41=Line(p010,p011)
63     l12=Line(p001,p101)
64     l22=Line(p101,p111)
65     l32=Line(p111,p011)
66     l42=Line(p011,p001)
67 gross 932 bottom=PlaneSurface(CurveLoop(-l10,-l40,-l30,-l20))
68     top=PlaneSurface(CurveLoop(l12,l22,l32,l42))
69     front=PlaneSurface(CurveLoop(-l11,l10,l21,-l12))
70     back=PlaneSurface(CurveLoop(l30,l41,-l32,-l31))
71     left=PlaneSurface(CurveLoop(l11,-l42,-l41,l40))
72     right=PlaneSurface(CurveLoop(-l21,l20,l31,-l22))
73 gross 903 return SurfaceLoop(bottom,top,front,back,left,right)
74 caltinay 2180

  ViewVC Help
Powered by ViewVC 1.1.26