Skip to content

How to create a concave fillet between two joined parts and subsequently remove the lower (helper) part #1434

@AJ110011001

Description

@AJ110011001

Problem Description:
The goal is to add a filleted transition at the bottom of Part 1.
To do this, BRepAlgoAPI_Fuse is used to fuse Part 1 with a helper Part 2, and then BRepFilletAPI_MakeFillet is applied to the intersection edges between the two parts to create concave fillets, resulting in Part 3.
The objective is to remove the original helper Part 2, keeping only the transition fillet.

Observed Behavior:
Using BRepAlgoAPI_Cut to subtract Part 2 from the fused Part 3 does not fully remove Part 2.
A small thickness must be left behind, otherwise an error occurs:
File "d:/xx.py", line 469, in
display.DisplayShape(cut1, update=True)

However, if a new helper Part 4 is created and BRepAlgoAPI_Cut is used to retain the lower portion (the fillet) of the original Part 2, the operation succeeds and displays correctly.

Using BOPAlgo_Splitter to split Part 3 at the interface with Part 2’s surface also results in unwanted extra faces being retained.

Additional Notes:
Part 1 is geometrically complex, with a convex fillet on the back side that gradually transitions to a radius of 0 (actually set to 0.001 in the code, since using 0 directly causes the fillet to fail). This transition ends exactly at the bottom face.

If Part 1 is a simple cylinder and Part 2 is a box, then BRepAlgoAPI_Cut successfully removes Part 2 after the fillet is added.

It is also observed that when applying a convex fillet to two colinear edges, the maximum fillet radius cannot reach half of the edge length. For example, for a cube with edge length 10, the fillet radius cannot be 5 when applied to two parallel edges.

Expected Behavior:
1.Be able to completely remove the original helper Part 2, preserving only the added fillet.
2.Be able to define fillet radii from d/2 down to 0, enabling a smooth transition with radius approaching zero.

Some of the code is as follows:

##filleted ##
filletD32 = BRepFilletAPI_MakeFillet(rectangle_L2_H_shapeD32 )
filletD32.SetFilletShape(FSH)
parAndRad2 = TColgp_Array1OfPnt2d(1, 3)
parAndRad2.SetValue(1, gp_Pnt2d(0, 0.001))
parAndRad2.SetValue(2, gp_Pnt2d(0.5, D/2*(1/2*(L_R2/(L_R2+L2)))*2))
parAndRad2.SetValue(3, gp_Pnt2d(1, D/2
(L_R2/(L_R2+L2))**2))
edgesD32 = []

edge_explorerD32 = TopExp_Explorer(rectangle_L2_H_shapeD32 , TopAbs_EDGE)
while edge_explorerD32.More():
    edgeD32 = topods_Edge(edge_explorerD32.Current())
    edgesD32.append(edgeD32)
    edge_explorerD32.Next()

edges_to_filletD32 = [3,2]

for edge_indexD32 in edges_to_filletD32:
    if edge_indexD32 < len(edgesD32):
        filletD32.Add(parAndRad2, edgesD32[edge_indexD32])  
        #print(f"Applied fillet to edge {edge_indexD32}")
    #else:
        #print(f"Edge index {edge_indexD32} is out of range")
resultD32 = filletD32.Shape()

##Remove the bottom part (Part 2)##
box2 = BRepPrimAPI_MakeBox(gp_Pnt(-D2,-H,-3H),4D, L+L1+2H, 2*H).Shape()
cut1 =BRepAlgoAPI_Cut(filleted_shape4,box2).Shape()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions