zoukankan      html  css  js  c++  java
  • 对齐成功。

     
    fn g_filter o = superclassof o == Geometryclass
    fn find_intersection z_node node_to_z =
    (
     --同样的条件 数字及计算要比字符串快 所以能用数字 不用字符串。
     
    oop=case of

      (

      (gt_yc_Ail.conunt_spn1.value ==1): [0,0,-1]

      (gt_yc_Ail.conunt_spn1.value ==2): [0,0,1]
       
      (gt_yc_Ail.conunt_spn1.value ==3):[-1,0,0]
       
      (gt_yc_Ail.conunt_spn1.value ==4):[1,0,0]
       
      (gt_yc_Ail.conunt_spn1.value ==5):[0,-1,0]
       
      (gt_yc_Ail.conunt_spn1.value ==6):[0,1,0]

      --default: reference $foo
      )

     local testRay = ray node_to_z.pos  oop
     local nodeMaxZ
      case oop  of
      (  ------Z 轴
       ([0,0,-1]) :(nodeMaxZ = z_node.max.z
        testRay.pos.z = nodeMaxZ + 0.0001 * abs nodeMaxZ
        
        )
       ([0,0,1]) :(nodeMaxZ = z_node.min.z
        testRay.pos.z = nodeMaxZ - 0.0001 * abs nodeMaxZ  
       )
       -------X轴 
       ([-1,0,0]) : (nodeMaxZ = z_node.max.x
        testRay.pos.x = nodeMaxZ + 0.0001 * abs nodeMaxZ   
       )
       ([1,0,0]) : (nodeMaxZ = z_node.min.x
       testRay.pos.x = nodeMaxZ - 0.0001 * abs nodeMaxZ   
       )
      ------- Y轴
             ([0,-1,0]) : (nodeMaxZ = z_node.max.y
       testRay.pos.y = nodeMaxZ + 0.0001 * abs nodeMaxZ   
       )
       ([0,1,0]) : (nodeMaxZ = z_node.min.y
       testRay.pos.y = nodeMaxZ - 0.0001 * abs nodeMaxZ   
       ) 
      )  
     
     --testRay.pos.z = nodeMaxZ + 0.0001 * abs nodeMaxZ
     intersectRay z_node testRay
    )

     try(destroyDialog gt_yc_Ail)catch()
    rollout gt_yc_Ail "yongchao-对齐" 168 height:80
    (
     spinner conunt_spn1 "" pos:[152,25] 12 height:16  range:[1,6,1] type:#integer
     edittext conunt_edt1 "" pos:[3,25] 147 height:16 text:"Z轴的负方向" enabled:false
     button pick_btn1 "开始对齐" pos:[6,49] 142 height:24
     groupBox grp1 "轴向选择:" pos:[5,9] 160 height:39
     on conunt_spn1 changed arg  do
     (
      new_obj = case arg of

      (

      1: conunt_edt1.text="Z轴的负方向"

      2: conunt_edt1.text="Z轴的正方向"
       
      3: conunt_edt1.text="X轴的负方向"
       
      4: conunt_edt1.text="X轴的正方向"
       
      5: conunt_edt1.text="Y轴的负方向"
       
      6: conunt_edt1.text="Y轴的正方向"

      --default: reference $foo

      )

     )
     
     
     on pick_btn1 pressed do
    (
     target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter --- 这种拾取的方法更好。不用再显示;
     if isValidNode target_mesh then ---这个好用, 是如果节点没有被删除。
     (
      undo "MoveToSurface" on
      (
       for i in selection do
       (
        int_point = find_intersection target_mesh i
        if int_point != undefined then i.pos = int_point.pos
       )--end i loop
      )--end undo
     )--end if
    )--end pressed
      
     
    )
    createdialog gt_yc_Ail style:#(#style_border,#style_titlebar,#style_resizing,#style_sysmenu)

  • 相关阅读:
    Spring9:Autowire(自动装配)机制
    【Spring源码分析】非懒加载的单例Bean初始化前后的一些操作
    记一次synchronized锁字符串引发的坑兼再谈Java字符串
    Cglib及其基本使用
    Java回调机制解读
    【设计模式总结】对常用设计模式的一些思考
    【Spring源码分析】非懒加载的单例Bean初始化过程(下篇)
    【Spring源码分析】非懒加载的单例Bean初始化过程(上篇)
    【Spring源码分析】Bean加载流程概览
    Spring8:一些常用的Spring Bean扩展接口
  • 原文地址:https://www.cnblogs.com/gaitian00/p/2015942.html
Copyright © 2011-2022 走看看