1

I'm writting CNC simulator for 3-axis milling tool. At first attempt I have represented the material as WxHxD box (W - width, H- height, D - depth) with W and D divisor parameters. So for example W = D = 120, H = 50, W-div = 20, D-div = 20:

enter image description here

At each step the mill is removing material and H coordinate at each division point is adjusted simulating material removal:

enter image description here

This method is OK for started. But to simulate full precision of milling tool the divisors should have hight values, i.e. for material block of 100 mm x 100 mm x 100 mm to have precision of 0.01 mm the divisors should be 10 000 which makes simulation almost impossible. Also setting divisors makes precision fixed and not dependent on mill parameters (radius, height, curvature, etc.).

Working application with current solution runs on PC machine, but next iteration should be able to run on mobile devices utilizing OpenGL ES 3.0 as rendering API.

Keeping this in mind the question arise what is best method to simulate (preferably in real time) material removal from starting block ? Second question is what data structure and algorithms to utilize to achieve this goal.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Krzysztof
  • 61
  • 4

2 Answers2

0
  1. Voxel rendering

    You can use compression to free some memory. I would choose RLE at least for one axis (easy and fast) or divide space to layers and compress each as image ...

  2. list of 'cube' surfaces

    this is far better suited for your task. At start your material is single 3D box so imagine grid of points along the box surface. When you remove some material from side then just translate intersecting surface points to new position. When you drill a hole (so surface can not match the change) then divide surface to two new ... Choose the grid resolution (points per cube side not per [mm] !!!). I prefer to use cylindrical surfaces not cubic ones because they have just 3 sides (top,bottom,side) in comparison to 6 sides of cube/box.

    material structure

  3. layers of polygons

    Imagine that your space is sliced to 2D planes (images) then you can simply remember closed polygon lists per each slice. This is very similar to bullet #2. It is more manageable but harder to implement interactions with tools ... Also the rendering is little more tricky then in bullet #2

Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Can You suggest reading materials with detail explanation about methods mentioned by You. – Krzysztof Apr 11 '14 at 08:08
  • haven't see any anywhere ... most people use tries for meshes (but that is not good for this task). I started to use this variable surfaces for glass shaping simulation by special machinery. I saw to use this outside my code only once for silicon lithographer processing simulation and military purpose radiation shielding simulation for silicon based composite materials (like IC's) but not even I could possibly obtain the reference materials for that ... (saw only what they needed me to see for some consultations) – Spektre Apr 11 '14 at 08:44
0

As far as I know these simulations are performed on pixels, not on true geometry. Do you need the geometry of the remaining stock or a simple visual simulation is enough for your needs?

abenci
  • 8,422
  • 19
  • 69
  • 134
  • No, I only need to visualize progress on material removal and to visually validate finished model before running on real CNC. Can You elaborate on some methods, algorithms, research papers, etc. about performing such simulations on pixels ? – Krzysztof Apr 11 '14 at 08:03
  • I think he meant planar shapes like for cutting machines or plotters ,... on 3D shapes is this problem (you can drill holes in all directions not just perpendicular to top side of material ...) – Spektre Apr 11 '14 at 08:50
  • @Crucifixio: try googling for "GPU based toolpath simulation" – abenci Apr 14 '14 at 07:01