The Mesh objects can be manipulated 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 Mesh Workbench documentation. 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()

Description: Adds a facet to the mesh
Returns:

Description: Adds a list of facets to the mesh
Returns:

Description: Combines this mesh with another mesh.
Returns:

Description: Clears the mesh
Returns:

Description: Coarsens the mesh
Returns:

Description: Removes an edge and both facets that share this edge
Returns:

Description: Removes a facet
Returns:

Description: Removes a list of facets
Returns:

Description: Creates a copy of this mesh
Returns: a Mesh object

Description: Get the number of topological independent areas
Returns: an integer

Description: Get the number of wrong oriented facets
Returns: an integer

Description: Get the number of segments which may also be 0
Returns: an integer

Description: Get cross-sections of the mesh through several planes
Returns:

Description: Difference of this and the given mesh object.
Returns:

Description: Fillup holes
Returns:

Description: Repair deformed facets
Returns:

Description: Remove degenerated facets
Returns:

Description: Repair any invalid indices
Returns:

Description: Repair self-intersections
Returns:

Description: Flip the mesh normals
Returns:

Description: Get a list of facet indices and intersection points
Returns:

Description: Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single plane if none of its neighbors is coplanar.
Returns:

Description: Get a list of facet indices that describes a segment
Returns:

Description: Returns a list containing the different components (separated areas) of the mesh as separate meshes
Returns: a list

Description: Adjust wrong oriented facets
Returns:

Description: Check if the mesh has non-manifolds
Returns: a boolean

Description: Checks if the mesh has facets with inconsistent orientation
Returns:

Description: Check if the mesh intersects itself
Returns:

Description: Get the part inside of the intersection
Returns:

Description: Inserts a vertex into a facet
Returns:

Description: Intersection of this and the given mesh object.
Returns:

Description: Check if the mesh is a solid
Returns:

Description: Create a mesh from segment
Returns:

Description: 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.
Returns: a dictionary

Description: Move the point along their normals
Returns:

Description: Move the point along their normals
Returns:

Description: Optimize the edges to get nicer facets
Returns:

Description: Optimize the edges to get nicer facets
Returns:

Description: Get the part outside the intersection
Returns:

Description: Get detailed information about the mesh
Returns:

Description: Read in a mesh object from file.
Returns:

Description: Refine the mesh
Returns:

Description: Remove components with less or equal to number of given facets
Returns:

Description: Remove duplicated facets
Returns:

Description: Remove duplicated points
Returns:

Description: Remove a list of facet indices from the mesh
Returns:

Description: Remove folds on surfaces
Returns:

Description: Remove non-manifolds
Returns:

Description: Apply a rotation to the mesh
Returns:

Description: Sets the point at index.
Returns:

Description: Smooth the mesh
Returns:

Description: Insert a new facet at the border
Returns:

Description: Split edge
Returns:

Description: Split all edges
Returns:

Description: Split facet
Returns:

Description: Swap the common edge with the neighbor
Returns:

Description: Apply a transformation to the mesh
Returns:

Description: Transform the mesh to its eigenbase
Returns:

Description: Apply a translation to the mesh
Returns:

Description: Union of this and the given mesh object.
Returns:

Description: Write the mesh object into file.
Returns:

Description: Write the mesh in OpenInventor format to a string.
Returns: a string

Returns: the area of the mesh object.

Returns: the number of vertices of the mesh object.

Returns: the number of facets of the mesh object.

Returns: the number of points of the mesh object.

Returns: A collection of facets; With this attribute it is possible to get access to the facets of the mesh: for f in mesh.Facets: print f. Facet.Points is a list of coordinate-tupels for the vertices. Facet.PointIndices is a list of indice for the vertices of the facet. WARNING! store Facets in a local variable as it is generated on the fly, each time it is accessed.

Returns: 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,p.Index.WARNING! store Points in a local variable as it is generated on the fly, each time it is accessed.

Returns: the points and face indices as tuple. Topology[0] is a list of all vertices. Each being a tuple of 3 coordinates. Topology[1] is a list of all polygons. Each being a list of vertex indice into Topology[0] WARNING! store Topology in a local variable as it is generated on the fly, each time it is accessed.

Returns: the volume of the mesh object.

Returns: the BoundBox of the object

Returns: the current transformation of the object as matrix

Returns: the current transformation of the object as placement
Ez az oldal a következő oldalról származik https://wiki.freecad.org/Mesh_API