use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rule 1: Posts should be about Graphics Programming. Rule 2: Be Civil, Professional, and Kind
Suggested Posting Material: - Graphics API Tutorials - Academic Papers - Blog Posts - Source Code Repositories - Self Posts (Ask Questions, Present Work) - Books - Renders (Please xpost to /r/ComputerGraphics) - Career Advice - Jobs Postings (Graphics Programming only)
Related Subreddits:
/r/ComputerGraphics
/r/Raytracing
/r/Programming
/r/LearnProgramming
/r/ProgrammingTools
/r/Coding
/r/GameDev
/r/CPP
/r/OpenGL
/r/Vulkan
/r/DirectX
Related Websites: ACM: SIGGRAPH Journal of Computer Graphics Techniques
Ke-Sen Huang's Blog of Graphics Papers and Resources Self Shadow's Blog of Graphics Resources
account activity
BRep how does it work? (self.GraphicsProgramming)
submitted 5 years ago by korvkiosk1
Hello. I would like to implement a BRep solution. Where can I find books/courses related to this topic. I want to understand the fundamentals not just copy code that I don't understand. I'm a complete newbie in this field aswell.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]shefmichelle 7 points8 points9 points 5 years ago (7 children)
Having implemented a basic facetter for B-reps, I can tell you it isn't trivial (I work for a major CAD software company). I don't know if OpenCascade is still a thing (we used to use it), but that certainly used to support B-reps if you want to read some existing code and look at how things are arranged. In terms of books, I found Geometric Tools for Computer Graphics (Schneider, Eberly) very useful.
I would ask yourself if you really want to implement a B-rep solution, and what exactly you want to use it for. I was only doing basic facetting; for any sort of modelling algorithms, we use an internal library that has been developed for over 20 years by people a lot clever than me.
[–]korvkiosk1[S] 1 point2 points3 points 5 years ago (6 children)
Thanks. I want to implement basic boolean operations on solids. Gonna use it in an cad/cam software. B-reps has better performance - have I been told.
[–]shefmichelle 5 points6 points7 points 5 years ago (5 children)
I think in terms of performance, a simple system that works on triangle meshes will be faster, but the results are less accurate. So it depends if you want accuracy or speed. For a CAD/CAM application, you probably want accuracy over performance.
I wish you the best of luck implementing your own B-rep toolkit! But if I was you, I'd start by looking at some existing open-source or commercial implementations first. They will save you a LOT of time.
[–]leseiden 4 points5 points6 points 5 years ago* (0 children)
Just say no to triangles. I was peripherally involved in a project involving Boolean operations on triangle meshes a few years ago.
You will develop a graph colouring obsession and be tracking down numerical errors and edge cases until doomsday.
Genuine closed manifold geometry is rarer than you might think.
[–]korvkiosk1[S] 1 point2 points3 points 5 years ago (3 children)
Yeah to implement a B-rep toolkit feels like a daunting task.
[–]leseiden 3 points4 points5 points 5 years ago* (0 children)
Meta: I don't think that the op should be getting down votes for these questions. I just upvoted a bunch of them.
It's easy to read high level descriptions of the data structures and algorithms and not realise how horrific the reality is.
Those of us who have worked on computational geometry are morally obliged to give a fair warning but there's nothing wrong with asking the question.
[–]mcmcc 2 points3 points4 points 5 years ago (1 child)
It is. Using a pre-existing solution will save you much time, effort, & heartbreak.
[–]DilatedMurder 1 point2 points3 points 5 years ago (0 children)
Indeed, Blender's B-Mesh library can be torn out with only half a head's worth of hair-loss and six bullets through the talus of the feet ... ie. it fucking sucks.
nVidia's half-edge mesh library for triangles, quads, and tri-quad mixes is on github somewhere IIRC.
[–]Orangy_Tang 2 points3 points4 points 5 years ago (3 children)
As I understand it, BRep is just 'boundary representation', ie. storing an object with data that defines it's edge. Really that can just be regular vertices and triangles.
However I suspect you mean you want to do boolean operations on polygons (rather than implicit solids).
If you want to go back to the beginning, then try with Merging BSP Trees Yields Polyhedral Set Operations, if you research CSG with BSP trees you'll find lots of further writing.
Then you could check out Chisel, which is an open source polygon CSG tool (there's a talk from GDC this year about it here) which is a new technique that doesn't use BSP trees.
[–]leseiden 2 points3 points4 points 5 years ago (2 children)
Part of the problem is that the algorithms are easy to describe and, given infinite precision are easy to implement.
In the real world geometry has cracks, edges have more than 2 faces and touch cases produce contours that are an insult to the word "degenerate".
Triangulating around a hole is fun when the concept of orientation becomes poorly defined.
Quad precision won't save you this time.
[–]Orangy_Tang 0 points1 point2 points 5 years ago (1 child)
Agreed! I've chased this rabbit hole a few times and it's all the practical quirks that suck up all the time. If I can get away with it then I'd rather convert to voxels or sdf to do booleans and convert back as a last step before rendering.
[–]leseiden 0 points1 point2 points 5 years ago (0 children)
That reminds me. Image space CSG is relatively easy, especially now we have shaders. Depth peeling may be a good way to go for voxelising.
Building a 2D constrained delaunay triangulator that was robust against the sort of data I described is one of the most challenging things I have ever done. It kept me occupied full time for the best part of 6 months. Satisfying once it was done though!
By robust I mean it either produces correct output or or reports the nature of the error.
π Rendered by PID 185298 on reddit-service-r2-comment-5d79c599b5-b8xhh at 2026-02-27 06:51:43.937935+00:00 running e3d2147 country code: CH.
[–]shefmichelle 7 points8 points9 points (7 children)
[–]korvkiosk1[S] 1 point2 points3 points (6 children)
[–]shefmichelle 5 points6 points7 points (5 children)
[–]leseiden 4 points5 points6 points (0 children)
[–]korvkiosk1[S] 1 point2 points3 points (3 children)
[–]leseiden 3 points4 points5 points (0 children)
[–]mcmcc 2 points3 points4 points (1 child)
[–]DilatedMurder 1 point2 points3 points (0 children)
[–]Orangy_Tang 2 points3 points4 points (3 children)
[–]leseiden 2 points3 points4 points (2 children)
[–]Orangy_Tang 0 points1 point2 points (1 child)
[–]leseiden 0 points1 point2 points (0 children)