1. Overview
The Manufacture workspace is Eyeshot's manufacturing environment, which can be used to design a model, create a toolpath, simulate the milling process, and ultimately convert the model into a G-Code.
Currently, Eyeshot only supports three-axis, subtractive, CNC machining.
1. Design
The first requirement is to have some model to manufacture. We can manufacture any kind of model, from 2D regions to 3D Breps.
In this article, we will show how to (partially) manufacture the following simple region, a square with a hole in the middle.
CompositeCurve square = CompositeCurve.CreateRectangle(Plane.XY, 10, 10, true); // square centered in the origin
Circle circle = new Circle(Plane.XY, 3); // hole in the middle
Region region = new Region(square, circle); // final region to mill
It looks like this:
Now we need to express this same geometry as a machining geometry (i.e., an object derived from GeometryBase) that we will use later in this article. In our case, since we would like to mill a region, we are going to create a Geometry2D object as follows.
Geometry2D geom = new Geometry2D(region.ContourList, .1);
Please note that we also need to specify a tolerance to tessellate the geometry. It is important because no matter what kind of entities we provide, the toolpath will be created using a discrete representation of those entities (vertices and triangles). Therefore, make sure you specify a tolerance that is small enough to accurately represent the model.
2. Setup
Now that we have a model, the second object that we need in order to start manufacturing is the setup. The setup defines:
- The units that we would like to use (e.g. millimeters, inches).
- The work plane, that defines the orientation of the tool.
- Optionally, the stock, which represents the block of material to cut.
First, we are going to create a stock, so that we can simulate the milling operations. Since we have a 10x10 region, we will create a 10x10x1 box stock, centered on the origin.
Stock stock = Stock.CreateBox(-5, -5, 10, 10, 1);
Now we can create the setup. We are going to use millimeters as the unit, and the plane XY as our work plane (the plane where our 2D model lies).
Setup setup = new Setup("Top", linearUnitsType.Millimeters, Plane.XY, stock);
3. Tool
In order to compute the toolpath, we first need to specify what kind of tool we would like to use for our machining operations. The EndMill constructor has various overloads and parameters that we can use to shape the tool as we like. Eyeshot currently supports all APT-like tools.
Let us use the simplest available tool: the flat one. The first parameter is the radius (we will use 0.5), and the second parameter is the corner radius (we will use 0 to make the tool flat).
EndMill flat = new EndMill(.5, 0);
4. Machining
Eyeshot provides various kinds of Machining operations that can be used to compute toolpaths. For a complete list, search the documentation for all classes deriving from Machining.
In our simple example, we are going to create a Pocket2D operation to mill the hole in the region that we previously created. To do so, we can use the following code:
Pocket2D pocket = new Pocket2D(setup, flat, geom, new devDept.Geometry.Interval(0, 1), 0.3, 0.3);
Using the last two parameters, we can specify:
- The step-down: vertical distance between two layers of the toolpath.
- The step-over: horizontal distance between two cutting moves in the toolpath.
Every Machining operation is derived from WorkUnit, so we can invoke DoWork and the Result field will be filled with the final Toolpath.
pocket.DoWork();
The following is the result for our Pocket2D.
5. Simulation
Now that we have a toolpath we can simulate the cutting of the stock. Before doing so, there are a few fields of the manufacture environment that we need to set.
The stock is the ideal representation of the material we are going to cut, but the stock object by itself does not contain any vertices or triangles. For this reason, we need to convert the Stock to a SimulationStock, which is the actual entity that we will see in the viewport during the simulation.
manufacture.SimulationStock = stock.GetSimulationStock();
We can also specify a tolerance other than the default if we find our simulation stock to have a lower resolution than expected.
Other than the stock, we need to set the setup, the toolpath, and the tool before we can start the simulation.
manufacture.SimulationSetup = setup;
manufacture.SimulationToolpath = pocket.Result;
manufacture.SimulationTool = flat;
Now we can start the application, press play, and evaluate the results of the simulation.
Comments
It is a very clear description.
Please sign in to leave a comment.