Header to include: imesh.h
Imesh *imodMeshesNew(int size)
int imodMeshGetIndex(Imesh *mesh, int index)
int imodMeshGetMaxIndex(Imesh *mesh)
int imodMeshGetMaxVert(Imesh *mesh)
Ipoint *imodMeshGetVert(Imesh *mesh, int index)
Ipoint *imodMeshGetVerts(Imesh *mesh)
int imodMeshCopy(Imesh *from, Imesh *to)
Imesh *imodMeshDup(Imesh *mesh)
int imodMeshDelete(Imesh *mesh)
int imodMeshesDelete(Imesh *mesh, int size)
int imodMeshAddIndex(Imesh *mesh, int index)
void imodMeshDeleteIndex(Imesh *mesh, int index)
int imodMeshAddVert(Imesh *mesh, Ipoint *vert)
int imodMeshNearestRes(Imesh *mesh, int size, int inres, int *outres)
int imodMeshPolyNormFactors(int startCode, int *listInc, int *vertBase, int *normAdd)
Imesh *imodel_mesh_add(Imesh *nmesh, Imesh *mray, int *size)
void imodMeshInterpCont(int *listp, Ipoint *vertp, int ntriang, int firstv, int listInc, int zadd, Icont *cont)
Imesh *imeshSortSurfaces(Imesh *mesh, int *newSize, int *error)
float imeshVolume(Imesh *mesh, Ipoint *scale, Ipoint *center)
float imeshSurfaceArea(Imesh *mesh, Ipoint *scale)
int imodMeshGetBBox(Imesh *mesh, Ipoint *ll, Ipoint *ur)
void imeshParamsDefault(MeshParams *params)
MeshParams *imeshParamsDup(MeshParams *params)
void imeshParamsDelete(MeshParams *params)
int imeshCopySkipList(int *lfrom, int nfrom, int **lto, int *nto)
Creates a new mesh structure and sets its properties to the default, or returns NULL for an allocation error.
Creates an array of size mesh structures and sets their properties to the default, or returns NULL for an error.
Returns the value at index in the index list of mesh, or IMOD_MESH_END if mesh is NULL or index is out of range.
Returns the size of the index list in mesh, or 0 if mesh is NULL.
Returns the size of the vertex list in mesh, or 0 if mesh is NULL.
Returns the point at index in the vertex list of mesh, or NULL if mesh is NULL or index is out of range.
Returns the vertex array in mesh, or NULL if there is none.
copies a mesh structure from mesh from to mesh to. Returns -1 for error.
Returns a duplicate of mesh, including all data, or NULL for error.
Frees mesh, including all data that it contains. Returns -1 if mesh is NULL.
Frees the array of size meshes in mesh, including all data that it contains. Returns -1 if mesh is NULL.
Adds index to the end of the index list of mesh, allocating one more element for the index array. Returns -1 for allocation error.
Deletes the item at index from the index lis of mesh
Adds vert to the end of the vertex array of mesh, allocating one more element for the array. Returns -1 for allocation error.
Finds the nearest resolution to inres available in the array of meshes of size size in mesh. Returns the resolution in outres. If there are two equally distance resolutions (one below, one above), it returns the resolution that is above inres. The return value is 0 if only one resolution exists, 1 if more than one resolution exists, and -1 for error.
Returns values for indexing the mesh list for an old or new style POLYNORM
into listInc, vertBase, and normAdd. The return value is 1 if
startCode is IMOD_MESH_BGNPOLYNORM or IMOD_MESH_BGNPOLYNORM2, otherwise it
is 0. If i is the index of the start of a triangle, then:
index of vertex j is mesh->list[i + vertBase + j * listInc]
index of normal j is mesh->list[i + j * listInc] + normAdd
Adds a new mesh in nmesh to the array of meshes in mray. size specifies the current number of meshes in mray and is returned with the new number of meshes. Allocated data are transferred from nmesh to the array but nmesh is not freed. Returns NULL for an error.
Contructs an interpolated contour at a Z plane between two other contours by finding lines in a triangle mesh that cross that Z plane and using the points where the lines cross the plane. listp is the list of mesh indices, vertp is the list of mesh vertices; ntriang is the number of triangles in the polygon; firstv is the index of the first vertex in listp, listInc is the step between successive vertex indices, zadd is the Z value at which to interpolate, and cont is the contour to add points to.
Sorts the input mesh in mesh into unconnected surfaces and returns a new array of meshes, with surface numbers starting at 0 and equal to the index of the mesh in the array. Returns the number of surfaces in newSize and an error code in error equal to 1 for a NULL or empty input mesh, 2 for a memory allocation error, and 3 for an unsupported feature. Only meshes with vertex-normal pairs, polygons starting with IMOD_MESH_BGNBIGPOLY2, and even list indices are supported. The return value is NULL for an error.
Returns the volume enclosed by mesh in cubic pixels. If scale is non-NULL, its z value specifies the Z scaling to apply. If center is non-NULL, it will be taken as the center from which to calculate volumes of tetraheda, in which case the routine will skip calculating the centroid of the mesh. The volume will not be accurate unless the mesh is fully closed.
Returns the surface area of mesh in square pixels. If scale is non-NULL, its z value specifies the Z scaling to apply.
Calculates the full 3D bounding box of vertices in mesh and returns the lower left, bottom coordinates in ll and the upper right, top coordinates in ur. Returns -1 if error.
Allocates and returns a new MeshParams structure after setting it to default values. Returns NULL for error.
Sets params to default values.
Returns a duplicate of the meshing parameters in params, including a cap skip list, if any. Returns NULL for error or if params is NULL.
Frees the params structure and the capSkipZlist array if it is nonnull and capSkipNz is nonzero.
Copies the integer list in lfrom of size nfrom to a new list pointed to by lto, returning the size in nto. Frees an existing list in lto first if lto and nto are non-NULL, then allocates a new list with space for three more values than nfrom. If lfrom is NULL, no new list is allocated. Returns 1 for memory error.