OCCT
OCCT copied to clipboard
Fillet can not round a face
Category
Modeling
Severity
Major
Description
I know this bug is in the original tracker 25478
When modeling existing parts, often fillets touch each other directly, meaning that there is no linear segment remaining, but they just have tangent (C1) point at which they touch.When trying to apply those fillets OCCT thrown a standard_error with "BRep_API: command not done"
but it has been 10 years since it was reported and there is no sign of any attention or progress done on this. Please someone needs to look into it since it feels like the most important problem now in FreeCAD
Expected Behavior
if the fillet radius is big enough that there are no linear faces remaining, it should round the face.
Actual Behavior
The fillet will work as long as the radius is small enough to keep some face remaining. if it is big it will not work.
Sample Code or DRAW Tcl Script
bugs modalg_7 bug25478_1, bug25478_2
pload MODELING
box Box 10 10 10
explode Box E
blend Fillet Box 5 Box_1 5 Box_3
#tolerance ang : 0.01
#tolerance 3d : 0.0001
#tolerance 2d : 1.0000000000000001e-05
#fleche : 0.001
#tolblend 0.01 0.0001 1.0000000000000001e-05 0.001
#
#the variable Fillet is left unset
#concave example
#generated by FreeCAD 0.15.4183 +7 (Git)
pload MODELING
box Box001 10 10 10
box Box002 10 10 12
ttranslate Box002 5 5 -1
bcut Cut Box001 Box002
explode Cut E
blend Fillet002 Cut 2.5 Cut_13 2.5 Cut_17 2.5 Cut_18
donly Fillet002
Operating System
Linux
Compiler
GCC
Bitness
64-bit
OCCT Version
latest
What do you mean by "round the face"?
-
Use the requested radius and leave sharp corners?
-
Change the radius to fit?
-
Just create some artibrary shape that looks "round"?
It may be easier to explain visually:
I have the following simple shape with height 10 mm
now I want to apply a fillet on all sides that is 4 mm, will work without any problem
because there is still a face connecting the 2 red fillets there is no problem so far.
now if I want to make the fillet 5mm that means they will touch and the grey face between them will have 0 mm length and will refuse to do the fillet with the error:
BRep_API: command not done
I hope this makes the issue a bit clearer, this is also in chamfer not just a fillet problem, let me know if you need any information or if I can be of any help.
I understand the issue. I have seen it many times.
The question is what should happen when the fillet cannot be completed as specified.
I don't know if it will be easy but the logic of this should be: If the fillet causes a face dimension to be 0 then delete that face.
What should happen in my example is the gray face that was 2 mm and became 0 mm due to fillets should be deleted and the upper and bottom fillets should connect as tangents. Does that make sense? I don't know if there is an easier way to make this work but that's how it is in other commercial CAD software.
OK, now they are tangent at the former face along the edge. What happens at the other ends? Sharp break in the curve? Changed radius of the fillet so that the other ends can be tangent to those faces?
In my example both the top and bottom fillets have the same radius so both of them would be tangent without changing any radius.
But if I understand you correctly you are asking what if they cannot be tangent due to radius difference or other constraints, from my experience in other CAD software, you should never change the other fillet's radius, keep the sharp corners and let the dimension changes in the user's control.
I don't know if this would help in the implementation, but I believe the behavior used by commercial CAD software is equivalent to performing the fillet on each edge loop separately and then taking the intersection. So in this example we would duplicate the part, perform the top fillet on one copy, perform the bottom fillet on the other copy, and then do a boolean intersection to get the final result. As long as boolean intersections don't have some other issue, this should work for both over-fillet and critical-fillet (as is used in this issue), so two birds with one stone.
any updates on this?
This one bug is pretty bad, with the Naming issue the fillet can cause this one is probably one of the biggest issues there are currenty for using OCCT for a CAD program. Are there any plans on working on this?
I've manually tested @dragazo's suggestion on a simpler version, filleting two edges until they overlap, seems quite promising
Interestingly, the concave example provided doesn't quite work in some other commercial CAD applications, such as OnShape.
However it does currently work in OCCT if you do the outer edges first then the middle one, so I think this should not be the focus for the issue for now.
And here is a "working" example for the "fillet" face reported in https://github.com/Open-Cascade-SAS/OCCT/issues/172#issuecomment-2508194883.
I've built a test naive-API that will do one fillet at a time then run the intersection, it works for these use cases but it is way slower than the previous approach (all-in-one).
Maybe we can surface the OneCorner : fillets have too big radiuses exception that is thrown on an higher level in the API and then execute this naive approach.
If anyone wants to test in FreeCAD, I'm sharing my test API here, I'll not open an PR for this because it is very simple and probably not adequate solution, since I'm pretty much duplicating the FilletAPI adding that feature. I think the best course would be to discuss how to surface this API, if we would extend the original BRepFilletAPI_MakeFillet, or something else.
https://github.com/angelobartolome/OCCT/commit/1b81bbbcc420ded437e347578e570b543853afb2
I understand why you don't want to add the solution in a PR in its current form but if we leave it for discussion it will be years before it is implemented, I recommend adding the PR since it is already better than what we have.
Also since Chamfers have the same exact problem do you think you can apply a similar fix to it?
does this have the Modified and Generated methods? freecad has to have those for its toponaming algorithm
Really nice work also the solution sounds very simple! Thanks for looking into this!
In any case, this concave situation wouldn’t be fixed, right? (1) is the geometry before applying the filet, (2) is when a fillet with radius higher than the step is applied.
does this have the Modified and Generated methods? freecad has to have those for its toponaming algorithm I think should yes 🤔, haven't tried yet since I'm doing my tests using the Draw Test Harness (Tcl scripts)
In any case, this concave situation wouldn’t be fixed, right? (1) is the geometry before applying the filet, (2) is when a fillet with radius higher than the step is applied.
![]()
I tried applying this and you're right, it is not working. Need to check for this case. I think it is related to the core issue about over filleting
I understand why you don't want to add the solution in a PR in its current form but if we leave it for discussion it will be years before it is implemented, I recommend adding the PR since it is already better than what we have.
Also since Chamfers have the same exact problem do you think you can apply a similar fix to it?
For chamfers yes, it is quite simple to replicate the "Naive" class. I can do it later today.
Do anyone know if there is some documentation and/or visual explanation on how the Fillet algorithm works? I'd like to go deeper to why it can't handle over-filetting. Looks like the logic is somewhere in ChFi3d_Builder_C1.cxx but it is quite hard to follow...
In an ideal world, would a fix for this problem make something like this possible?
https://github.com/user-attachments/assets/35f98378-3249-4402-9bed-6734abea4391
@LinuxinaBit I just tested it out, and I believe the solution I proposed (doing each edge loop separately and taking the intersection) would also make what you showed in Onshape possible in FreeCAD.
In the short term if you need this feature, you can always just explicitly dupe the part, do both fillets, and manually do the intersection.