コード例 #1
0
def fillet(event=None):
    Box = BRepPrimAPI_MakeBox(gp_Pnt(-400, 0, 0), 200, 230, 180).Shape()
    fillet_ = BRepFilletAPI_MakeFillet(Box)
    # Add fillet on each edge
    for e in TopologyExplorer(Box).edges():
        fillet_.Add(20, e)

    blendedBox = fillet_.Shape()

    P1 = gp_Pnt(250, 150, 75)
    S1 = BRepPrimAPI_MakeBox(300, 200, 200).Shape()
    S2 = BRepPrimAPI_MakeBox(P1, 120, 180, 70).Shape()
    Fuse = BRepAlgoAPI_Fuse(S1, S2)
    FusedShape = Fuse.Shape()

    fill = BRepFilletAPI_MakeFillet(FusedShape)
    for e in TopologyExplorer(FusedShape).edges():
        fill.Add(e)

    for i in range(1, fill.NbContours() + 1):
        length = fill.Length(i)
        Rad = 0.15 * length
        fill.SetRadius(Rad, i, 1)

    blendedFusedSolids = fill.Shape()

    display.EraseAll()
    display.DisplayShape(blendedBox)
    display.DisplayShape(blendedFusedSolids)
    display.FitAll()
コード例 #2
0
def fillet(event=None):
    display.EraseAll()
    box = BRepPrimAPI_MakeBox(gp_Pnt(-400, 0, 0), 200, 230, 180).Shape()
    fillet = BRepFilletAPI_MakeFillet(box)
    # Add fillet on each edge
    for e in TopologyExplorer(box).edges():
        fillet.Add(20, e)

    blended_box = fillet.Shape()

    p_1 = gp_Pnt(250, 150, 75)
    s_1 = BRepPrimAPI_MakeBox(300, 200, 200).Shape()
    s_2 = BRepPrimAPI_MakeBox(p_1, 120, 180, 70).Shape()
    fused_shape = BRepAlgoAPI_Fuse(s_1, s_2).Shape()

    fill = BRepFilletAPI_MakeFillet(fused_shape)
    for e in TopologyExplorer(fused_shape).edges():
        fill.Add(e)

    for i in range(1, fill.NbContours() + 1):
        length = fill.Length(i)
        radius = 0.15 * length
        fill.SetRadius(radius, i, 1)

    blended_fused_solids = fill.Shape()

    display.DisplayShape(blended_box)
    display.DisplayShape(blended_fused_solids, update=True)