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:

[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.

  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.

  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.

 

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

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

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

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

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

 

 

 

 

參考:

Solid Mesh

Solid mesh for milling

Importing stl files as solid, non hollow objects


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM