Mesh Feature

Other languages:

Introduction

A Mesh Feature object, or formally a Mesh::Feature, is a simple element with an associated mesh object that can be displayed in the 3D view.

A Mesh Feature is similar conceptually to a Part Feature; the former is the base object for elements with "mesh" information, while the latter is the base object for elements with "geometrical shape" information.

Please note that the FEM Workbench also uses meshes, but it uses a different object, called FEM FemMeshObject (Fem::FemMeshObject class). This object is not derived from the Mesh Feature and has different properties.

Simplified diagram of the relationships between the core objects in FreeCAD

Usage

Almost all mesh objects created by the commands available in the Mesh Workbench are Mesh Features. The parametric mesh objects created by the Mesh BuildRegularSolid command are the only exception. A Mesh Feature can also be created from the Python console as described in the Scripting section.

The Mesh::Feature is defined in the Mesh Workbench but can be used as the base class for scripted objects in all workbenches that produce 2D and 3D meshes.

A Mesh::Feature has simple properties like a placement, and visual properties to define the appearance of its edges and faces.

Properties

See Property for all property types that scripted objects can have.

The Mesh Feature (Mesh::Feature class) is derived from the basic App GeoFeature (App::GeoFeature class) and inherits all its properties. It also has several additional properties. Notably a DataMesh property, which stores its Mesh MeshObject. This is the geometry that is shown in the 3D view.

These are the properties available in the property editor. Hidden properties can be shown by using the Show all command in the context menu of the property editor.

Data

Base

View

Base

Display Options

Object Style

Selection

Scripting

See also: FreeCAD Scripting Basics and scripted objects.

See Part Feature for the general information on adding objects to the document.

A Mesh Feature is created with the addObject() method of the document.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Mesh::Feature", "Name")
obj.Label = "Custom label"

For Python subclassing you should create the Mesh::FeaturePython object.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Mesh::FeaturePython", "Name")
obj.Label = "Custom label"