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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6756 - (hide annotations)
Thu Nov 29 07:23:43 2018 UTC (18 months ago) by aellery
File MIME type: text/x-python
File size: 1922 byte(s)
Temporarily undoing last commit.
1 jfenwick 4853 from __future__ import division
2 jfenwick 3981 ##############################################################################
3 gross 2717 #
4 jfenwick 6651 # Copyright (c) 2003-2018 by The University of Queensland
5 jfenwick 3981 # http://www.uq.edu.au
6 gross 2717 #
7     # 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 gross 2717 #
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 jfenwick 3981 #
15     ##############################################################################
16 gross 2717
17 jfenwick 6651 __copyright__="""Copyright (c) 2003-2018 by The University of Queensland
18 jfenwick 3981 http://www.uq.edu.au
19 gross 2717 Primary Business: Queensland, Australia"""
20 jfenwick 6112 __license__="""Licensed under the Apache License, version 2.0
21     http://www.apache.org/licenses/LICENSE-2.0"""
22 gross 2717 __url__="https://launchpad.net/escript-finley"
23    
24     from esys.escript import *
25     from esys.pycad import *
26     from esys.pycad.gmsh import Design
27    
28    
29     p0=Point(0.,0.,0.)
30     p1=Point(1.,0.,0.)
31     p2=Point(0.,1.,0.)
32     p3=Point(1.,1.,0.)
33     p4=Point(0.,0.,1.)
34     p5=Point(1.,0.,1.)
35     p6=Point(0.,1.,1.)
36     p7=Point(1.,1.,1.)
37    
38     l01=Line(p0,p1)
39     l13=Line(p1,p3)
40     l32=Line(p3,p2)
41     l20=Line(p2,p0)
42    
43     l45=Line(p4,p5)
44     l57=Line(p5,p7)
45     l76=Line(p7,p6)
46     l64=Line(p6,p4)
47    
48     l15=Line(p1,p5)
49     l40=Line(p4,p0)
50     l37=Line(p3,p7)
51     l62=Line(p6,p2)
52    
53     bottom=PlaneSurface(CurveLoop(l01,l13,l32,l20))
54     top=PlaneSurface(CurveLoop(l45,l57,l76,l64))
55     front=PlaneSurface(CurveLoop(l01,l15,-l45,l40))
56     back=PlaneSurface(CurveLoop(l32,-l62,-l76,-l37))
57     left=PlaneSurface(CurveLoop(-l40,-l64,l62,l20))
58     right=PlaneSurface(CurveLoop(-l15,l13,l37,-l57))
59     v=Volume(SurfaceLoop(top,-bottom,front,back,left,right))
60    
61     des=Design(dim=3, order=2, element_size = 0.1, keep_files=True)
62     des.setScriptFileName("brick.geo")
63     des.addItems(v, top, bottom, back, front, left , right)
64    
65     des.setFileFormat(des.STL)
66     des.setMeshFileName("brick.stl")
67     des.generate()

  ViewVC Help
Powered by ViewVC 1.1.26