Mesh() -- Create an empty mesh object. This class allows one to manipulate the mesh object by adding new facets, deleting facets, importing from an STL file, transforming the mesh and much more. For a complete overview of what can be done see also the documentation of mesh. A mesh object cannot be added to an existing document directly. Therefore the document must create an object with a property class that supports meshes. Example: m = Mesh.Mesh() ... # Manipulate the mesh d = FreeCAD.activeDocument() # Get a reference to the actie document f = d.addObject(\"Mesh::Feature\", \"Mesh\") # Create a mesh feature f.Mesh = m # Assign the mesh object to the internal property d.recompute() Read in a mesh object from file. Write the mesh object into file. Write the mesh in OpenInventor format to a string. Create a copy of this mesh Move the point along their normals Move the point along their normals Get cross-sections of the mesh through several planes Union of this and the given mesh object. Intersection of this and the given mesh object. Difference of this and the given mesh object. Get the part inside of the intersection Get the part outside the intersection Coarse the mesh Apply a translation to the mesh Apply a rotation to the mesh Apply a transformation to the mesh Transform the mesh to its eigenbase Add a facet to the mesh Add a list of facets to the mesh Remove a list of facet indices from the mesh Builds a list of facet indices with triangles that are inside a volume mesh Repairs the neighbourhood which might be broken Combine this mesh with another mesh. setPoint(int, Vector) Sets the point at index. Get the number of segments which may also be 0 Get a list of facet indices that describes a segment Returns a list containing the different components (separated areas) of the mesh as separate meshes import Mesh for c in mesh.getSeparatecomponents(): Mesh.show(c) Get a list of the indices of selected facets Get a list of the indices of selected points Create a mesh from segment Clear the mesh Check if the mesh is a solid Check if the mesh has non-manifolds Remove non-manifolds Check if the mesh intersects itself Repair self-intersections Remove folds on surfaces Check if the mesh has facets with inconsistent orientation Get the number of wrong oriented facets Get the number of topologic independent areas Remove components with less or equal to number of given facets Repair any invalid indices Repair deformed facets Remove degenerated facets Remove duplicated points Remove duplicated facets Refine the mesh Split all edges Split edge Split facet Swap the common edge with the neighbour Remove an edge and both facets that share this edge Remove a facet Remove a list of facets Insert a vertex into a facet Insert a new facet at the border Get detailed information about the mesh Get a list of facet indices and intersection points Adjust wrong oriented facets Flip the mesh normals Fillup holes Smooth the mesh Optimize the edges to get nicer facets Optimize the edges to get nicer facets nearestFacetOnRay(tuple, tuple) -> dict Get the index and intersection point of the nearest facet to a ray. The first parameter is a tuple of three floats the base point of the ray, the second parameter is ut uple of three floats for the direction. The result is a dictionary with an index and the intersection point or an empty dictionary if there is no intersection. getPlanarSegments(dev,[min faces=0]) -> list Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single plane if none of its neighours is coplanar. getSegmentsByCurvature(list) -> list The argument list gives a list if tuples where it defines the preferred maximum curvature, the preferred minumum curvature, the tolerances and the number of minimum faces for the segment. Example: c=(1.0, 0.0, 0.1, 0.1, 500) # search for a cylinder with radius 1.0 p=(0.0, 0.0, 0.1, 0.1, 500) # search for a plane mesh.getSegmentsByCurvature([c,p]) A collection of the mesh points With this attribute it is possible to get access to the points of the mesh for p in mesh.Points: print p.x, p.y, p.z Return the number of vertices of the mesh object. A collection of facets With this attribute it is possible to get access to the facets of the mesh for p in mesh.Facets: print p Return the number of facets of the mesh object. Return the points and face indices as tuple. Return the area of the mesh object. Return the volume of the mesh object. private: friend class PropertyMeshKernel; class PropertyMeshKernel* parentProperty;