Skip to content

Single edge in list causes fillet to fail, works in isolation #955

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jwagenet opened this issue Mar 28, 2025 · 1 comment
Open

Single edge in list causes fillet to fail, works in isolation #955

jwagenet opened this issue Mar 28, 2025 · 1 comment
Labels
occt A bug with the OpenCascade CAD core

Comments

@jwagenet
Copy link
Contributor

A single edge captured with Edge.is_interior raises ValueError: Failed creating fillet.../OCP Standard_Failure for entire list, but can make a fillet individually

Excerpt

  edges = base_part.edges().filter_by(Edge.is_interior).filter_by(Axis.X, tolerance=10).sort_by(Edge.length)[-2:].sort_by(Axis.Y)

  # Fails
  fillet(base_part.edges().filter_by(Edge.is_interior), 5)

  # Fails
  fillet(edges, 5)

  # Works
  fillet(edges[0], 5)
  fillet(edges[1], 5)
  fillet(base_part.edges().filter_by(Edge.is_interior), 5)

Full script

from build123d import *
from ocp_vscode import *
from math import radians, tan

base_width = 42 * MM
base_height = 10 * MM
base_back_bottom_angle = 87
base_front_bottom_angle = 72
part_height = 80 * MM
base_length = 122 * MM

base_points = [
    (base_width / 2, 0),
    (base_width / 2 - part_height/tan(radians(base_back_bottom_angle)), part_height),
    (-base_width / 2 + part_height/tan(radians(base_front_bottom_angle)), part_height),
    (-base_width / 2, base_height),
    (-base_width / 2, 0),
    (base_width / 2, 0),
]

rect_width = 42 * MM
rect_height = 65 * MM
rect_back_spacing = 5 * MM
rect_bottom_spacing = 10 * MM
rect_rotation = 90 - base_back_bottom_angle
rect_offset_x = -rect_back_spacing - (rect_bottom_spacing + rect_height/2) * tan(radians(rect_rotation))
rect_offset_y = (rect_bottom_spacing + rect_height/2) - (base_width/2) * tan(radians(rect_rotation))
rect_length = 42 * MM

hole_diameter = 5 * MM
hole_z_offset = 20 * MM

with BuildPart() as base_part:
    with BuildSketch(Plane.XZ) as base_sketch:
        with BuildLine() as base_line:
            Polyline(base_points)
        make_face()

        with Locations((rect_offset_x, rect_offset_y)):
            Rectangle(rect_width, rect_height, rotation=rect_rotation, mode=Mode.SUBTRACT)
    extrude(amount=base_length/2, both=True)

    with BuildSketch(Plane.XZ) as rect_sketch:
        with BuildLine() as base_line:
            Polyline(base_points)
        make_face()
        with Locations((rect_offset_x, rect_offset_y)):
            Rectangle(rect_width, rect_height, rotation=rect_rotation, mode=Mode.INTERSECT)
    extrude(amount=rect_length/2, both=True)

   edges = base_part.edges().filter_by(Edge.is_interior).filter_by(Axis.X, tolerance=10).sort_by(Edge.length)[-2:].sort_by(Axis.Y)

    # Fails
    fillet(base_part.edges().filter_by(Edge.is_interior), 5)

    # Fails
    fillet(edges, 5)

    # Works
    fillet(edges[0], 5)
    fillet(edges[1], 5)
    fillet(base_part.edges().filter_by(Edge.is_interior), 5)

    show(base_part)
@gumyr gumyr added the occt A bug with the OpenCascade CAD core label Mar 29, 2025
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Mar 29, 2025
@gumyr
Copy link
Owner

gumyr commented Mar 29, 2025

This appears to be an OCCT bug that is outside of the control of build123d.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
occt A bug with the OpenCascade CAD core
Projects
None yet
Development

No branches or pull requests

2 participants