Geometric accuracy parameter
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Geometric accuracy parameter
I'd like to add a parameter to Job objects, and a corresponding setting in Path Preferences, for the geometric tolerance to use when calculating paths.
The current use case for this is in surface path generation; we need to tesselate the geometry before feeding it in to OCL, and there is a tradeoff between computer resources (read: time) and the path accuracy.
I think this should be a fairly low-impact addition; could set the default value to 0.01mm. Any thoughts/objections? -Ian-
The current use case for this is in surface path generation; we need to tesselate the geometry before feeding it in to OCL, and there is a tradeoff between computer resources (read: time) and the path accuracy.
I think this should be a fairly low-impact addition; could set the default value to 0.01mm. Any thoughts/objections? -Ian-
- sliptonic
- Veteran
- Posts: 3459
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: Geometric accuracy parameter
sounds good. Give some thought to giving it a user friendly label and tool tip. I think you did a good job of describing the function/trade-off and I hate to see things get labels like 'tolerance' where the user has no clue what changing it will do.ian.rees wrote:I'd like to add a parameter to Job objects, and a corresponding setting in Path Preferences, for the geometric tolerance to use when calculating paths.
The current use case for this is in surface path generation; we need to tesselate the geometry before feeding it in to OCL, and there is a tradeoff between computer resources (read: time) and the path accuracy.
I think this should be a fairly low-impact addition; could set the default value to 0.01mm. Any thoughts/objections? -Ian-
Re: Geometric accuracy parameter
https://github.com/FreeCAD/FreeCAD/pull/666 submitted. In addition to adding the parameter, the second commit changes the meshing slightly to control resolution based on deflection rather than maximum length - it's considerably faster. -Ian-
Re: Geometric accuracy parameter
Hi Ian,
with what tolerance it is calculating now?
On working with metall 0,01mm tolerance is to big if you think for professinal use to... There should be a posibility where to go down to a tolerance of at least 0,001mm somwhere, but i'm with sliptonic: not with an allways visible "selection field".
with what tolerance it is calculating now?
On working with metall 0,01mm tolerance is to big if you think for professinal use to... There should be a posibility where to go down to a tolerance of at least 0,001mm somwhere, but i'm with sliptonic: not with an allways visible "selection field".
Gruß Herbert
Re: Geometric accuracy parameter
I agree with herbk that the proposed default tolerance is probably a bit too coarse for many applications.
Does this change really improve anything other than meshes and surfaces? Should the new tolerance be applied only to those cases?
For me, other Path operations such as profiling, pocketing, drilling, contouring, facing, etc. are essentially instantaneous with the current tolerance. No obvious need for a change in those functions.
As long as it can be set in preferences it should not cause a big problem, but I am sure I will want to make my "default" a lot tighter.
Gene
Does this change really improve anything other than meshes and surfaces? Should the new tolerance be applied only to those cases?
For me, other Path operations such as profiling, pocketing, drilling, contouring, facing, etc. are essentially instantaneous with the current tolerance. No obvious need for a change in those functions.
As long as it can be set in preferences it should not cause a big problem, but I am sure I will want to make my "default" a lot tighter.
Gene
Re: Geometric accuracy parameter
I agree with Gene that it is desirable to keep the tolerance for the non-surface operations as they are. They are useful and not expensive. For surfacing I don't have a problem with a configurable parameter. I would call it e.g. surfacing_tolearance to make things clear.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Geometric accuracy parameter
Currently, the mesh generation is done by setting a maximum length parameter, which if I'm understanding correctly, limits the length of the sides of facets in the mesh. I changed it to use deflection; how far vertices are allowed to land away from the source surface, which is more like a traditional linear machining tolerance. The two schemes are relatable only with more information about the shape.herbk wrote: with what tolerance it is calculating now?
That facet edge length limit is currently set to 2mm. Here's an example showing the source part, and the two different meshing schemes with the discussed parameters. On my machine, with a release build of FreeCAD and this shape, the old way takes ~8 seconds, the new one is maybe 1.5.
Sure, that's not a good enough final tolerance for some jobs. But, there's a lot more that goes in to precision (especially at that level) than this meshing parameter.herbk wrote: On working with metall 0,01mm tolerance is to big if you think for professinal use to...
For example - the drop cutter algorithm uses just enough passes to cover the part with the selected cutter. So, the tolerance of the machined part is a function of the diameter of the cutter. If you want a part finished to 0.1mm using the surfacing operation, you'll need a cutter that's approximately that diameter. Have fun with your 0.001mm endmill .
The vast majority of the PR is about creating a parameter and a preference to set the default value. Change it to whatever you want.herbk wrote: There should be a posibility where to go down to a tolerance of at least 0,001mm somwhere
Sorry, I'm not understanding what this means?herbk wrote:but i'm with sliptonic: not with an allways visible "selection field"
Re: Geometric accuracy parameter
At this point, the new parameter is only used for the generation of meshes that are used inside the surfacing operation. I suspect that Path will end up with other scenarios where a similar parameter is required, so I think the answer to your question is "yes, but nothing else is changed".GeneFC wrote:Does this change really improve anything other than meshes and surfaces?
Some problems have closed-form solutions where there's no need for a tolerance, others don't. Tesselation of curved shapes is inherently an approximation problem, so there will always be a tradeoff where a parameter like this is required. This is just about exposing that tradeoff to the user (and using a form of the parameter that's a little more intuitive and a lot more efficient - see my previous post).GeneFC wrote:For me, other Path operations such as profiling, pocketing, drilling, contouring, facing, etc. are essentially instantaneous with the current tolerance. No obvious need for a change in those functions.
Re: Geometric accuracy parameter
I think that will end up causing problems, because next time we need a similar tolerance (and I suspect that will be sooner than later) this one will have to be renamed or a new one added.chrisb wrote:I would call it e.g. surfacing_tolearance to make things clear.
Re: Geometric accuracy parameter
Hi Ian,
hm, it seams that we are talking about different things, I have had in mind the dimensions of the produced part only...
But if you change in PathSurface.py in the lines
the "cutter = ocl.CylCutter(self.radius * 2, 5)" to "cutter = ocl.CylCutter(self.radius * 0.0x, 5)" (could be anything else of course) you get a stepover in the size you need and a nice surface.
hm, it seams that we are talking about different things, I have had in mind the dimensions of the produced part only...
As my picture in viewtopic.php?f=15&t=21308#p165402 shows, it does not...For example - the drop cutter algorithm uses just enough passes to cover the part with the selected cutter.
But if you change in PathSurface.py in the lines
Code: Select all
def _dropcutter(self, obj, s, bb):
import ocl
import time
cutter = ocl.CylCutter(self.radius * 2, 5)
pdc = ocl.PathDropCutter() # create a pdc
pdc.setSTL(s)
pdc.setCutter(cutter)
pdc.minimumZ = 0.25
pdc.setSampling(obj.SampleInterval)
Gruß Herbert