当前位置: 首页>>代码示例>>Python>>正文


Python FemMeshTools.is_face_femmesh方法代码示例

本文整理汇总了Python中FemMeshTools.is_face_femmesh方法的典型用法代码示例。如果您正苦于以下问题:Python FemMeshTools.is_face_femmesh方法的具体用法?Python FemMeshTools.is_face_femmesh怎么用?Python FemMeshTools.is_face_femmesh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FemMeshTools的用法示例。


在下文中一共展示了FemMeshTools.is_face_femmesh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: write_z88_elements_properties

# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import is_face_femmesh [as 别名]
 def write_z88_elements_properties(self):
     element_properties_file_path = self.file_name + 'elp.txt'
     elements_data = []
     if FemMeshTools.is_edge_femmesh(self.femmesh):
         if len(self.beamsection_objects) == 1:
             beam_obj = self.beamsection_objects[0]['Object']
             width = beam_obj.Width.getValueAs('mm')
             height = beam_obj.Height.getValueAs('mm')
             area = str(width * height)
             elements_data.append('1 ' + str(self.element_count) + ' ' + area + ' 0 0 0 0 0 0 ')
             print("Be aware, only trusses are supported for edge meshes!")
         else:
             print("Multiple beamsections for Z88 not yet supported!")
     elif FemMeshTools.is_face_femmesh(self.femmesh):
         if len(self.shellthickness_objects) == 1:
             thick_obj = self.shellthickness_objects[0]['Object']
             thickness = str(thick_obj.Thickness.getValueAs('mm'))
             elements_data.append('1 ' + str(self.element_count) + ' ' + thickness + ' 0 0 0 0 0 0 ')
         else:
             print("Multiple thicknesses for Z88 not yet supported!")
     elif FemMeshTools.is_solid_femmesh(self.femmesh):
         elements_data.append('1 ' + str(self.element_count) + ' 0 0 0 0 0 0 0')
     else:
         print("Error!")
     f = open(element_properties_file_path, 'w')
     f.write(str(len(elements_data)) + '\n')
     for e in elements_data:
         f.write(e)
     f.write('\n')
     f.close()
开发者ID:sliptonic,项目名称:FreeCAD,代码行数:32,代码来源:FemInputWriterZ88.py

示例2: get_z88_element_type

# 需要导入模块: import FemMeshTools [as 别名]
# 或者: from FemMeshTools import is_face_femmesh [as 别名]
def get_z88_element_type(femmesh, femelement_table=None):
    import FemMeshTools
    if not femmesh:
        print("Error: No femmesh!")
    if not femelement_table:
        print("We need to get the femelement_table first!")
        femelement_table = FemMeshTools.get_femelement_table(femmesh)
    # in some cases lowest key in femelement_table is not [1]
    for elem in sorted(femelement_table):
        elem_length = len(femelement_table[elem])
        print(elem_length)
        break  # break after the first elem
    if FemMeshTools.is_solid_femmesh(femmesh):
        if femmesh.TetraCount == femmesh.VolumeCount:
            if elem_length == 4:
                return 17
            elif elem_length == 10:
                return 16
            else:
                print('Tetra with neiter 4 nor 10 nodes')
        elif femmesh.HexaCount == femmesh.VolumeCount:
            if elem_length == 8:
                return 1
            elif elem_length == 20:
                return 10
            else:
                print('Hexa with neither 8 nor 20 nodes')
                return 0
        else:
            print('no tetra, no hexa or Mixed Volume Elements')
    elif FemMeshTools.is_face_femmesh(femmesh):
        if femmesh.TriangleCount == femmesh.FaceCount:
            if elem_length == 3:
                print('tria3mesh, not supported by z88')
                return 0
            elif elem_length == 6:
                return 24
            else:
                print('Tria with neither 3 nor 6 nodes')
                return 0
        elif femmesh.QuadrangleCount == femmesh.FaceCount:
            if elem_length == 4:
                print('quad4mesh, not supported by z88')
                return 0
            elif elem_length == 8:
                return 23
            else:
                print('Quad with neiter 4 nor 8 nodes')
                return 0
        else:
            print('no tria, no quad')
            return 0
    elif FemMeshTools.is_edge_femmesh(femmesh):
        print('Edge femmesh will be exported as 3D truss element nr 4')
        return 4
    else:
        print('Neither, edge, face or solid femmesh')
        return 0
    return 0
开发者ID:SparkyCola,项目名称:FreeCAD,代码行数:61,代码来源:importZ88Mesh.py


注:本文中的FemMeshTools.is_face_femmesh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。