Page 1 of 1

cutting simulation

Posted: 03 May 2014, 22:47
by jeffer
Hello,

I am new to V-REP, and I looked at the Milling Robot video about the "cutting" functionality of V-REP, does the "cutting" use the mesh 'cutting" functions inside V-REP? I looked at the CMeshManip class inside the V-REP source code, but could not find which functions
does the "Boolean" operation, could someone explain or pointer something about how the "cutting" was implemented for the cutting simulation?

Re: cutting simulation

Posted: 04 May 2014, 22:28
by coppelia
Hello Jeffer,

have a look at following files:
  • v_rep/sourceCode/3dObjects/Mill.cpp
  • v_rep/sourceCode/3dObjects/millObjectRelated/CuttingRoutine.cpp
  • v_rep/sourceCode/interfaces/collDistInterface.cpp
  • meshCalculationPlugin/sourceCode/collDistAlgos/collDistAlgos.cpp
But the algorithm is that a convex volume (composed by N planes) will be run over a mesh. If a triangle's vertices are separated by a plane, it will be split. Everything goes quite fast since the mesh's triangles is contained in a Oriented-Bounding-Box hierarchy. New created triangles (resulting from triangle cutting) are directly inserted in that hierarchy too.

That's just a very rough overview.

Cheers

Re: cutting simulation

Posted: 05 Dec 2018, 10:44
by carmelo
Hello Coppelia,

I am wondering if it is possible to visualize and export the mesh which originates from the cutting algorithm. I performed some milling on a mesh with all edges visible, but I could not see the edges of the new triangles created during the cutting simulation. I would really need to export the mesh model produced after the milling, ideally as an STL file. Is that possible to access/export the mesh triangles contained in the Oriented-Bounding-Box hierarchy described in the answer above?

Hope to hear from you soon.
Kind regards,
Carmelo

Re: cutting simulation

Posted: 06 Dec 2018, 08:03
by coppelia
Hello Carmelo,

the cutting algorithm is far from perfect and might be taken out of V-REP in future.
But normally you can call sim.applyMilling on the shape to make the change permanent. Then you should be able to access the modified data.

Cheers