fornjot icon indicating copy to clipboard operation
fornjot copied to clipboard

Create builder API for `Solid`/`Shell` validation tests

Open hannobraun opened this issue 2 years ago • 4 comments

There are validation checks for Solid and Shell whose unit tests only test the failure case of those validation checks. They don't make sure, that the validation check passes for a valid model. This makes total sense, as creating a valid Solid/Shell is a huge pain with the currently available APIs.

As part of #42, I'm starting to work on better APIs for creating shapes. It makes sense to start with an API specifically tailored to these unit tests, as those would be a nice proving ground for the API design, and the result would immediately become part of an automated test suite.

I have already started working on this.

hannobraun avatar Mar 22 '23 08:03 hannobraun

I've made some nice progress here, as the references from merged pull requests above this comment can attest. I believe the new API is very promising. There's still work to do, but I'm hopeful that it can expand to cover use cases beyond the scope of this issue.

I'd still like to do the following, before considering this issue complete:

  1. [x] Migrate code that still uses the old builder API to the new one (which I might come to call the "operations" API; we'll see) where possible. There should be quite a bit of test code that can already be supported by the new API.
  2. [x] Merge the old builder API into the new builder/operations. The old API still covers some use cases that the old one doesn't. Merging those in would further proof out the concepts of the new API.
  3. [ ] Write unit tests for the Solid validation checks. Those currently don't have any. Writing them will require further expansion of the new builder/operations API.

Overall, unless there are some surprises waiting, this shouldn't be much more work.

hannobraun avatar Mar 24 '23 13:03 hannobraun

I've been back from vacation this week and have gotten back into this issue. I've been working on unit tests for the Solid validation checks, which required improvements and fixes to the operations API.

The main thing that's still in progress is an API for joining cycles together, where their edges touch. The last approach I tried didn't work out very well (turned out too hard to use). I have another idea that I'm hopeful about though.

In the meantime, I've submitted quite a few pull requests with all kinds of improvements and additions that came out of this.

hannobraun avatar Apr 21 '23 13:04 hannobraun

I've put more work into this issue since my last comment here (as evidenced by the list of pull requests above), but then I got side-tracked and forgot to update this issue.

I believe that my list above is still accurate, which would mean the only thing left to address here, is to write unit tests for Solid validation. I'm not sure what, if anything, is missing from the builder API to support those tests. The API has been evolving, and should be better than ever.

I'd like to see this finished, but I have other priorities right now. I'm un-assigning myself, and hope someone (maybe me, later) will have time to put this over the finish line.

hannobraun avatar Nov 30 '23 10:11 hannobraun

I've started working on this again, as part of the larger effort under https://github.com/hannobraun/fornjot/issues/2157.

hannobraun avatar Feb 21 '24 11:02 hannobraun