/[escript]/trunk/doc/examples/usersguide/brick_stl.py
ViewVC logotype

Contents of /trunk/doc/examples/usersguide/brick_stl.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 7 months ago) by jfenwick
File MIME type: text/x-python
File size: 1835 byte(s)
Round 1 of copyright fixes
1
2 ##############################################################################
3 #
4 # Copyright (c) 2003-2013 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development since 2012 by School of Earth Sciences
13 #
14 ##############################################################################
15
16 __copyright__="""Copyright (c) 2003-2013 by University of Queensland
17 http://www.uq.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__="https://launchpad.net/escript-finley"
22
23 from esys.escript import *
24 from esys.pycad import *
25 from esys.pycad.gmsh import Design
26
27
28 p0=Point(0.,0.,0.)
29 p1=Point(1.,0.,0.)
30 p2=Point(0.,1.,0.)
31 p3=Point(1.,1.,0.)
32 p4=Point(0.,0.,1.)
33 p5=Point(1.,0.,1.)
34 p6=Point(0.,1.,1.)
35 p7=Point(1.,1.,1.)
36
37 l01=Line(p0,p1)
38 l13=Line(p1,p3)
39 l32=Line(p3,p2)
40 l20=Line(p2,p0)
41
42 l45=Line(p4,p5)
43 l57=Line(p5,p7)
44 l76=Line(p7,p6)
45 l64=Line(p6,p4)
46
47 l15=Line(p1,p5)
48 l40=Line(p4,p0)
49 l37=Line(p3,p7)
50 l62=Line(p6,p2)
51
52 bottom=PlaneSurface(CurveLoop(l01,l13,l32,l20))
53 top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
54 front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
55 back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
56 left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
57 right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
58 v=Volume(SurfaceLoop(top,-bottom,front,back,left,right))
59
60 des=Design(dim=3, order=2, element_size = 0.1, keep_files=True)
61 des.setScriptFileName("brick.geo")
62 des.addItems(v, top, bottom, back, front, left , right)
63
64 des.setFileFormat(des.STL)
65 des.setMeshFileName("brick.stl")
66 des.generate()

  ViewVC Help
Powered by ViewVC 1.1.26