Feature idea: blended fusion

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Posts: 162
Joined: Mon Mar 30, 2015 2:30 pm

Re: Feature idea: blended fusion

Postby jnxd » Thu May 11, 2017 4:41 am

So, DeepSOIC and I have been exploring the possibilities with blended fusion, and it appears that there are bugs in OCC at multiple levels that prevent us from actually implementing this feature right away. Blended fusion consists of three problems:
  1. Finding the fusion.
  2. Finding the (non-redundant) section edges, i.e. the edges at the interface between the objects, within the fusion.
  3. Performing the fillet itself on the section edges.
Finding the fusion is straight forward, but the other two problems are the bigger hurdles. I'll try to elaborate them here, but the text will be too geeky.

While section exists as a boolean operation, the edges that it returns have at their core different TShapes than those that are part of the fusion, and are necessary to make the fillet. To obtain those, we tried two methods: using BRepAlgoAPI_BooleanOperation::SectionEdges() within the C++ framework; and using generalFuse in Python. SectionEdges sometimes misses a few edges, especially the ones that were already there, or are parts of edges that were already there. Using generalFuse and then finding common edges between the "children" seems to be the way to go, but in one case I had a single vertex being returned as an edge, which might or might not affect the results.

Making the fillet itself also has its own bugs, ranging from the fillet creation simply failing to FreeCAD crashing. We suspect the redundant edges are again at play here.

DeepSOIC believes, and I agree, that due to these bugs, it is best to not incorporate them directly into the Part workbench, but to make a macro. By tonight or tomorrow I will create a simple macro for BlendedFusion for the rest of the community to play with and then we can decide whether or not to refine it, and maybe add other boolean operations too.
Posts: 162
Joined: Mon Mar 30, 2015 2:30 pm

Re: Feature idea: blended fusion

Postby jnxd » Thu May 11, 2017 7:15 am

Here's the promised macro (updated circa 20:40 IST). Select two solids and run:

Code: Select all

import MacroBlendedFusion
Edit: Added optionally arguments fillet_radius, base_obj and tool_obj.
(6.59 KiB) Downloaded 14 times
User avatar
Posts: 7810
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Feature idea: blended fusion

Postby DeepSOIC » Thu May 11, 2017 10:33 pm

Gallery of successes.
blf good 1.png
blf good 1.png (332.11 KiB) Viewed 379 times

Gallery of fails.
blf bad 1.png
blf bad 1.png (110.74 KiB) Viewed 379 times
blf good 2.png
looks good, but fails BOPCheck
blf good 2.png (280.19 KiB) Viewed 377 times