New tool: Draft_Fillet, prototype implementation

A forum dedicated to the Draft, Arch and BIM workbenches development.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: New tool: Draft_Fillet, prototype implementation

Postby vocx » Sat Aug 31, 2019 4:09 pm

carlopav wrote:
Fri Aug 30, 2019 10:21 pm
...
PS, this should work also with different flows of the command (when selecting 2 edges and running fillet, waiting for user to input radius).
This is basically how it works at the moment, so I don't know how to poll the scene to start showing the tracker at the right moment. I need to see how other commands do it, and test this.
PS2, dont know if already implemented, but would be nice to be able to set a radius=0 and to have the 2 edges joined together
I think this could be done simply by calling Draft Wire or internally Draft.makeWire(). If two lines are touching, they are joined and converted into a single wire.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: New tool: Draft_Fillet, prototype implementation

Postby vocx » Wed Sep 04, 2019 6:28 pm

The previous pull request #2472 was a fluke.

Hopefully, now it works in pull request #2492.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
dimitar
Posts: 153
Joined: Thu Jun 13, 2019 6:10 am
Location: UK
Contact:

Re: New tool: Draft_Fillet, prototype implementation

Postby dimitar » Thu Sep 12, 2019 9:33 pm

vocx wrote:
Thu Aug 29, 2019 2:19 am
dimitar wrote:
Wed Aug 28, 2019 6:22 pm
This is probably outside of the scope, but I am curious why there's such a discrepancy between the sketcher toolset and the draft toolset. Ie. fillet in sketcher and offset in draft. I imagine they are being developed with different scopes in mind?
You are under the impression that FreeCAD is a well planed software. It is not. One dude, let's call him Jürgen, decided to implement some OCCT functions in a program in order to have a free CAD system, and he did, and that's how FreeCAD and the Part workbench were born. Then, years later, Yorik decided to add a bunch of code for 2D drawing in order to be usable for architectural plans and thus Draft was born. The Sketcher and Draft have different scopes because they were developed by different people with different objectives. The sketcher relies on constraints and a solver to produce planar geometrical shapes that could be padded to produce complex solids, while Draft was more intended for simple geometry creation (no constraints) to produce blueprints, like those architects need.

Draft has basically developed on its own, using Python wrappings around the complex C++ code that is Part. Nobody thought about some master plan and making the tools behave the same; everybody just added code on their own to produce the results they wanted.
That's a good but if history. Thanks for sharing.
vocx
Posts: 5206
Joined: Thu Oct 18, 2018 9:18 pm

Re: New tool: Draft_Fillet, prototype implementation

Postby vocx » Thu May 14, 2020 3:41 am

The Draft_Fillet was implemented in #2441. However, since we started the reorganization of the workbench, it was hidden from the interface in #2970, git commit 01df7c0a63.

In #3449 it was restored in the new workbench structure, with object, viewprovider, make function, and Gui Command in separate modules.

The object is pretty basic, and it essentially only works with two Draft_Lines, not even two Draft_Wires.

I think it could be improved in the following ways:
* Create a fillet by selecting any two edges of solids, lines, wires, etc. The object should figure out the selected edges.
* Optionally link to these edges, so it can automatically update if the edges change size.
* Dynamic adjustments of the radius of curvature. Currently it's fixed. It should also calculate a maximum radius possible. This could be taken from the current Draft Wire code, because this Wire object can also create fillets in the corners of its lines.
* The Gui Command should display a tracker (ghost) with the tentative radius.

Anybody is welcome to look at the code and try to improve it. This Draft object essentially calls the internal DraftGeomUtil.fillet function for the calculations, so maybe some improvements can be done here as well.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.