Spent last weekend hacking on the section tool in FreeCAD and it finally works

Oct 16, 2026 Last reply: 1 day ago 6 Replies
Jump to replies (6)

So I finally got my improved clipping feature working in FreeCAD and pushed it as a pull request. The built-in cut view always bugged me becuase when you slice thru an assembly you just get flat colored faces and it's hard to tell wich component is which, expecially where parts sit right next to each other. My version adds distinct hatching per part, so a cross-section through something like a hydraulic arm actually reads like a proper engineering drawing. Boom, cylinders, linkages, all get their own pattern and it's way easier to follow how things overlap. I've been testing on Linux all week and it seems solid, but I only have this one machine. If anyone here runs Windows or macOS and feels like compiling the branch and poking at it, that would help a lot. Curious if people find this genuinely useful or if it's just something that bugs me alone. The PR is #33186 over on the FreeCAD repo if you want a look.


I ran into exactly this problem last year when I was documenting a rebuild of my garage door opener mechanism. Cut the assembly in half and everything turned into a wall of same-colored faces, coud not tell the rail from the carriage without rotating the model ten times. Ended up taking screenshots and annotating them by hand in Inkscape, which was tedious but at least made the parts readable for the guy helping me. The per-part patterns thing makes sense to me because that's how the drawings at my old job worked, every component in a section got its own line style so you could trace it through the cut. Nobody had to guess which plate was which even when three of them were stacked in the same view.

I'm on Windows 11 with a Ryzen box and I'd be willing to try building your branch this weekend. Fair warning that my compile attempts on this machine have been hit or miss in the past, ussually tripping over missing dependencies, but if it goes through I'll slice a few of my own assemblies and report back what the patterns look like on my end. One thought while testing: try it on parts with curved surfaces meeting flat ones, that's where I remember the old section views looking muddiest.

I'm on a 2021 MacBook Pro running macOS, so I can maybe help with the testing side, though I build from source maybe twice a year and my memory of the compile flags is fuzzy. Happy to pull your branch this weekend and see if it even builds on Apple Silicon, since that's where a lot of third-party patches seem to fall over first. On the usefulness question, I'll give you an honest mixed take. For my own stuff I mostly design single printed parts, like when I modeled a replacement bracket for my fence gate latch, so a cut view is just checking wall thickness and I don't need hatching there. Where I did want somthing like this was laying out a drawer organizer with a dozen boxes inside a case, and honestly what worked for me was making the outer box translucent instead of cutting it. I could see everything inside and never lost the sense of the whole shape. That said, for the few times I needed actual documentation I exported a section view into TechDraw anyway, and it applies its own hatch patterns there. So my workflow kind of skipped the 3D viewport entirely. I'll still compile and try yours, but that's the angle I'd push back on: is the viewport the right place, or are most people who need readable sections already going through TechDraw for output?

One thing I'd flag before the Windows folks burn a weekend on dependencies: is the hatch pattern anchored to the model or to the screen? If the lines are generated in screen space they'll crawl around when you orbit or zoom, which looks fine in a static screenshot and terrible the moment you actualy work with the model. Also curious whether the pattern scale stays constant relative to part size or relative to view, since a tiny pin and a big housing cut in the same section will want very diferent line spacing to stay legible.

I'd happily test something like this but my setup is Linux only too, so I'm in the same boat as you on coverage.

The question I'd want answered before testing is wheather this carries over into TechDraw, because that's where I'd actually use it. I put together section views for a client's machine manual a while back, something like 14 cut views across the document, and shading every part a different color was the only way to keep them readable on paper. Patterns would have saved me hours of fiddling. Also worth checking how the hatching behaves on tiny parts. If the pattern scale is fixed, a 5mm spacer next to a 150mm bracket is going to end up with either mush or one lonely line, and printed at A4 that's exactly where things fall apart.

I'd throw another thing at it if I get it built: tiny parts. I've got a printer assembly with a bunch of small screws and bushings packed togehter, and I bet the hatching turns to mush at that scale. Might need some kind of minimum spacing or it'll just look like gray noise on the little pieces.

Also can't help wondering how it does with a hundred-part model. My big assembly chokes the current cut view pretty bad already, so if the pattern generation adds much overhead that'd be a dealbreaker for me. Happy to stress test it on that if the build cooperates.

Update: got some time to dig in over the weekend. The screen space question was the big one, and sure enought my first pass anchored the hatching in screen space, so it swam around when I orbited. Rebased so the pattern sticks to the model now and it behaves properly while zooming. TechDraw carryover is on the roadmap but not in this PR, needs more work. macOS build tester, my branch is up whenever you get a minute.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required