x) |
x is an (ntri,3,3) array of coordinates.
Returns a tuple of areas,normals. The normal vectors are normalized. The area is always positive.
stlname,outname=None,options='-d') |
If outname is given, it is either '.off' or '.gts' or a filename ending on one of these extensions. If it is only an extension, the stlname will be used with extension changed.
If the outname file exists and its mtime is more recent than the stlname, the outname file is considered uptodate and the conversion programwill not be run.
The conversion program will be choosen depending on the extension. This uses the external commands 'admesh' or 'stl2gts'.
The return value is a tuple of the output file name, the conversion program exit code (0 if succesful) and the stdout of the conversion program (or a 'file is already uptodate' message).
fn) |
Return a coords,edges,faces tuple.
fn) |
The mesh should consist of only triangles! Returns a nodes,elems tuple.
fn,intermediate=None) |
This is done by first coverting the .stl to .gts or .off format. The name of the intermediate file may be specified. If not, it will be generated by changing the extension of fn to '.gts' or '.off' depending on the setting of the 'surface/stlread' config setting.
Return a coords,edges,faces or a coords,elems tuple, depending on the intermediate format.
fn) |
The .neu file nodes are numbered from 1! Returns a nodes,elems tuple.
fn,nodes,edges,faces) |
f,x) |
f,x) |
fn,nodes,elems) |
fn,nodes,elems) |
fn,nodes,elems) |
x,pt=None) |
For each element of Formex, return the volume of the tetrahedron formed by the point pt (default the center of x) and the 3 points of the element.
coords,elems) |
coords is a set of coordinates. elems is an (nsegments,2) shaped connectivity array defining a set of line segments forming a closed loop.
The return value is coords,elems tuple where coords has one more point: the center of th original coords elems is (nsegment,3) and defines triangles describing a surface inside the original curve.
coords,elems) |
Coords is a (npoints,3) shaped array of floats. Elems is a (nelems,2) shaped array of integers representing the border element numbers and must be ordered.
coords,elems) |
The triangle is created from the two border elements with the sharpest angle. Coords is a (npoints,3) shaped array of floats. Elems is a (nelems,2) shaped array of integers representing the border element numbers and must be ordered. A list of two objects is returned: the new border elements and the triangle.
cnt,line) |
area,norm) |
A face is degenerate if its surface is less or equal to zero or the normal has a nan.
fn,dtype=Float,large=False,guess=True) |
If the .stl is large, read_ascii_large() is recommended, as it is a lot faster.
fn,dtype=Float) |
This is an alternative for read_ascii, which is a lot faster on large STL models. It requires the 'awk' command though, so is probably only useful on Linux/UNIX. It works by first transforming the input file to a .nodes file and then reading it through numpy's fromfile() function.
fn) |
mat,row,nmatch=None) |
nodes,coords) |
nodes is a (nnodes,3) float array of coordinates. coords is a (npts,3) float array of coordinates.
Returns a (n,) integer array with ALL the node numbers matching EXACTLY ALL the coordinates of ANY of the given points.
nodes,coords) |
nodes is a (nnodes,3) float array of coordinates. coords is a (npts,3) float array of coordinates.
Returns a (n,) integer array with THE FIRST node number matching EXACTLY ALL the coordinates of EACH of the given points.
elems,triangles) |
elems is a (nelems,3) integer array of triangles. triangles is a (ntri,3) integer array of triangles to find.
Returns a (ntri,) integer array with the triangles numbers.
elems,remove) |
elems is a (nelems,3) integer array of triangles. remove is a (nremove,3) integer array of triangles to remove.
Returns a (nelems-nremove,3) integer array with the triangles of nelems where the triangles of remove have been removed.
nx,ny) |
) |
level=4,verbose=False,filename=None) |
If a filename is given, it is stored under that name, else a temporary file is created. Beware: this may take a lot of time if level is 8 or higher.