论坛首页    职业区    学术与写作    工程技术区    软件区    资料区    商务合作区    社区办公室
 您好! 欢迎 登录 或 注册 最新帖子 邀请注册 活动聚焦 统计排行 社区服务 帮助
 
  • 帖子
  • 日志
  • 用户
  • 版块
  • 群组
帖子
  • 2104阅读
  • 0回复

关于flac3d操作节点的一个函数。大家看下怎么合适呀 [复制链接]

上一主题 下一主题
离线土牛
 

发帖
373
土币
2413
威望
72
原创币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2014-01-31

new
gen zone brick p0 0 0 0 p1 10 0 0 p2 0 10 0 p3 0 0 10 p4 10 10 0 p5 0 10 10 p6 10 0 10 p7 10 10 10 size 5 5 10
gen zone brick p0 0 0 -10 size 10 10 10
plot block group

;遍历融合节点


def merge
  ap_gp=gp_head
  loop while ap_gp#null
   az_pos=gp_zpos(ap_gp)
   ax_pos=gp_xpos(ap_gp)
   ay_pos=gp_ypos(ap_gp)
    if az_pos=0 then
      bp_gp=gp_head
       loop while bp_gp#null
         bz_pos=gp_zpos(bp_gp)
         bx_pos=gp_xpos(bp_gp)
         by_pos=gp_ypos(bp_gp)  
         if bz_pos=0 then
            d=sqrt((ax_pos-bx_pos)^2+(ay_pos-by_pos)^2)
            if d<=1 then
               bx_pos=ax_pos
               by_pos=ay_pos
               bp_gp=gp_head
            endif
          endif
         bp_gp=gp_next(bp_gp)
       end_loop
     endif
   ap_gp=gp_next(ap_gp)
end_loop

end

merge

解释一下,上方brick单元。边长10,x、y向划分5个单元,单元边长2.下方brick单元,边长10,x、y向划分10个单元,单元边长1.接触面处z坐标为0。函数是遍历节点,在接触面处错开的节点连结在一起。这个函数效率太低,而且运行有问题。大家各提意见,最好再设计一种更合适的函数。
青青子衿,忧忧我心;但为君故,沉吟至今。
快速回复
限100 字节
温馨提示:欢迎交流讨论,请勿纯表情、纯引用!
 
上一个 下一个

      https://beian.mps.gov.cn/ 粤公网安备 44010602012919号 广州半山岩土网络科技有限公司 粤ICP备2024274469号

      工业和信息化部备案管理系统网站