Beispiel #1
0
def makeMeshRegion(doc, base_mesh, element_length=0.0, name="FEMMeshRegion"):
    '''makeMeshRegion(document, base_mesh, [element_length], [name]): creates a FEM mesh region object to define properties for a region of a FEM mesh'''
    obj = doc.addObject("Fem::FeaturePython", name)
    from femobjects import _FemMeshRegion
    _FemMeshRegion._FemMeshRegion(obj)
    obj.CharacteristicLength = element_length
    # obj.BaseMesh = base_mesh
    # App::PropertyLinkList does not support append, we will use a temporary list to append the mesh region obj. to the list
    tmplist = base_mesh.MeshRegionList
    tmplist.append(obj)
    base_mesh.MeshRegionList = tmplist
    if FreeCAD.GuiUp:
        from femguiobjects import _ViewProviderFemMeshRegion
        _ViewProviderFemMeshRegion._ViewProviderFemMeshRegion(obj.ViewObject)
    return obj
def makeMeshRegion(doc, base_mesh, element_length=0.0, name="FEMMeshRegion"):
    '''makeMeshRegion(document, base_mesh, [element_length], [name]): creates a FEM mesh region object to define properties for a region of a FEM mesh'''
    obj = doc.addObject("Fem::FeaturePython", name)
    from femobjects import _FemMeshRegion
    _FemMeshRegion._FemMeshRegion(obj)
    obj.CharacteristicLength = element_length
    # obj.BaseMesh = base_mesh
    # App::PropertyLinkList does not support append, we will use a temporary list to append the mesh region obj. to the list
    tmplist = base_mesh.MeshRegionList
    tmplist.append(obj)
    base_mesh.MeshRegionList = tmplist
    if FreeCAD.GuiUp:
        from femguiobjects import _ViewProviderFemMeshRegion
        _ViewProviderFemMeshRegion._ViewProviderFemMeshRegion(obj.ViewObject)
    return obj