0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Hi abdullah,
The first animated Gif shows exactly what I would expect of the tool. Are you concerned because the arc of ellipse rotates a little bit? Sure it would be nice if its placement didn't change at all, but I wouldn't worry too much about it - after all it's just a matter of adding the appropriate constraints.
As for the unexpected result in the 3rd Gif, well, we already get wonky behaviour with the trimming tool, when trying to trim circles... I prefer a tool that acts wonky sometimes to a tool that is not available at all
The first animated Gif shows exactly what I would expect of the tool. Are you concerned because the arc of ellipse rotates a little bit? Sure it would be nice if its placement didn't change at all, but I wouldn't worry too much about it - after all it's just a matter of adding the appropriate constraints.
As for the unexpected result in the 3rd Gif, well, we already get wonky behaviour with the trimming tool, when trying to trim circles... I prefer a tool that acts wonky sometimes to a tool that is not available at all
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Not, ATM. But I think it could work by guessing an arc radius (like with line segments).
This is just aimed as filleting it. Constraints are needed to keep everything in place.Joel_graff wrote: ↑Tue Oct 16, 2018 8:09 pm That's really awesome. Nice that it's integrated into the existing tool, too - eliminates the need for geometry checking.
I wrote a monstrous amount of python code to achieve this same effect, but my results were exact. Still, this is a lot easier than anything I'd imagined.
Yes it is right. As Chris mentions it is also how it is determined with straight lines. I was important to me to understand that this is a filleting tool, not a connecting tool. It is possible to connect two curves using an arc tangential to both, but if curves (or the underlying untrimmed curves, ellipse in the case of arc of ellipse) do not intersect, then it is not filleting, but connecting.
Indeed, I think this is my problem. Maybe a curve that is CW having a basis curve that is CCW. I know exactly where it happens, so I need some extra debugging.
I am not worried about the rotation. I am more worried about the user getting overwhelmed by the tool. With line segments it is quite easy to see how the tool will make the fillet. With connected curves, due to the curvature, sometimes it comes to me as a surprise (admittedly it may be my limitation, that I am just not used). With curves that are not connected at all, the surprise effect is even higher.
I think I can fix the wonky behaviour. Afterwards, I will see if I make an Appimage so that you CAD profs can get a hands-on feeling of the tool and come back with comments.
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Right. I think between fixing the geometry in place with the block constraint and this new fillet tool, I'll be able to do "organically" in Sketcher what required a lot of ugly Python-scripted math on my part...
Great work!
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Hi abdullah
Do I understand you right? When you fillet two arcs, you will cut the arc at the point where the user clicked on the arc, then connect these two points with a new arc and set the tangent constraint a both connection points? Depending on the location of the click, the arc's have to be more or less adjusted.
One approach could be not using the clicking points directly for the cut, but for a starting point to search for a suitable new filletarc which fit tangential to both selected arc. The target would be to fit the tangential intersection point from the filletarc as near as possible to the clickpoint from the first selected arc. With this approach it should be possible to fit the fillet to both arcs without an adjustment of the radius of the original arcs. But this is quit challenging and I have no idea how such an implementation will look like.
Kind regards
Roger
Do I understand you right? When you fillet two arcs, you will cut the arc at the point where the user clicked on the arc, then connect these two points with a new arc and set the tangent constraint a both connection points? Depending on the location of the click, the arc's have to be more or less adjusted.
One approach could be not using the clicking points directly for the cut, but for a starting point to search for a suitable new filletarc which fit tangential to both selected arc. The target would be to fit the tangential intersection point from the filletarc as near as possible to the clickpoint from the first selected arc. With this approach it should be possible to fit the fillet to both arcs without an adjustment of the radius of the original arcs. But this is quit challenging and I have no idea how such an implementation will look like.
Kind regards
Roger
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
The current algorithm expects a correction. It is basically what you have described, but assuming the center of the arc is in the intersection of the normals at the clicked points. This cannot be true for an arc, as the radius towards each curve would be different.RogerK wrote: ↑Wed Oct 17, 2018 6:40 pm Hi abdullah
Do I understand you right? When you fillet two arcs, you will cut the arc at the point where the user clicked on the arc, then connect these two points with a new arc and set the tangent constraint a both connection points? Depending on the location of the click, the arc's have to be more or less adjusted.
It may be possible to improve the algorithm. The fact that the direction of the normal changes with position makes it a little bit more complicated. But if an exact math solution exists, then it shall be possible.
I am currently stuck with an issue that may be an OCC bug. Hopefully it is not.
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Well, the bug was not an OCC bug, but a FC bug. This was nice to solve.
In the meantime I have rewritten the code using offset curves. So basically, uses the radius magnitude given to the command (or estimates it as the distance between the given reference points). With this radius generates two offset curves (one for each curve to fillet) by the radius magnitude. It calculates the intersection of those offset curves. This is the center of the arc. Then it projects the intersection on the curves (calculates the closest point of each curve to the intersection). Then creates an arc between those points.
My expectation was that it won't move, not even a bit. Well, it does move a little bit:
In the meantime I have rewritten the code using offset curves. So basically, uses the radius magnitude given to the command (or estimates it as the distance between the given reference points). With this radius generates two offset curves (one for each curve to fillet) by the radius magnitude. It calculates the intersection of those offset curves. This is the center of the arc. Then it projects the intersection on the curves (calculates the closest point of each curve to the intersection). Then creates an arc between those points.
My expectation was that it won't move, not even a bit. Well, it does move a little bit:
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
This looks very good!
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Hi abdullah
This is awesome. Great job. I can't see any jumping either . But maybe I need new glasses.
Kind regards
Roger
This is awesome. Great job. I can't see any jumping either . But maybe I need new glasses.
Kind regards
Roger
Re: 0001304: Allow Sketcher to Fillet Arcs, Not Only Lines
Thanks guys!!
I am finding many tiny bugs, the kind you find when you do fillets between arcs of hyperbola and line segments and things like those.
It is for sure not PR ready yet (there are cases where it fails). I am not sure if it would be wise to include it in v0.18, as I am changing some decent amount of code and it would not have a long enough debug period... plus I get to tease you to start using v0.19 straight away. Who could live with an outdated version?
Look at the endpoint of the major axis of the left ellipse. It does move slightly when applying the tangency.
I am finding many tiny bugs, the kind you find when you do fillets between arcs of hyperbola and line segments and things like those.
It is for sure not PR ready yet (there are cases where it fails). I am not sure if it would be wise to include it in v0.18, as I am changing some decent amount of code and it would not have a long enough debug period... plus I get to tease you to start using v0.19 straight away. Who could live with an outdated version?