/[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 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 9 months ago) by jfenwick
File MIME type: text/x-python
File size: 1773 byte(s)
Don't panic.
Updating copyright stamps

1
2 ########################################################
3 #
4 # Copyright (c) 2003-2010 by University of Queensland
5 # Earth Systems Science Computational Center (ESSCC)
6 # http://www.uq.edu.au/esscc
7 #
8 # Primary Business: Queensland, Australia
9 # Licensed under the Open Software License version 3.0
10 # http://www.opensource.org/licenses/osl-3.0.php
11 #
12 ########################################################
13
14 __copyright__="""Copyright (c) 2003-2010 by University of Queensland
15 Earth Systems Science Computational Center (ESSCC)
16 http://www.uq.edu.au/esscc
17 Primary Business: Queensland, Australia"""
18 __license__="""Licensed under the Open Software License version 3.0
19 http://www.opensource.org/licenses/osl-3.0.php"""
20 __url__="https://launchpad.net/escript-finley"
21
22 from esys.escript import *
23 from esys.pycad import *
24 from esys.pycad.gmsh import Design
25
26
27 p0=Point(0.,0.,0.)
28 p1=Point(1.,0.,0.)
29 p2=Point(0.,1.,0.)
30 p3=Point(1.,1.,0.)
31 p4=Point(0.,0.,1.)
32 p5=Point(1.,0.,1.)
33 p6=Point(0.,1.,1.)
34 p7=Point(1.,1.,1.)
35
36 l01=Line(p0,p1)
37 l13=Line(p1,p3)
38 l32=Line(p3,p2)
39 l20=Line(p2,p0)
40
41 l45=Line(p4,p5)
42 l57=Line(p5,p7)
43 l76=Line(p7,p6)
44 l64=Line(p6,p4)
45
46 l15=Line(p1,p5)
47 l40=Line(p4,p0)
48 l37=Line(p3,p7)
49 l62=Line(p6,p2)
50
51 bottom=PlaneSurface(CurveLoop(l01,l13,l32,l20))
52 top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
53 front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
54 back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
55 left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
56 right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
57 v=Volume(SurfaceLoop(top,-bottom,front,back,left,right))
58
59 des=Design(dim=3, order=2, element_size = 0.1, keep_files=True)
60 des.setScriptFileName("brick.geo")
61 des.addItems(v, top, bottom, back, front, left , right)
62
63 des.setFileFormat(des.STL)
64 des.setMeshFileName("brick.stl")
65 des.generate()

  ViewVC Help
Powered by ViewVC 1.1.26