← 输入框|github.com|刷新
Skip to content

Add chamfer and fillet tools #577

Open

Description

@Timmmm

It should be possible to select an arbitrary set of edges in 3D, and then click "chamfer/fillet", and have it nicely modified. Sometimes you can do this in a sketch with arcs, but often it is very tedious or impossible.

Most professional CAD tools include these as basic operations. For some reason they are usually separate tools but I think it makes more sense to have it as one tool with a "chamfer style" option which is "straight" or "rounded" (and a radius option).

Activity

  1. whitequark commented on Mar 31, 2020

    @whitequark
    Contributor

    This is unlikely to ever happen. The only open-source backend that natively supports chamfers and fillets is OpenCASCADE, and it (a) has an incompatible license, and (b) is a rather poor quality codebase, since it exists to sell consulting services.

    Although it would be technically possible to integrate OCE, it would create a situation where instead of a single version of SolveSpace limited in functionality there would be two versions of it, each inferior in its own regard, and so I am against doing so.

    I've looked into extending SolveSpace's NURBS backend a few years ago, and my conclusion was that the amount of work was prohibitive for a volunteer-run open-source project, requiring several people employed full-time for multiple years.

  2. ruevs commented on Mar 31, 2020

    @ruevs
    Member

    Hmm... I've personally "seen" you answer this twice. Perhaps a FAQ is in order?

  3. whitequark commented on Mar 31, 2020

    @whitequark
    Contributor

    Good idea.

  4. Timmmm commented on Mar 31, 2020

    @Timmmm
    ContributorAuthor

    That is a shame!

  5. whitequark commented on Mar 31, 2020

    @whitequark
    Contributor

    Yes, it's really unfortunate. A few years ago I was working much more closely on SolveSpace together with one full-time developer (@Evil-Spirit), and based on our discussions back then, I believe this is just not feasible for this project at this time.

  6. Timmmm commented on Apr 1, 2020

    @Timmmm
    ContributorAuthor

    What were the main problems, just out of interest?

  7. whitequark commented on Apr 1, 2020

    @whitequark
    Contributor

    Mostly it's just a lot of work to handle every possible case, and it's also work that needs to be done either with someone specializing in NURBS, or someone willing to invest a lot of time to learn the necessary math. I'm really happy to have @phkahler on board, who has been able to make very nice improvements to the NURBS code, but features like chamfers or fillets require a lot more effort to work well.

  8. phkahler commented on Apr 3, 2020

    @phkahler
    Member

    @Timmmm I can suggest reading the entire thread for issue #453 to get a little understanding of the issues.

    There are several problems, the primary one being the way surfaces and entities are represented internally be SolveSpace. Surfaces are completely separate from the editable/constrainable entities you can interact with. When you do an extrude or other operation that creates a solid volume, the new entities are created separately from the surfaces. When entities are dragged new surfaces are created. This disconnect means that the first problem for a generalized fillet or chamfer tool is to identify which surfaces are going to be modified by the operation - it might be possible, but internally it's not set up for that.

    The more conventional challenges are defining how existing surfaces need to be trimmed for the new edge features, figuring out what to do at corners (there are many special cases and different ways to cut there), and making sure there is proper continuity along the chamfer with regard to the U,V coordinates interpolated along both edges. There are a lot of papers written on this stuff, so we could pick something and try but then we end up facing the problem of SS internal representation that makes these things harder.

    Having said all that, I was working on some new tools that may work for some of the more common use cases. These will all work at the time of extrusion and include: adding draft angles to an extrusion, adding a chamfer of fillet to the top or bottom of an extrusion, and possibly a frustum tool. The issues with those (except frustum) is that the entities will not take on the new geometry of the surfaces. In some cases that's fine while in others it's not. I hope to get back to that effort to see what can be worked out.

  9. fortinmike commented on Dec 7, 2020

    @fortinmike

    That is indeed a shame :(

    For my personal (beginner) maker needs, it looks like fillets and chamfers are the only tools missing in Solvespace for me to make the designs I have in mind, which is mostly small objects and mechanical parts for 3D printing. That's too bad because I like Solvespace quite a bit! Much nicer to use (and more stable) than FreeCAD in my opinion. The workflow and keyboard shortcuts are just great.

    @phkahler I'd be very interested in tools to provide some fillet / chamfer capability even if it's not the "real deal". Consider this a +1 from me! Are you still working on this to some extent?

  10. phkahler commented on Dec 7, 2020

    @phkahler
    Member

    @fortinmike After v3.0 is done I want to get back to making new construction tools. I'm not sure which ones will make it but everything I've mentioned in various threads is still on my mind.

  11. pinpox commented on Mar 8, 2023

    @pinpox

    @fortinmike After v3.0 is done I want to get back to making new construction tools. I'm not sure which ones will make it but everything I've mentioned in various threads is still on my mind.

    3.1 is out, any news on adding fillet/chamfer tools?

  12. 2 remaining items

  13. reopened this on Apr 4, 2026
  14. ruevs commented on Apr 6, 2026

    @ruevs
    Member

    Looking at this more - the person doing this @g19fanatic definitely knows what they are doing - I'm totally unable to set up the (mixture of experts?) LLMs and prompt them correctly to generate all this... And the token budget must be pretty big as well...

  15. g19fanatic commented on Apr 6, 2026

    @g19fanatic

    @ruevs . The token budget isn't large at all. i think i've spent $15 in tokens on this so far. I use these toolsets for a lot of my development and have some custom tooling setups that enable quick turnarounds.

    I think i'm almost to an mvp (have been iterating through bugs). The screenshot you show is already some ways behind too.
    I'll clean everything up after the mvp is there.

    I wasn't going to mention anything or put in a PR until a felt it was useful just after the simple cases.
    Ya exposed me! hah

  16. phkahler commented on Apr 6, 2026

    @phkahler
    Member

    @ruevs I looked at a few of the documentation files it generated. Wish we had some good documentation like that, but they're also full of things I'd want to correct, or add detail. Then the code seemed really long for what it's seems able to do.

    @g19fanatic Did you see my PR #1501 ?? It contains an outline of how I was starting to approach this. As I was getting into it, it turns out there are some details missing. A lot of book keeping is necessary too, and if planned out I think it can be done fairly simply.

    One thing to not is that a chamfer will create two new curves offset within the surfaces joined by the original curve. A fillet will need those same two new curves, and can use the points of the original curve as the control points for the "middle" of the fillet (with proper weight modification).

    All of this needs to be tested with some kind of fake decision about which edges to apply changes to. Having the capability and plumbing it into solvespace are IMHO two very separate projects. I don't think AI is up to the task in either case, but I'm curious to see how it goes.

  17. g19fanatic commented on Apr 6, 2026

    @g19fanatic

    I have a rudamentory understanding of NURBs geo math and its been more of a hobby of mine ever since I got into 3d printing 10 years ago. I kicked off these AI session by specifically looking at other repo's codebases that execute these functions. The long/functions are almost direct clones translated to use solvespace's internal math libs. This obviously is missing the tedious book-keeping that is necessary as solvespace does it a little different than others.
    Almost all of those "findings" files are usually thrown away after a feature is in and documented for me. I usually keep the project_info folder in a separate branch for continuing to do more LLM work (or recreate it).
    I've been slowly working through the book-keeping bugs as they are found and continue to expand on the features.
    For simple cases, they're working pretty well atm. We'll see how far I can go and how much they can be cleaned up before I put in an actual PR.

  18. ruevs commented on Apr 6, 2026

    @ruevs
    Member

    but they're also full of things I'd want to correct, or add detail.

    Indeed me too. But at the same time I would NEVER spend the time and effort to write this kind of documentation.

    @g19fanatic Did you see my PR #1501 ?? It contains an outline of how I was starting to approach this.

    The LLM saw it ;-) And "thought" about it a lot :-)

    Details Code File Line Column
    1. phkahler's PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501 crash was due to COINC_OPP degeneracy from standard boolean C:\PAR\Projects\SolveSpace\git\findings\39-risk-assessment.md 472 19

    #1501 — "WIP add functions for creating chamfers and fillets to the NURBS kernel" (Draft PR, Dec 10, 2024) C:\PAR\Projects\SolveSpace\git\findings\14-github-community-requests.md 123 6

    URL: #1501 C:\PAR\Projects\SolveSpace\git\findings\14-github-community-requests.md 124 56

    Key technical insights from PR #1501 discussion: C:\PAR\Projects\SolveSpace\git\findings\14-github-community-requests.md 157 35

    | #1501 | WIP add functions for creating chamfers and fillets to the NURBS kernel | Draft PR | Dec 2024 | phkahler | C:\PAR\Projects\SolveSpace\git\findings\14-github-community-requests.md 242 4

    The SolveSpace community has clearly wanted chamfer/fillet since at least 2017. The feature is officially listed as "commonly requested" by maintainer ruevs. The core contributor phkahler has attempted an implementation (PR #1501, Dec 2024), identified the key algorithmic challenges, and offered architectural guidance. His final advice: "Next time I try I might limit myself to flat surfaces only just to get the basics down." This suggests the MVP strategy should be: C:\PAR\Projects\SolveSpace\git\findings\14-github-community-requests.md 248 226

    1. phkahler's PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501 concluded this approach tends to crash C:\PAR\Projects\SolveSpace\git\findings\16-boolean-pipeline.md 265 19

    Critical decision: phkahler's failed PR (#1501) revealed that using the standard C:\PAR\Projects\SolveSpace\git\findings\21-chamfer-group-design.md 56 47

    From phkahler's PR #1501 (the only prior attempt): C:\PAR\Projects\SolveSpace\git\findings\21-chamfer-group-design.md 564 21

    1. phkahler's existing fillet branch (PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501) — used the same face-pair approach. C:\PAR\Projects\SolveSpace\git\findings\23-edge-entity-design.md 207 45

    PR #1501 — "WIP add functions for creating chamfers and fillets to the NURBS kernel" C:\PAR\Projects\SolveSpace\git\findings\28-solvespace-chamfer-attempts.md 14 9

    This is the complete content of the new file created in PR #1501: C:\PAR\Projects\SolveSpace\git\findings\28-solvespace-chamfer-attempts.md 38 65

    Confirmed Working in PR #1501 C:\PAR\Projects\SolveSpace\git\findings\28-solvespace-chamfer-attempts.md 243 30

    equivalent to SolveSpace's MakeFromBoolean, but the key insight from phkahler's PR #1501 C:\PAR\Projects\SolveSpace\git\findings\30-cgal-and-geometric-algorithms.md 375 90

    1. This is exactly what phkahler's PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501 crashed on C:\PAR\Projects\SolveSpace\git\findings\32-group-generate-trace.md 224 40

    The cleanest approach (as phkahler confirmed via PR #1501) is: C:\PAR\Projects\SolveSpace\git\findings\32-group-generate-trace.md 262 54

    The reason: the standard MakeFromBoolean/MakeFromDifferenceOf pipeline fails for chamfer because the chamfer surface is coincident with the adjacent original faces, causing COINC_OPP degeneracy in the boolean classifier (confirmed by phkahler's crashed PR #1501). C:\PAR\Projects\SolveSpace\git\findings\36-synthesis-part1.md 164 262

    1. phkahler's PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501 confirms the hardest parts: partial shell modification is very difficult; starting with flat surfaces only is the right MVP scope. C:\PAR\Projects\SolveSpace\git\findings\36-synthesis-part1.md 310 22

    | #1501 | Draft PR: WIP chamfer/fillet implementation | Dec 2024 | C:\PAR\Projects\SolveSpace\git\findings\37-synthesis-part2.md 156 4

    PR #1501: The Only Implementation Attempt C:\PAR\Projects\SolveSpace\git\findings\37-synthesis-part2.md 158 9

    Confirmed: phkahler's PR #1501 crashed using boolean approaches. C:\PAR\Projects\SolveSpace\git\findings\37-synthesis-part2.md 250 31

    1. Direct topology injection (NOT boolean pipeline): The standard MakeFromBoolean/MakeFromDifferenceOf cannot be used due to COINC_OPP degeneracy when the chamfer/fillet surface is coincident with adjacent faces. Confirmed by phkahler's crashed PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501. C:\PAR\Projects\SolveSpace\git\findings\38-synthesis-part3.md 39 256

    2. New file src/srf/chamfer.cpp: Modeled after phkahler's PR WIP add functions for creating chamfers and fillets to the NURBS kernel #1501 structure, contains SShell::MakeFromChamferOf() and SShell::MakeFromFilletOf(). C:\PAR\Projects\SolveSpace\git\findings\38-synthesis-part3.md 49 69

    20. Phkahler PR #1501 Lessons Applied C:\PAR\Projects\SolveSpace\git\findings\38-synthesis-part3.md 930 21

    The architecture above directly addresses the root causes of PR #1501's crash: C:\PAR\Projects\SolveSpace\git\findings\38-synthesis-part3.md 932 66

    | PR #1501 Problem | This Architecture's Solution | C:\PAR\Projects\SolveSpace\git\findings\38-synthesis-part3.md 934 7

    analysis, community discussions (phkahler PR #1501), and analogous implementations in C:\PAR\Projects\SolveSpace\git\findings\39-risk-assessment.md 7 47

  19. ruevs commented on Apr 6, 2026

    @ruevs
    Member

    I've been slowly working through the book-keeping bugs as they are found and continue to expand on the features.
    For simple cases, they're working pretty well atm. We'll see how far I can go and how much they can be cleaned up before I put in an actual PR.

    I'm EXTREMELY curious how far the LLMs will get this... I've been following the field (of AI), as а side interest/hobby, for 26 years... the last 8 have been the most interesting by far :-)

    @g19fanatic In case you have not found this problem yet ;-)

    InsideFilletOnDoubleSidedDifferenceExtrude.zip

    Image
  20. g19fanatic commented on Apr 6, 2026

    @g19fanatic

    @ruevs
    Thank you!
    rect -> extrude -> rect on edge -> extrude difference -> fillet internal edge.
    Got it!
    Actually the fix i'm working on right now might take care of this issue too.

    If you want to start an issue on my clone so that we don't continue to jam up this thread w/ this feature issue?
    That'll help keep this thread cleaner.

    Re-AI - I've been in military distributed aircraft simulations for almost 17 years. c++ heavy environment. AI is relatively new for me though I've written my collection of toy CNNs in the past.
    It will definitely be interesting to see how far I can take this. I have a good feeling that we'll something pretty useful by the end.
    Now maintainable? thats the real question but I believe with enough documentation and distillation, it can be good.

  21. phkahler commented on Apr 6, 2026

    @phkahler
    Member

    @ruevs that looks like it's not limiting the surface to the trim portion of the SCurve. Something I'd realized yesterday is a single curve can have multiple trims which need to create separate fillets. Or in this case, only the segment that actually has a trim. For example, cut a box out of a box so it forms a U shape. the top edge will have 2 trims along the same edge with the center cut out between them. This was something I think I hadn't realized when I started looking at this. That means to "corners" of the fillets/chamfers are at the ends of the trims, not necessarily at the ends of the underlying curves. It sounds like @g19fanatic and his LLM pair programmer figured that out too.

    BTW I also thought edge features need to be applied after the boolean as is clearly happening here.

  22. ruevs commented on Apr 7, 2026

    @ruevs
    Member

    @g19fanatic since issues on your fork are not enabled I'll post this here:
    #1410 (comment)
    It's a model with many corner cases (pun intended :-D ) but with only flat surfaces (I created it while implementing the intersection boolean operation, and as you see both union and intersection still have bugs).

    You can change the second extrusion group g005_extrude to difference mode. It should provide plenty of fun corners to fillet and chamfer for you and the LLM ;-)

  23. g19fanatic commented on Apr 7, 2026

    @g19fanatic

    @ruevs sorry about that! issues and discussions are now enabled there.

    I'll take a look at 1410 too. my previous bugfix did not fix the above inside fillet example. working that now!

  24. g19fanatic commented on Apr 8, 2026

    @g19fanatic

    @ruevs

    Image

    works for both chamfers and fillets!
    Still have more to do though

  25. deleted a comment from mkyral on Apr 12, 2026
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