V-rep學習筆記:切削

  V-REP allows you to perform cutting simulations. The user can model almost any type of cutting volumes as long as they are convex (however you can always combine several convex cutting volumes to obtain a non-convex cutting volume). The scene objects that allow for this functionality are mills, which can cut cuttable entities. Following figures illustrates examples using mills:php

[Two cutting simulation examples]函數

  Mills will always have a convex cutting volume, however they can be combined to generate a non-convex cutting volume or more complex volumes. They cut parts of cuttable entities away that interferes with their cutting volume. By default, cuttable objects have their cuttable tag disabled. Refer to the object common properties to enable or disable individual object's cuttable tag.ui

  Parts of cuttable objects that have been cut away will not be collidable, measurable, detectable or renderable anymore (but the remainder will). Depending on the size and complexity of cuttable objects, the cutting operation can be slowed down. The cutting speed is also linked to the cutting volume precision and the rate at which the cut is performed. Smooth cutting volumes usually perform better when the cutting is continuous (not a one-time cut). A too small cutting rate might also result in a slow-down due to the increasing size of the required calculation structure. The best is to test for the best cutting volume - cutting rate relationship.this

  Cut objects can be reset to their initial state with the simResetMilling command. Changes can also be made permanent with the simApplyMilling command.The amount of cut surface/volume can be recorded by graph objects. Refer to graphs and graph data stream types for more information about how to record mill data.spa

 

   VREP中Mill只能對錶面進行切削(不支持實體模型切削)。下面導入一個立方體STL網格模型,勾選其Cuttable屬性:code

   而後添加一個Mill放在立方體上表面(刀具的切削體要進入立方體表面內),cutting volume能夠設置成下面幾種基本形狀:orm

  添加腳本控制Mill在立方體上表面移動,能夠看到與刀具接觸的面被移除:對象

  仿真結束後被切削的對象會還原,若是要應用切削改變,可使用simApplyMilling函數(Applies changes made during milling operations to a cuttable object)。blog

function sysCall_init()
    -- do some initialization here:

    millHandle = sim.getObjectHandle('Mill')

end

function sysCall_actuation()
    -- put your actuation code here
    
    -- Explicit handling
    --sim.handleMill(millHandle) 

    local position=sim.getObjectPosition(millHandle,-1)
    position[1]=position[1]+0.0001
    sim.setObjectPosition(millHandle,-1,position)
end



function sysCall_cleanup()
    -- do some clean-up here
end

 

 

 

 

參考:ip

Solid Mesh

Solid mesh for milling

Importing stl files as solid, non hollow objects

相關文章
相關標籤/搜索