Machining block

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Machining block

Post by chrisb »

Based on a discussion about the bounding box I would like to share my thoughts about a machining block and I would like to hear what you think about it.

When we model an object in FreeCAD we model it's outer shape. The "Contour" tool is aware of a projection and creates a path around it.

The raw material we start with encloses this object, it can be bigger in any dimension. Usually it is a block or a cylinder as these are readily available at the steel traders. Since standard sizes are much cheaper then custom sizes it is usually somewhat bigger than the bounding box. In fact it can even have an arbitrary shape as it can be a leftover from some other piece.

If the raw material is too big to be milled in one step with the desired step over the Contour tool should respect this and create a more complicated path.

I have the strong feeling that everything is ready to achieve this but I am not yet sure how I would like to define it:
  • We can model the raw material separately in FreeCAD. This would give maximum flexibility. Questions: Is this too complicated? How do we distinguish it from other objects modelled?
  • We could have a special path object. I think it would be sufficient to have boxes and cylinders. A possibility to place the object in the raw material would be necessary, e.g. when we have one (or two rectangular) plane sides on the object it could well be placed at the plane sides of the raw material. This can e.g. ease the placement of the holding tags.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
mlampert
Veteran
Posts: 1772
Joined: Fri Sep 16, 2016 9:28 pm

Re: Machining block

Post by mlampert »

I think you are spot on with everything you say - and the delay is definitely my doing. I started down that path but then, half way through, got side tracked by another project which has been taken up all my time for last few weeks. I will get back at it in late May.

The plan is to actually start using 'stock'. It already has some traces in the UI but never came to live. When you create a new Job there will be 2 options, use an existing object as stock or Job will create one for you. The latter will have some options as to it's sizing and positioning ....

Once a Job has a stock object it defines the staring and end depth of certain operations which should lead to less need to modify those. Further down the road the material of the stock object can also be used for tool pre-selection, feed and spindle speeds ...

Ideally we would generate a new stock object after each operation, which is then used as the base for the next one - don't hold your breath, this is probably far down the line at this moment. But it highlights that a stock object really can and should have any shape possible. In other words, any solid can serve as the stock object for a job.

Details will come as we get into it, but what I am aiming at is have a "Resources" object underneath "Job" which collects all job objects that are not operations, including stock, TCs, fixtures, .... and whatever else we come up with.

That's what I had planned anyway, unless we come up with something better before I can apply myself to it again ;)
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Machining block

Post by sliptonic »

The basics of a stock object are in place but not enabled. I'll add a pull request to turn it on so we can play. It just takes the part bounding box and builds a parametric object from it that let's you expand it in any dimension.

I think it would be easy and helpful to add at least two more 'types':

One would take the 2d projection of the outline (tech draw.findshapeoutline() and pad it to the part boundbox z height. It could also be expanded by offsetting to give a rough approximation of the shape.

The other would just be a custom part. So the user could model the starting "blank" or casting and then use it as a stock object.
chrisb
Veteran
Posts: 53919
Joined: Tue Mar 17, 2015 9:14 am

Re: Machining block

Post by chrisb »

Seems to be at the upper end of my expectations; great!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Machining block

Post by sliptonic »

Sent Pull Request 659. This doesn't do much yet but might help jump start the process.

This has a very simple parametric object and command to create it. If an object is selected in the tree, it creates the stock object and adds it to the project.
Some early improvements might be:

Make it find the base object from the Job rather than rely on user selection

Make it automatically create when the job is created or the base object is assigned.

Other 'styles' as discussed earlier.
ian.rees
Posts: 696
Joined: Sun Jun 15, 2014 3:28 am
Contact:

Re: Machining block

Post by ian.rees »

Arbitrary shapes as stock sounds great to me. Bounding boxes aren't really appropriate for machining castings, for instance.
mlampert wrote: Ideally we would generate a new stock object after each operation, which is then used as the base for the next one - don't hold your breath, this is probably far down the line at this moment.
That's something I've been mulling over too. I don't think it will be very hard to code up the basics of the geometry part, but might be quite slow running if we're not careful (due to boolean operations being slow).

An interesting problem here is visualisation - it seems like the input stock object should be a single item in the model tree, but it should also be easy to see what the stock looks like after each operation. Those subsequent versions of the stock probably shouldn't be modifiable except through the previous operations.

Does it make sense to show a semi-transparent version of the stock in the 3D view, along with the last Path? Or, maybe there could be a sort of "read only" stock item in the tree after each operation, and when it's selected that version of the stock is shown in the 3D view.
User avatar
sliptonic
Veteran
Posts: 3457
Joined: Tue Oct 25, 2011 10:46 pm
Location: Columbia, Missouri
Contact:

Re: Machining block

Post by sliptonic »

ian.rees wrote:Arbitrary shapes as stock sounds great to me. Bounding boxes aren't really appropriate for machining castings, for instance.
mlampert wrote: Ideally we would generate a new stock object after each operation, which is then used as the base for the next one - don't hold your breath, this is probably far down the line at this moment.
That's something I've been mulling over too. I don't think it will be very hard to code up the basics of the geometry part, but might be quite slow running if we're not careful (due to boolean operations being slow).
I'd love to see someone take a shot at this even if it's slow. Being able to calculate removed material would give us more than just visualization, it would give us the basis of 'rest' milling where an operation only works on the material missed by the previous op. I've tried some simple experiments with it but my programming-fu is not strong enough.
An interesting problem here is visualisation - it seems like the input stock object should be a single item in the model tree, but it should also be easy to see what the stock looks like after each operation. Those subsequent versions of the stock probably shouldn't be modifiable except through the previous operations.

Does it make sense to show a semi-transparent version of the stock in the 3D view, along with the last Path? Or, maybe there could be a sort of "read only" stock item in the tree after each operation, and when it's selected that version of the stock is shown in the 3D view.
I agree the stock should be read only; Much like the simple tool visualization we have now when you double click a tool controller.

I think it would be very intuitive to have a 'visualize stock' toggle button on the toolbar. If toggled on, you would see the stock object shown when you have a Path object selected in the tree. So, when you select the job, you'd see the original stock object as a semi-transparent ghost. If you select a lower level operation, you'd see the stock as it exists GOING IN to that operation. In other words, we would always show the shape the operation(s) are going to work on. If you want to see the result of an operation, you would either visualize the next op, or we would have some kind of 'simulation' tool. In other words we need to be consistent that we're visualizing the stock, not simulating the path.
Post Reply