Welcome, Guest
You have to register before you can post on our site.

Email:
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 3
» Latest member: Sunlery
» Forum threads: 3
» Forum posts: 3

Full Statistics

Online Users
There are currently 2 online users.
» 0 Member(s) | 2 Guest(s)

Latest Threads
aghgafh非共和国
Forum: AEI ToolBar
Last Post: qqqaaa
01-11-2018, 10:49 AM
» Replies: 0
» Views: 122
How to set slice plane by...
Forum: Parse the code || 代码解析
Last Post: AEI
12-20-2017, 06:30 PM
» Replies: 0
» Views: 207
Test
Forum: AEI ToolBar
Last Post: AEI
12-04-2017, 02:08 PM
» Replies: 0
» Views: 427

 
  aghgafh非共和国
Posted by: qqqaaa - 01-11-2018, 10:49 AM - Forum: AEI ToolBar - No Replies

a回答是不个的发给阿哥h俄方规划丰海甘图


  How to set slice plane by 3 vertexs | 通过三个点设置切片平面
Posted by: AEI - 12-20-2017, 06:30 PM - Forum: Parse the code || 代码解析 - No Replies

if $selection.count == 1 and classof $ == Editable_Poly and ($.EditablePoly.getSelection #Vertex as array ).count == 3 do
(
    vertsel = $.EditablePoly.getSelection #Vertex as array  
    vertsel[1] = polyop.getvert $ vertsel[1]  
    vertsel[2] = polyop.getvert $ vertsel[2]
    vertsel[3] = polyop.getvert $ vertsel[3]
    vertsel[2] = vertsel[1] - vertsel[2]  
    vertsel[3] = vertsel[1] - vertsel[3]
    if not polyop.inSlicePlaneMode $ do $.toggleCommandMode #SlicePlane
    polyop.setsliceplane $ (ray vertsel[1] (cross vertsel[2] vertsel[3])) 10
)
1、 Get ready,only when selection is a polygon object and 3 vertexs ware selected .
      准备工作,限制仅在选择一个多边形物体的三个点的情况下运行 
3、 save the vertex selection 
      记录三个点到一个数组
4、 save the vertext postion 
      记录点的位置信息
7、 get a vector 
      根据两个点的位置获取一个向量
8、 get another vector 
      获取另一个向量
9、 set the sliceplanemode on
      打开切片平面功能
10、set the sliceplane to target ,as the 2 vectors above defind a plane which was the target plane , but we can't set directly ,so we get cross product from them ,as the ray function could gave us the target , and it need two parameter , one is a vertex which on the target plane , another is the normal vector of the target plane which is the cross product .
      设置切片平面到目标位置,由于两个可以向量定义一个平面,而这个平面正式目标位置,但是我们不能直接设置一个平面,但由于射线函数通过一个平面的法线和平面上的一个点可以设置平面的位置,所以我们使用叉积获得平面的法线,再加一个点的位置信息完成了操作。


Big Grin Test
Posted by: AEI - 12-04-2017, 02:08 PM - Forum: AEI ToolBar - No Replies

if $selection.count == 1 and classof $ == Editable_Poly and ($.EditablePoly.getSelection #Vertex as array ).count == 3 do
(
    vertsel = $.EditablePoly.getSelection #Vertex as array
    vertsel[1] = polyop.getvert $ vertsel[1]
    vertsel[2] = polyop.getvert $ vertsel[2]
    vertsel[3] = polyop.getvert $ vertsel[3]
    vertsel[2] = vertsel[1] - vertsel[2]
    vertsel[3] = vertsel[1] - vertsel[3]
    if not polyop.inSlicePlaneMode $ do $.toggleCommandMode #SlicePlane
    polyop.setsliceplane $ (ray vertsel[1] (cross vertsel[2] vertsel[3])) 10
)
[Image: timg?image&quality=80&size=b9999_10000&s...2F3598.png]
https://timgsa.baidu.com/timg?image&qual...2F3598.png