fornjot
                                
                                
                                
                                    fornjot copied to clipboard
                            
                            
                            
                        Replace builder API with partial object API
As part of my work on #1079, I've introduced a new [partial object API]. Please follow that link to learn more about it, there's quite a bit of documentation. This API grew out of the builder API and is designed to replace it. But so far, only some parts of the builder API have been converted into the partial object API. I expect that parts of the builder API will still exist when I finish #1079.
Eventually, all of the builder API should be migrated over. The following list reflects the current progress:
- [x] 
CurveBuilder - [x] 
GlobalCurveBuilder - [x] 
GlobalEdgeBuilder - [x] 
GlobalVertexBuilder - [x] 
HalfEdgeBuilder - [x] 
SurfaceVertexBuilder - [x] 
VertexBuilder - [x] 
CycleBuilder(https://github.com/hannobraun/Fornjot/pull/1169) - [ ] 
FaceBuilder - [ ] 
ShellBuilder - [ ] 
SketchBuilder - [ ] 
SolidBuilder 
If anyone is interested in taking a look, here's the process I've been using to migrate parts of the builder API:
- Copy a sub-module from 
buildertopartial::objects. - Update the builder structs to match the style and capability of the partial object structs:
- Change their name.
 - Make sure all of their fields are optional and reflect the fields of their full object variant.
 - Add 
with_methods for all of their fields. - Replace all of their 
build_methods withas_andfrom_methods. - Give them a single 
buildmethods that is the only code that has access toStores. 
 - Integrate them into partial object infrastructure (
Partial,HasPartial,MaybePartial). 
If in doubt, use the existing partial object API as a template, and always feel free to ask questions here.
I've replaced CycleBuilder with PartialCycle in #1169 and updated the list in the issue description.
~~That this isn't finished is causing me some trouble with other work. I'm going to start finishing this now.~~
Oops, this is the wrong issue. Please disregard.