首页/文章/ 详情

HyperMesh齿轮结构化小工具

1年前浏览1267

 做齿轮分析时,结构化网格是最优选择,通常方法是先绘制一个齿的网格,然后进行旋转复 制即可。但是如果齿数较多的时候,操作起来还是比较繁琐的。所以我就做了这个小插件,在这里共享一下。


01

插件的使用方法

  • 准备好单齿网格,并设定定义旋转轴线的点


  • 运行脚本,在对话框选择旋转轴线

  • 选择需要选择的网格

  • 输入齿轮齿数

  • 完成,获得全齿轮网格

02


源代码


    #选择定义轴线set plane [hm_getplanepanel "Please define a axle"]set plane [regsub -all "{" $plane " "]set plane [regsub -all "}" $plane " "]set s2 " "string trim $plane $s2*createplane 1 [lindex $plane 0] [lindex $plane 1] [lindex $plane 2] [lindex $plane 3] [lindex $plane 4] [lindex $plane 5]# 选择单齿单元*createmarkpanel elems 1 "Please select the elements of a tooth."set es [hm_getmark elems 1]puts "The nodes selected are $es."# 输入齿轮齿数set teeth [hm_getint "teeth=" "Please specify the number of teeth." ]# 计算每次旋转的角度set angle [expr 360./$teeth]for { set a 1}  {$a < $teeth} {incr a} {#*duplicatemark elements 1 0*duplicateentities elems 1 2 destcomponent=2*rotatemark elements 1 1 [expr $angle]puts $a}
       

    来源:SimCoder
    HyperMesh
    著作权归作者所有,欢迎分享,未经许可,不得转载
    首次发布时间:2023-02-06
    最近编辑:1年前
    签我的导演他姓张
    本科 怕什么真理无穷进一寸有一寸欣喜
    获赞 47粉丝 39文章 44课程 0
    点赞
    收藏
    未登录
    还没有评论

    课程
    培训
    服务
    行家

    VIP会员 学习 福利任务 兑换礼品
    下载APP
    联系我们
    帮助与反馈