Skip to content

Unexpected edge being filleted #2039

Open

Description

@bfedie518

I apparently don't understand how the selectors work. I would expect the following two code snippets to fillet the same edges.

result = result.edges("(>Z and >X) or (<Y and |Z)").fillet(0.5)

and

result = result.edges(">Z and >X").fillet(0.5)
result = result.edges("<Y and |Z").fillet(0.5)

When using result = cq.Workplane().box(5, 5, 5), the first line behaves how I would expect:

Image

The chained operations select an additional edge that doesn't fit with either set of filters:

Image

Can someone explain how this is working? The selector portions of the documentation don't seem to explain this behavior.

Activity

  1. lorenzncode commented on May 26, 2026

    @lorenzncode
    Member

    I could not reproduce it. Here is my result. I tested with both 2.7.0 and master (conda/pixi). Which version is this?

    import cadquery as cq
    from cadquery.vis import show
    
    result1 = cq.Workplane().box(5, 5, 5)
    result2 = result1.edges(">Z and >X").fillet(0.5).val().move(x=6)
    result3 = result1.edges("<Y and |Z").fillet(0.5).val().move(x=2*6)
    result4 = result1.edges("(>Z and >X) or (<Y and |Z)").fillet(0.5).val().move(x=3*6)
    
    
    show([result1, result2, result3, result4], width=800, height=600)
    Image
  2. bfedie518 commented on May 26, 2026

    @bfedie518
    Author

    I could not reproduce it. Here is my result. I tested with both 2.7.0 and master (conda/pixi). Which version is this?

    import cadquery as cq
    from cadquery.vis import show

    result1 = cq.Workplane().box(5, 5, 5)
    result2 = result1.edges(">Z and >X").fillet(0.5).val().move(x=6)
    result3 = result1.edges("<Y and |Z").fillet(0.5).val().move(x=2*6)
    result4 = result1.edges("(>Z and >X) or (<Y and |Z)").fillet(0.5).val().move(x=3*6)

    show([result1, result2, result3, result4], width=800, height=600)

    Image

    You're doing a separate operation for each cube. My second example is equivalent to chaining two fillets on the same cube.
    result = cq.Workplane().box(5, 5, 5).edges(">Z and >X").fillet(0.5).edges("<Y and |Z").fillet(0.5)

    In context I'm trying to fillet a part, make a copy of that part, then add some more fillets only to the copy.

    base = cq.Workplane().box(5, 5, 5)
    result = base.edges(">Z and >X").fillet(0.5)
    result2 = result.edges("<Y and |Z").fillet(0.5).val().move(x=6)
    show([result, result2])
    
    Image

    Version 2.7.0 downloaded via pip

  3. lorenzncode commented on May 26, 2026

    @lorenzncode
    Member

    Your selector is correct. So this is the CAD kernel fillet behavior for this scenario as far as I know. Another example.

    import cadquery as cq
    from cadquery.fig import Figure 
    
    base = cq.Workplane().box(5, 5, 5)
    result1 = base.edges("<Y and |Z").fillet(0.5)
    selected_edge = result1.edges(">Z and >X")
    result2 = result1.edges(">Z and >X").fillet(0.5)
    
    fig = Figure()
    fig.clear()
    fig.show(selected_edge, name="selected_edge")
    fig.show(result1, name="result1")
    fig.show(result2, name="result2")
    ipython
    run <file.py>
    
    Image
  4. bfedie518 commented on May 27, 2026

    @bfedie518
    Author

    Interesting. Is there a way to get the behavior that I actually want? Anything that would have the same effect as the Sketch reset() function?

  5. adam-urbanczyk commented on May 27, 2026

    @adam-urbanczyk
    Member

    This is not a selection issue (try with a chmafer) but rather a OCCT kernel issue.

    I can only make it work when doing the fillet in on go (NB: using unreleased selection combination operator | from #2038 ):

    from cadquery.func import *
    from cadquery.fig import *
    
    base = box(5, 5, 5,)
    res = fillet(base, base.faces('>X').edge('<Y') | base.faces('>Z').edge('>X'), 0.5)
    
    clear()
    show(res)
    Image
  6. changed the title [-]Unexpected edge being selected[/-] [+]Unexpected edge being filleted[/+] on May 27, 2026
  7. bfedie518 commented on May 27, 2026

    @bfedie518
    Author

    Ah, I understand now. Is there any chance it's an issue with how CadQuery interacts with OCCT? Or is it for sure a bug with the kernel itself?
    If it's the latter this issue can probably be closed. An issue will have to be opened on the Open Cascade Github instead.

  8. adam-urbanczyk commented on Jun 5, 2026

    @adam-urbanczyk
    Member

    AFAICT this is on OCCT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions