Many mesh processing algorithms expect reasonably well-formed manifold surface meshes. The same is true for PMP , where manifold meshes are assumed throughout and algorithms may fail in the presence of defects. However, many real-world meshes violate these assumptions in one way or another, making it difficult to understand the root cause of algorithm failures. To help with this, I recently added…
In mesh processing, we often assume ideal 2-manifold meshes consisting of a single connected component. In practice, however, meshes can be more complex: a single object may actually consist of many disconnected components, as shown in the image above. Depending on your application, you may need to detect these components for further filtering or processing. I recently added connected component…
I’m using Jekyll , a static site generator, to build this website 1 . I always have a number of work-in-progress draft posts floating around, some being merely vague ideas, others close to being ready for publication. Jekyll natively supports working with drafts : files you keep in your _drafts folder are not built by default. They are only included in the build when you explicitly tell Jekyll to…
Earlier this year, after reading Cal Newport’s Digital Minimalism , I decided to go on a digital detox for a period of 30 days. I stopped reading my usual news outlets, minimized smartphone usage, and avoided social media entirely. I really enjoyed the silence. Now that this period is over, I’ve started visiting some news sites again, although in a much more focused and targeted way. My smartphone…
In this article, I’ll walk you through the steps for adding code coverage testing using CMake and CTest. This is an addition to my previous article on code coverage testing for C++. Integrating basic coverage testing with CMake has become a lot easier since then. The pre-requisites are the same: I’m assuming CMake as a build system and gcc or clang as compiler. A Minimal Setup Let’s start with…
I’m doing a lot of code re-design and refactoring these days. One challenge is to change the implementation of a class or module while maintaining a stable interface for its clients. The ability to replace an old implementation with a new one without changing other parts of the code is extremely useful to ensure the correctness of the new implementation: it allows you to run integration tests with…
We just released version 3.0 of PMP , the Polygon Mesh Processing Library. This is a major version with several additions and API changes. Highlights include: A polygon Laplacian operator allowing several algorithms to work on general polygon meshes, including smoothing, parameterization, fairing, and curvature computation. The geodesics in heat method has been added. The algorithms API has been…
I recently simplified the PMP algorithms API. This was a somewhat embarrassing but also very rewarding experience. Embarrassing because the old code was just absurd in some cases. Rewarding because it made me question some deeply ingrained habits. In fact, this exercise changed my approach to API design. Want the short version? Here it is: Stop writing classes, use functions. Now, that’s of course…
As a C++ programmer, you are probably familiar with the following design question: Should you implement a function as a class member or as a free function? Not so sure about the answer? Well, let’s examine. An Example Here’s an example from the mesh processing library I’m working on. Let’s say you have a class SurfaceMesh for representing polygon meshes and you want to add a function that reads a…
I recently came across an awesome framework for creating better technical documentation: The Diátaxis framework developed by Daniele Procida. It is a well-structured system that you can immediately apply to improve your software documentation. The basic idea goes like this. Four Types of Documentation The framework distinguishes between four fundamental types of documentation. Tutorials Guides…
Simply inspiring, always giving me new impulses: Ten principles for good design by Dieter Rams . Good Design is Innovative The possibilities for innovation are not, by any means, exhausted. Technological development is always offering new opportunities for innovative design. But innovative design always develops in tandem with innovative technology, and can never be an end in itself. Good Design…
Nested namespaces used to be somewhat cumbersome in C++. You had to repeat the namespace keyword and by default each namespace resulted in an extra level of indentation: namespace pmp { namespace algorithms { namespace subdivision { // ... // your code here // ... } } } With a bit of tweaking, you could teach your IDE or clang-format to avoid the indentation: namespace pmp { namespace algorithms {…
We just released version 2.0 of PMP , the Polygon Mesh Processing Library. This is a major version with several additions and improvements as well as some API changes. Highlights include: Support for texture seams in SurfaceSimplification A new quad/triangle subdivision scheme A new SurfaceFactory class for generating basic shapes Error reporting using exceptions Improved compatibility with the…
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it. - Alan Perlis If you’ve been developing software for a while, you know that code has this natural tendency to turn into a mess. Keeping software simple over time is a challenge that keeps me thinking. My last post left you hanging without much concrete advice. This time I will outline a few high-level strategies…
Perhaps you already heard of the KISS principle . It’s an acronym for “keep it simple, stupid”. It states that most systems work best if kept simple. It’s a guiding principle in software engineering to favor simple solutions over complex ones. Simplicity as a design goal is one aspect of the KISS principle. I think another aspect is even more important, and that’s the temporal one: Keep it simple,…
Do you have unit tests for your code? Yes? Awesome! Do you know how much of your code is executed by your tests? No? Aww, don’t feel bad! This is what code coverage testing is for: it gives you detailed information on how much of your code base is covered by your test suite. This post describes how to add code coverage testing to your C++ project. I’m assuming you are using CMake as build system…
The other day, I was modernizing the PMP library code using clang-tidy . One of the suggestions was to use trailing function return types. I didn’t look too close at this C++11 feature before. Read on for a brief introduction and a summary of pros and cons. What’s This? Trailing return types are an alternative syntax introduced in C++11 to declare the return type of a function. In the old form you…
This is the short and sweet introduction to unit testing I always wanted to have as a reference for colleagues, friends, and family. Enjoy. What Is a Unit Test? A unit test ensures that an individual unit of code behaves as intended. A unit is a minimal chunk of code that can be tested in isolation , such as a function or a class. A test is not a unit test if it talks to a database, requires…
I started this year with one week of learning Rust and implementing a ray tracer from scratch using test-driven development. My primary goal was to learn more about Rust. I had a look at the language before, but I did not yet find the time to work on any substantial project. Writing a ray tracer from scratch is an ideal project for learning a new language. The task itself is straightforward, but…
Consistent error handling is a key feature of a high quality software library. Until recently, the mesh processing library I’m working on did a poor job in this regard. This gave me the opportunity to revisit C++ error handling. I took a few notes in between. Hope this helps you choosing an error handling strategy in your C++ projects. There are two major approaches to error handling in C++: Error…
Clang-tidy is a C++ static analysis tool from the LLVM project that is particularly helpful when modernizing your code base or when checking your code for compliance with established guidelines and best practices. Typically, you need to run clang-tidy with the same options and compiler flags you use for compilation. Doing this manually can be quite a hassle. One way to help with this is to use a…
I attended this year’s Symposium on Geometry Processing (SGP) , one of the premier conferences for publishing cutting-edge research in geometry processing. Here is my brief resume. The conference was scheduled to take place in Toronto, Canada. However, due to current circumstances, the conference was virtual only. In any case, the organizers did an awesome job organizing a top notch conference and…
Doxygen is the de-facto standard tool for C++ API documentation. It comes with a whole bunch of useful features such as auto-generated API documentation from annotated sources or automatic cross-references. Unfortunately, the default Doxygen HTML output is quite dated, both in terms of visual style as well as navigation. Here’s an example: Especially on mobile devices the resulting pages are…
Some ideas take time to flourish. Maybe digital gardens are one of those ideas. Is it just a hyped revival of the personal website or is there more to it? What Are Digital Gardens? A digital garden is a digital space to cultivate your thoughts, ideas, notes, and knowledge. Think of personal wikis and experimental knowledge bases. Digital gardens are curated and evolve over time, sometimes growing…
You cannot get a simple system by adding simplicity to a complex system. - Richard O’Keefe This is a style guide for clean and lean Jekyll websites. Its primary goal is to foster simplicity, performance, and maintainability. The contained guidelines are highly opinionated, totally biased, and somewhat radical. Nevertheless, I hope you’ll find some useful bits and pieces. No External Dependencies…
This is the last part of my brief series on procedural mesh generation of simple shapes in C++. The two previous articles covered generating Platonic solids and different types of spheres . I recommend reading the other articles first, especially if you want to try out the code yourself. This part covers the following primitives: Plane Cone Cylinder Torus As with the previous articles, the code is…
You know the frustrating experience: There you are, reading an interesting article, you click on that promising link… and all you get is a 404 page. If you are lucky, that is. Let’s try to do better than that. Fixing dead links will not only delight your esteemed readers but also make search engine crawlers happy. Here’s a simple way to check for broken links in your Jekyll-based website. The…
Spheres are one of the most basic geometric shapes we can think of. However, there are a variety of methods for generating surface meshes of a sphere. In this brief tutorial, I will describe four of them: UV sphere Icosphere Quad sphere Goldberg polyhedra This article is a follow-up on my previous tutorial on generating Platonic solids . I recommend reading it first since I will re-use parts of…
This is a short tutorial on generating polygonal surface meshes of the five Platonic solids in C++. You can learn a few basics of working with meshes along the way. I’m using the Polygon Mesh Processing Library for implementation. The code is straightforward, so you can easily adapt it to another data structure or programming language. Motivation My primary motivation for this article is very…
Now here’s a positive consequence of 2020: There are plenty of awesome resources on graphics and geometry available online for everyone to watch, enjoy, and educate oneself. Here’s my current watch list. Toronto Geometry Colloquium This is a regular online seminar presenting varying topics from geometry processing and related disciplines such as computational fabrication, graphics, or 3D deep…
This article provides practical tips on how to optimize the loading speed of your website. Some advice specifically aims at users of Jekyll , the blog-enabled static site generator. However, the basic ideas also apply to other tools and should therefore be easy to transfer. Note: This is an article written by and for the occasional web developer. If you’re a professional full-time web developer,…
Earlier this year, we were honored to be invited to give a presentation on our pmp-library at the SGP 2020 graduate school . Unfortunately, due to the special circumstances, the event was virtual only. The good thing is that a recording is available on YouTube: All other videos from the SGP graduate school are available online as well. Enjoy the show!
We just released a minor bug-fix release of the Polygon Mesh Processing Library, version 1.2.1. See the official release announcement as well as the full changelog for details. Have fun!
For the last decade or so I used Org mode for tracking tasks and taking notes. This worked reasonably well while I was mostly working full time on a single project. Nowadays, things are a bit more complicated. I usually have multiple projects going on both at work and in private. Over time, I ended up with a wild bunch of different .org files for different purposes floating around on different…
We just released a new minor release of the Polygon Mesh Processing Library, version 1.2. This release includes a couple new features, enhancements, bug fixes, and updates to third-party libraries. Highlights include: Improved rendering of general polygons, avoiding erroneous tessellation into overlapping/flipped triangles in case of non-convex polygons. Added support for rendering using matcaps.…
We just released the new version 1.1 of the Polygon Mesh Processing Library. This release includes a couple new features, enhancements, bug fixes, and updates to third-party libraries. Highlights include: An implementation of the hole filling algorithm by Liepa 1 An improved SurfaceSmoothing algorithm avoiding model shrinking 2 A new compile-time switch to choose between float or double as default…
Jekyll collections are a great way to group and process pages of related content. I’m currently using collections to build my publications page and associated project pages. This post provides a short rundown how to implement something like this. Add a Collection First of all, you need to add a collection to your Jekyll configuration file, _config.yml . In this case, I aptly name it publications :…
After years of contemplation, vivid discussion, crazy experimentation, and lots of hard work, we finally released the first official version of the Polygon Mesh Processing Library. Highlights include: A simple and efficient mesh data structure for storing and processing polygonal surface meshes Canonical geometry processing algorithms such as simplification, remeshing, subdivision, smoothing, or…
The Symposium on Geometry Processing (SGP) is one of the premier conferences for publishing cutting-edge research in—hold your breath—geometry processing. The conference also hosts a pre-conference graduate school every year, during which well-known researchers in the field present their perspective on fundamentals and current research trends. Starting from 2016, the organizers have recorded these…
Two standard books on ray tracing are now available online for free: Matt Pharr announced the availability of “Physically Based Rendering” Eric Haines announced the availability of “An Introduction to Ray Tracing” Even though personally I prefer reading such content on plain old paper, this is still great news for anyone interested in the subject. I can only congratulate the authors for taking…
A somewhat tricky question when it comes to unit testing is how to test components involving file I/O. Recall that a good unit tests should run fast and independent of its execution environment. A test involving file I/O inevitably breaks these rules, which is why some people don’t even consider such a test a unit test. Whatever your definition of a unit test is: There is a need for testing I/O…
I recently rewrote this site to use a custom Jekyll theme based on Bootstrap and Sass . I kept some notes during the process, and now I reworked them into this short guide on building a bare-bones Jekyll Bootstrap template. The following assumes you’re already somewhat familiar with Jekyll. If this is not the case, I’d recommend to head over to the Jekyll homepage first in order to learn some…
Extensive software testing is not a wide-spread practice in academic research. In this short argumentative post, I’ll outline some of the negative consequences this entails. In the end, I hope to convince you that testing is not only something for industrial software development but that it is also essential for doing research using software prototypes. From Bugs to False Results People with an…
I’m building this site using Jekyll , the simple, blog-aware, static site generator. While it’s a great tool overall, it comes with a major drawback when it comes to blogging: There’s no out-of-the-box support for comments. Some folks even maintain the view that a blog without comments is not a blog . I’ve been searching for a reasonable comment system for a while. The most wide-spread solution…
The Feynman Problem-Solving Algorithm: Write down the problem Think real hard Write down the solution That’s it. As simple as it gets, yet so difficult. Rumor has it that this was more of an allusion to Richard Feynman ’s legendary problem solving skills. Nevertheless, I find it highly useful for a couple of reasons: It reminds us that writing down a precise yet comprehensive problem definition is…
Time to put some of the unit testing guidelines I described last time into practice. In this post, I’ll go through some concrete examples improving the overall quality of a unit test suite. The pmp-library will serve as a practical example: Its current test suite is reasonably comprehensive, amounting to a test coverage of around 96%. Most of the tests, however, have been written in a rush,…
Comprehensive testing is a key aspect of developing high-quality software solutions. In this article, I’ll briefly motivate the use of testing, summarize what makes up a good unit test, and finally dive into some of the challenges when it comes to unit testing geometric algorithms. The Importance of Testing Over the last couple of years, extensive software testing has become a cornerstone of…
A minimal Markdown cheat sheet I keep around for reference. Only contains the elements I most frequently use. See John Gruber’s original spec for plain Markdown and this quick reference for kramdown , the default Jekyll Markdown parser. Element Syntax Headings # Level 1 ## Level 2 ### Level 3 Bold **bold text** Italic _italic text_ Monospace `monospace text` Unordered List - First Item - Second…
Heilmeier’s Catechism is a set of questions credited to George H. Heilmeier that anyone proposing a research project or product development effort should be able to answer. What are you trying to do? Articulate your objectives using no jargon. How is it done today, and what are the limits of current practice? What’s new in your approach and why do you think it will be successful? Who cares? If…
High-quality and easily accessible documentation is a key feature of an easy-to-use software library. Since ease of use is a primary design goal of the pmp-library, I recently spent some time polishing up the pmp-library documentation. We currently use Doxygen to build the full pmp-library.org website, including the user guide and reference documentation. As it stands today, Doxygen is the…