drufat / triangle

Python bindings to the triangle library
GNU Lesser General Public License v3.0
224 stars 53 forks source link

triangle.load triangle.loads #14

Closed normandajc closed 7 years ago

normandajc commented 7 years ago

I want use triangle.load triangle.loads Can you a example to use triangle.load and triangle.loads. Thank you triangle is simple to use. It 's perfect

normandajc commented 7 years ago

to obtain the coordinates of the nodes and the numbers of the nodes of the elements I perform these operations ..... B = triangle.triangulate(A,'a25.') markers = B.get('vertex_markers') nodes = B.get('vertices') elements = B.get('triangles')

tableau des points

print "-------------" print markers print "-------------" print nodes print "-------------" print elements print "-------------"

drufat commented 7 years ago

To load data from a directory, you can just use the triangle.load function. If you have say these data files in a given directory:

A.1.ele
A.1.node
A.1.poly

You can just do triangle.load(directory_name, "A.1"). At the moment triangle only supports loading, and not writing data. Patches are welcome.