Changeset 3492
- Timestamp:
- Aug 15, 2006, 4:20:46 PM (18 years ago)
- Location:
- inundation/pmesh
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/pmesh/AppShell.py
r349 r3492 7 7 created by Doug Hellmann (doughellmann@mindspring.com). 8 8 9 Pmw copyright 10 11 Copyright 1997-1999 Telstra Corporation Limited, 12 Australia Copyright 2000-2002 Really Good Software Pty Ltd, Australia 13 14 Permission is hereby granted, free of charge, to any person obtaining 15 a copy of this software and associated documentation files (the 16 "Software"), to deal in the Software without restriction, including 17 without limitation the rights to use, copy, modify, merge, publish, 18 distribute, sublicense, and/or sell copies of the Software, and to 19 permit persons to whom the Software is furnished to do so, subject to 20 the following conditions: 21 22 The above copyright notice and this permission notice shall be 23 included in all copies or substantial portions of the Software. 24 25 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 26 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 27 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 28 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 29 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 30 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 31 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 32 9 33 """ 34 10 35 11 36 from Tkinter import * -
inundation/pmesh/README
r1926 r3492 1 1 SYSTEM REQUIREMENTS 2 Pmesh requires many bits adn peices from the rest of the ANUGA code. 2 3 3 Python, with Pmw must be installed to use pmesh. Read the 4 starting.html file that comes with pmw with regrads to how it is 5 installed.(quick install advice: install pmw in the 6 python2.2/site-packages dir) (Python and pmw are in the downloads 7 directory) 4 It's system requirements are the same as ANUGA 8 5 9 The inundation directory utilities is also needed to run pmesh. 6 INSTALLATION COMMANDS 7 To compile, do 8 scones 10 9 11 INSTALLATION COMMANDS, FOR LINUX12 13 This is necessary to complite triangle for using pmesh graphically and14 the pmesh.mesh script.15 16 To build triangle, as root;17 python setup.py install18 19 To build the python package, as a user;20 python setup.py install --prefix=~21 22 This will create a python directory, off the users home directory.23 Add the path of this directory into your .bashrc24 for example;25 export PYTHONPATH=$HOME/lib/python2.2/site-packages:"${PYTHONPATH}"26 another example;27 export PYTHONPATH=$HOME/lib64/python2.3/site-packages:"${PYTHONPATH}"28 29 INSTALLATION COMMANDS, FOR WINDOWS30 To compile using Microsoft Visual c++,31 python setup.py install32 33 To compile using mingw,34 python setup.py build -cmingw3235 python setup.py install36 37 Note for this to work mingw has to be installed. Plus move38 the file libpython23.a into the python\libs directory. If39 'install' does not work move the triang.pyd file manually.40 10 41 11 GENERAL RUNNING 42 To run all t ests Harnesses;43 python TestRunner.py12 To run all the unit tests; 13 python test_all.py 44 14 45 15 To run pmesh; 46 python pmesh.py16 python graphical_mesh_generator.py 47 17 48 18 INSTRUCTIONS FOR USING PMESH … … 62 32 63 33 CREATING A PMESH EXECUTABLE 34 Note, this has not been tried for about 2 years. 64 35 65 36 There is a package called py2exe which can take a Python script and -
inundation/pmesh/graphical_mesh_generator.py
r3437 r3492 206 206 ('default', self.windowDefault, 'set default value for selected mode'), 207 207 ('joinVer', self.joinVerticesButton, 'add Segments to connect all vertices'), 208 # ('autoSegHull', self.auto_segmentHullButton, 'add Segments to form alpha shape, using Hull'),209 208 # ('autoSeg', self.auto_segmentButton, 'add Segments to form alpha shape'), 210 209 ('autoSegGiveAlpha', self.auto_segmentGiveAlphaButton, 'add Segments to form alpha shape, specify alpha'), -
inundation/pmesh/mesh.py
r3437 r3492 1528 1528 fd.close() 1529 1529 1530 def auto_segmentHull(self):1531 """1532 initially work by running an executable1533 Later compile the c code with a python wrapper.1534 1535 Precon: There must be 3 or more vertices in the userVertices structure1536 """1537 newsegs = []1538 inputfile = 'hull_in.txt'1539 outputfile = inputfile + '-alf'1540 #write vertices to file1541 fd = open(inputfile,'w')1542 for v in self.userVertices:1543 fd.write(str(v.x))1544 fd.write(' ')1545 fd.write(str(v.y))1546 fd.write('\n')1547 fd.close()1548 1549 #run hull executable1550 #warning need to compile hull for the current operating system1551 command = 'hull.exe -A -i ' + inputfile1552 os.system(command)1553 1554 #read results into this object1555 fd = open(outputfile)1556 lines = fd.readlines()1557 fd.close()1558 #print "(*(*(*("1559 #print lines1560 #print "(*(*(*("1561 lines.pop(0) #remove the first (title) line1562 for line in lines:1563 vertindexs = line.split()1564 #print 'int(vertindexs[0])', int(vertindexs[0])1565 #print 'int(vertindexs[1])', int(vertindexs[1])1566 #print 'self.userVertices[int(vertindexs[0])]' ,self.userVertices[int(vertindexs[0])]1567 #print 'self.userVertices[int(vertindexs[1])]' ,self.userVertices[int(vertindexs[1])]1568 v1 = self.userVertices[int(vertindexs[0])]1569 v2 = self.userVertices[int(vertindexs[1])]1570 1571 if self.isUserSegmentNew(v1,v2):1572 newseg = Segment(v1, v2)1573 newsegs.append(newseg)1574 #DSG!!!1575 self.userSegments.extend(newsegs)1576 return newsegs1577 1530 def auto_segmentFilter(self,raw_boundary=True, 1578 1531 remove_holes=False,
Note: See TracChangeset
for help on using the changeset viewer.