var searchIndex = {}; searchIndex["half_edge_mesh"] = {"doc":"","items":[[0,"ptr","half_edge_mesh","",null,null],[3,"Ptr","half_edge_mesh::ptr","Ptr is essentially a wrapper around Option<Weak<RefCell<T>>>,\na.k.a. a nullable ref-counted pointer with interior mutability\nThis abstraction is used to get around Rust's\nvalidity, borrowing, and ownership rules, especially when constructing or\nextending the half-edge mesh.",null,null],[6,"EdgePtr","","",null,null],[6,"EdgeRc","","",null,null],[6,"VertPtr","","",null,null],[6,"VertRc","","",null,null],[6,"FacePtr","","",null,null],[6,"FaceRc","","",null,null],[11,"fmt","","",0,null],[11,"new_rc","","Taken by value, so it moves the value out.\nUse this for constructing brand new objects.\nReturns an Rc<RefCell<T>>, not a Ptr<T>,\ndon't get em mixed up",0,{"inputs":[{"name":"t"}],"output":{"name":"rc"}}],[11,"new","","Taken by reference to an existing object. Creates a Ptr",0,{"inputs":[{"name":"rc"}],"output":{"name":"ptr"}}],[11,"empty","","Creates what is effectively a null pointer",0,{"inputs":[],"output":{"name":"ptr"}}],[11,"merge_upgrade","","Used as a utility function to merge the upgrade of two weak pointers\ninto a single Option wrapping the success of both upgrades",0,{"inputs":[{"name":"ptr"},{"name":"ptr"}],"output":{"name":"option"}}],[11,"is_valid","","Check if the pointer is valid. Requires the pointer to upgrade in order to check\nthat it still points at an existing object",0,null],[11,"upgrade","","Used as a utility function for upgrading the stored weak pointer.",0,null],[11,"as_ref","","Converts from Option<Weak<RefCell<T>>> to Option<& Weak<RefCell<T>>>\nLike the function of the same name on Option",0,null],[11,"clone","","",0,null],[0,"edge","half_edge_mesh","",null,null],[3,"Edge","half_edge_mesh::edge","",null,null],[12,"next","","",1,null],[12,"pair","","",1,null],[12,"origin","","",1,null],[12,"face","","",1,null],[12,"id","","",1,null],[11,"fmt","","",1,null],[11,"empty","","",1,{"inputs":[{"name":"u32"}],"output":{"name":"edge"}}],[11,"with_origin","","",1,{"inputs":[{"name":"u32"},{"name":"vertptr"}],"output":{"name":"edge"}}],[11,"take_next","","",1,null],[11,"set_next","","",1,null],[11,"set_next_rc","","",1,null],[11,"take_pair","","",1,null],[11,"set_pair","","",1,null],[11,"set_pair_rc","","",1,null],[11,"take_origin","","",1,null],[11,"set_origin","","",1,null],[11,"set_origin_rc","","",1,null],[11,"set_face","","",1,null],[11,"take_face","","",1,null],[11,"set_face_rc","","",1,null],[11,"is_valid","","",1,null],[11,"get_next","","",1,null],[11,"get_pair","","",1,null],[11,"get_origin","","",1,null],[11,"get_face","","",1,null],[11,"get_next_next","","",1,null],[11,"get_next_pair","","",1,null],[11,"get_target","","",1,null],[11,"get_pair_face","","",1,null],[11,"adjacent_verts","","Yields edge.origin, then edge.next.origin\nGives you first the source of the half-edge, and then its target",1,null],[11,"adjacent_edges","","Gives you the edges connected to the source of the half-edge first (in *clockwise* order)\nand then the edges connected to the target of the half-edge (also *clockwise* order)",1,null],[11,"adjacent_faces","","Yields edge.face, then edge.pair.face\nGives you the "left" face to the half edge, and then the "right" face\nNote that the "right" face is not connected to this edge, but to its pair",1,null],[11,"eq","","",1,null],[11,"hash","","",1,null],[0,"vert","half_edge_mesh","",null,null],[3,"Vert","half_edge_mesh::vert","",null,null],[12,"edge","","",2,null],[12,"pos","","",2,null],[12,"id","","",2,null],[11,"fmt","","",2,null],[11,"empty","","All structure of the mesh revolves around vertex positions and their connectivity.\n(Faces are just an abstraction). All vertices must therefore have a concrete position.",2,{"inputs":[{"name":"u32"},{"name":"point3"}],"output":{"name":"vert"}}],[11,"with_edge","","Vertex connected to an existing edge",2,{"inputs":[{"name":"u32"},{"name":"point3"},{"name":"edgeptr"}],"output":{"name":"vert"}}],[11,"take_edge","","",2,null],[11,"set_edge","","",2,null],[11,"set_edge_rc","","",2,null],[11,"move_to","","",2,null],[11,"get_pos","","",2,null],[11,"is_valid","","",2,null],[11,"get_edge","","",2,null],[11,"adjacent_verts","","Important: Iterates over the vertices connected to a vertex in *clockwise* order",2,null],[11,"adjacent_edges","","Important: Iterates over the edges connected to a vertex in *clockwise* order",2,null],[11,"adjacent_faces","","Important: Iterates over the faces connected to a vertex in *clockwise* order",2,null],[11,"eq","","",2,null],[11,"hash","","",2,null],[0,"face","half_edge_mesh","",null,null],[3,"Face","half_edge_mesh::face","",null,null],[12,"edge","","",3,null],[12,"normal","","",3,null],[12,"center","","",3,null],[12,"id","","",3,null],[11,"fmt","","",3,null],[11,"empty","","",3,{"inputs":[{"name":"u32"}],"output":{"name":"face"}}],[11,"with_edge","","",3,{"inputs":[{"name":"u32"},{"name":"edgeptr"}],"output":{"name":"face"}}],[11,"take_edge","","",3,null],[11,"set_edge","","",3,null],[11,"set_edge_rc","","",3,null],[11,"is_valid","","",3,null],[11,"get_edge","","",3,null],[11,"num_vertices","","",3,null],[11,"compute_attrs","","Computes the attributes (normal and center) of this face\nNote: this only works when the edges and verts are properly connected\nSo wait for the right time during initialization to run this\nWhen a face or faces are added to a half edge mesh with one of the\nprovided functions, this function is called, so that the face attributes\nare correct.\nTODO: Decide what to do with a degenerate face",3,null],[11,"adjacent_verts","","Iterates over the vertices which make up the face in *counterclockwise* order",3,null],[11,"adjacent_edges","","Iterates over the edges which make up the face in *counterclockwise* order",3,null],[11,"adjacent_faces","","Iterates over the faces adjacent to this face in *counterclockwise* order",3,null],[11,"distance_to","","",3,null],[11,"directed_distance_to","","",3,null],[11,"can_see","","",3,null],[11,"eq","","",3,null],[11,"hash","","",3,null],[0,"iterators","half_edge_mesh","",null,null],[3,"EdgeAdjacentVertIterator","half_edge_mesh::iterators","",null,null],[3,"EdgeAdjacentEdgeIterator","","",null,null],[3,"EdgeAdjacentFaceIterator","","",null,null],[3,"VertAdjacentVertIterator","","",null,null],[3,"VertAdjacentEdgeIterator","","",null,null],[3,"VertAdjacentFaceIterator","","",null,null],[3,"FaceAdjacentVertIterator","","",null,null],[3,"FaceAdjacentEdgeIterator","","",null,null],[3,"FaceAdjacentFaceIterator","","",null,null],[8,"ToPtrVec","","A trait for converting an interator of Ptr<T>\ninto a vector of Rc<RefCell<T>>\nTODO: rename this, since it's not exactly a vec of "Ptr",\nand that's potentially confusing",null,null],[10,"to_ptr_vec","","",4,null],[11,"new","","",5,{"inputs":[{"name":"edge"}],"output":{"name":"edgeadjacentvertiterator"}}],[11,"next","","",5,null],[11,"new","","",6,{"inputs":[{"name":"edge"}],"output":{"name":"edgeadjacentedgeiterator"}}],[11,"next","","",6,null],[11,"new","","",7,{"inputs":[{"name":"edge"}],"output":{"name":"edgeadjacentfaceiterator"}}],[11,"next","","",7,null],[11,"new","","",8,{"inputs":[{"name":"edgeptr"}],"output":{"name":"vertadjacentvertiterator"}}],[11,"next","","",8,null],[11,"new","","",9,{"inputs":[{"name":"edgeptr"}],"output":{"name":"vertadjacentedgeiterator"}}],[11,"next","","",9,null],[11,"new","","",10,{"inputs":[{"name":"edgeptr"}],"output":{"name":"vertadjacentfaceiterator"}}],[11,"next","","",10,null],[11,"new","","",11,{"inputs":[{"name":"edgeptr"}],"output":{"name":"faceadjacentvertiterator"}}],[11,"next","","",11,null],[11,"new","","",12,{"inputs":[{"name":"edgeptr"}],"output":{"name":"faceadjacentedgeiterator"}}],[11,"next","","",12,null],[11,"new","","",13,{"inputs":[{"name":"edgeptr"}],"output":{"name":"faceadjacentfaceiterator"}}],[11,"next","","",13,null],[0,"mesh","half_edge_mesh","",null,null],[3,"HalfEdgeMesh","half_edge_mesh::mesh","Half-Edge Mesh data structure\nWhile it's possible to create non-triangular faces, this code assumes\ntriangular faces in several locations\nmesh.edges, mesh.vertices, and mesh.faces are HashMaps containing reference-counted Pointers\nto the mesh contents. Usually, these Rc values are the last values to exist. When they\nare destroyed, the pointed-to contents are destroyed as well.\nVertex, edge, and face ids are mesh-specific and unique only within a certain mesh\nInteger overflow is undefined in Rust, but checked in debug builds. I think this means\nthat it's possible to generate the same id twice, after 2^32-1 ids have been made.\nTry not to make more than 2^32-1 of any one of them, stuff might get messed up.\nTODO: Better error reporting, using a custom error type\nSee also: http://blog.burntsushi.net/rust-error-handling/\nProbably should do it whenever faces are added or a vertex is modified ?\nTODO: Better way of updating face-specific data like center and normals",null,null],[12,"edges","","",14,null],[12,"vertices","","",14,null],[12,"faces","","",14,null],[11,"empty","","Constructs an empty mesh",14,{"inputs":[],"output":{"name":"halfedgemesh"}}],[11,"from_tetrahedron_pts","","Construct a half edge mesh from four points that form a tetrahedron\nA half-edge mesh requires at least a tetrahedron to be valid.\nWhen seen from an arbitrary "front" side of the tetrahedron, the vertices given to this function\nshould be as follows:\np1: apex, p2: bottom left front, p3: bottom right front, p4: bottom rear",14,{"inputs":[{"name":"point3"},{"name":"point3"},{"name":"point3"},{"name":"point3"}],"output":{"name":"halfedgemesh"}}],[11,"from_octahedron_pts","","Construct a half edge mesh from six points that form an octahedron\np1: top apex, p2: mid left front, p3: mid right front, p4: mid left back, p5: mid right back, p6: bottom apex",14,{"inputs":[{"name":"point3"},{"name":"point3"},{"name":"point3"},{"name":"point3"},{"name":"point3"},{"name":"point3"}],"output":{"name":"halfedgemesh"}}],[11,"from_face_vertex_mesh","","Construct a half edge mesh from a Vec of vertices and a Vec of triplets of indices into\nthe Vec of vertices.",14,{"inputs":[{"name":"vec"},{"name":"vec"}],"output":{"name":"halfedgemesh"}}],[11,"new_edge_id","","",14,null],[11,"new_vert_id","","",14,null],[11,"new_face_id","","",14,null],[11,"push_edge","","",14,null],[11,"extend_edges","","",14,null],[11,"move_edges","","",14,null],[11,"push_vert","","",14,null],[11,"extend_verts","","",14,null],[11,"move_verts","","",14,null],[11,"push_face","","",14,null],[11,"extend_faces","","",14,null],[11,"move_faces","","",14,null],[11,"add_triangle","","Adds a tuple of (face, edge, edge, edge) to the mesh",14,null],[11,"make_triangle","","Takes three Rc<RefCell<Vert>>,\ncreates three edges and one face, and connects them as well as it can\nNote: since this creates a lone triangle, edge.pair links are\nstill empty after this function",14,null],[11,"are_faces_adjacent","","Checks if two faces are adjacent by looking for a shared edge",14,null],[11,"are_face_ptrs_adjacent","","",14,null],[11,"triangulate_face","","Replace a face with three faces, each connected to the new point\nAnd one of the face's previous vertices\nTODO: Make all of these mesh-manipulation functions return a Result<(), &str> to check that manipulation was completed",14,null],[11,"triangulate_face_ptr","","",14,null],[11,"attach_point_for_faces","","Attach a point to a mesh, replacing many faces (used for the convex hull algorithm)\nThe faces should be a continuously connected group, each adjacent pair of vertices\nin the border of this group are connected to the point in a new triangular face.\nThe programmer is responsible for ensuring that there are no holes in the passed\nset of faces. Returns Pointers to the new faces in the result, if successful",14,null],[11,"attach_point_for_face_ptrs","","",14,null],[11,"remove_vert","","This function should only work if the vertex has exactly three adjacent edges.\nTherefore, it has three adjacent faces.\nThe vertices connected to those edges form a new face, and the faces and edges connected\nto the removed vertex are also removed",14,null],[11,"remove_vert_ptr","","",14,null],[11,"flip_edge","","flips an edge between two faces so that the faces are each split by\nthe other diagonal of the parallelogram they form.",14,null],[11,"flip_edge_ptr","","",14,null],[11,"split_edge","","Inserts a vertex at the position, specified by tval, along edge.origin -> edge.next.origin\nThe edge's two neighboring faces are each split into two faces.\nAll four new faces include the new vertex",14,null],[11,"split_edge_rc","","",14,null],[0,"util","half_edge_mesh","",null,null],[5,"connect_pairs","half_edge_mesh::util","Takes what is assumed to be a fully constructed mesh, with no\npair links, and establishes pair links between adjacent edges.\nIf this function runs successfully on a mesh, all links in the mesh\nshould point to their adjacent pair",null,{"inputs":[{"name":"halfedgemesh"}],"output":{"name":"result"}}],[5,"report_connect_err","","Utility function for reporting problems with edge connectivity",null,{"inputs":[{"name":"result"}],"output":null}],[5,"are_edge_pairs_valid","","Checks if edge pair connections are all valid",null,{"inputs":[{"name":"halfedgemesh"}],"output":{"name":"result"}}]],"paths":[[3,"Ptr"],[3,"Edge"],[3,"Vert"],[3,"Face"],[8,"ToPtrVec"],[3,"EdgeAdjacentVertIterator"],[3,"EdgeAdjacentEdgeIterator"],[3,"EdgeAdjacentFaceIterator"],[3,"VertAdjacentVertIterator"],[3,"VertAdjacentEdgeIterator"],[3,"VertAdjacentFaceIterator"],[3,"FaceAdjacentVertIterator"],[3,"FaceAdjacentEdgeIterator"],[3,"FaceAdjacentFaceIterator"],[3,"HalfEdgeMesh"]]}; initSearch(searchIndex);