How can I program dynamic body substraction?

1 view (last 30 days)
Lucas
Lucas on 12 Feb 2013
Hello! Unforunately I am new to programing in MatLab. My problem concerns the simulation of a tool which goes through a workpiece and substracts its volume each time tool an workpiece interfere.
I'd like to create a rigid and solid body model of the workpiece composed by cubes with length of 1mm. The complete body should be a cuboid with length 200mm, with 200mm and depth 50mm. Afterwards I'd like the tool to be represented by a cylinder of variable diameter (it depends on the tool diameter of course) and length. The tools' volume must'nt change if tool and workpiece interfere. I'd like the cubes of the workpieces volume to disappear each time there is interference. The substraction of the workpiece volume should last for the rest of the simulation.
I got a time-based vector that contains the position of the tool.
It's xyz_t=[x(i); y(i); z(i)] with i=1:length(t)
For each moment I defined the interference-condition:
ccut=[]
for i=1:length(t)
if xmin(i)<=x(i) && x(i)<=xmax(i) && ymin(i)<=y(i) && y(i)<=ymax(i) && zmin(i)<=z(i) && z(i)<=zmax(i) ccut = 1: else ccut = 0; end % of if end % of for
This works for the first step of machining but after that the surface has changed, so that zmax(i) is 2mm lower than before.
So how can I automatically change the volume that the simulation does not use the initial value of the volume every single step of the interference-check?
Thank you very much for your time. Help is appreciated!

Answers (0)

Categories

Find more on Computational Geometry in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!