Proposal description
The essence of the proposal is to research how to achieve true variant parts in FreeCAD in order to achieve improved support for parameterization. This research will target both FreeCAD users and FreeCAD developers as audience and it will be focused on 1) explaining users the current problems of variant parts in FreeCAD and the potential of the functionality that this research proposes as a solution, 2) and keeping a potential solution manageable in terms of complexity if the FreeCAD core needs to be changed.
This proposal builds on the current work on VarSets and the problems that emerged with an early implementation in #12532, an earlier iteration of this proposal in #3, and the discussion with @yorikvanhavre and @shaise (see summaries of the discussions in both links).
This project will attempt to improve on copy-on-change links and configuration tables in order to address the various issues that this functionality has for parameterization, such as reliance on temporary hidden files as is the case for SubShapeBinders, and hidden references, functionality that poses a risk to make FreeCAD models brittle. This conversation explains the shortcomings of Spreadsheet configuration tables well and in my humble opinion the same is true for variants based on SubShapeBinders.
The ultimate goal is to provide FreeCAD users with what I call an Application Geometry Interface (see #12120) something that is to the best of my knowledge not possible in other CAD programs (other than coded CAD solutions). Adding this functionality would align with objective Streamlined Workflow, but also with objective Prevent shooting yourself in the foot).
Deliverables
The research will be presented in three different ways:
- forum posts for users,
- forum posts for developers, and
- PRs that are targeted at developers.
The research is conducted by developing code and this code is presented in various PRs possibly with alternative implementations. The forum discussions for developers and users allows the community to make decisions in preferred implementation direction, or – for example – to understand the trade-off in added functionality in relation to the added complexity in the FreeCAD core.
- Forum posts for users:
- Explain current options for variants and their problems, making use of videos.
- Explain the potential of variant parts by means of videos.
- Forum posts for developers: Provide context on the issues and PRs, and provide the community with options in implementation direction.
Expected PRs on three different topics, there may be PRs that have the same functionality but different implementations:
- PRs for referring to child properties: In this set of PRs we investigate how a parent document object can refer to properties of child document objects while attempting to maintain the DAG for recomputation and preventing dependency cycles.
- PRs for omputing shapes for variants: In these PRs we investigate how to compute shapes for variants from a base part without relying on hidden copies of a base part or hidden temporary files. This forms the basis for the next set of PRs.
- PRs for variant parts: With these PRs we investigate to what extent we can create variants in a similar way to SubShapeBinders without the requirement to have temporary documents given the solution from the previous PR.
Since this is a complicated topic with potentially low level changes to FreeCAD's core, the forum posts will serve as a way for the community to discuss
- what functionality the community would like,
- the tradeoff between changes in FreeCAD's core and the functionality the solution provides and,
- implementation variants and direction.
Timeline
- Forum posts explaining the problem and potential: Start in September, finish end September
- Refer to child properties: Start in Oktober, finish end of Oktober
- Compute shapes for variants: Start in November, finish end of November
- Variant parts: Start in December, finish end of December
Risks and mitigation
I would like to carry out this work as an independent contractor.
A risk of this project is that this is a challenging topic as is apparent in the lengthy discussions in #3. After discussion with @yorikvanhavre and @shaise, it is clear to me that we need to find a way to involve the community and this modified proposal tries to improve on that. This project should really be regarded as a research project that may result in the conclusion that there is no better solution than what FreeCAD currently has or that the required changes are too large or complex for FreeCAD's core. However, because the potential of the anticipated functionality is so high, I think it is more than worth of investigating the proposed functionality. Without a doubt, it will provide us with a better understanding of the challenges at hand to support the above functionality.
To mitigate the risks, this work can be considered to have two stages where stage 1 is independent from stage 2 and useful on its own:
- referring two child properties and
- variant parts.
A solution for stage 1 is useful on its own and it will touch the issue of cyclic dependencies. Currently, it is not allowed in FreeCAD to refer to child properties because of cyclic dependencies, so it is necessary to find a solution for the proposed behavior, possible by making informed decisions on where to allow a cyclic dependency. Any knowledge that we gain in this area, allows us to find solutions for other problems regarding cyclic dependencies.
Although stage 1 can be regarded as independent of stage 2, the latter depends on stage 1 and requires solutions for dependency management because if a property of a variant part is changed, we need to recompute based on the source document object. At this time not clear how to properly manage dependencies.
Compensation
I would like to carry out this work with for a total of 8000 EUR.
About you
My name is Pieter Hijma (pieterhijma
on the forum and pieterhijma
on GitHub). I'm an independent contractor (https://pieterhijma.net) and as a co-founder of the Open Toolchain Foundation, I would love to contribute to improve FreeCAD as it is an important part of open toolchains. This functionality is inspired by my personal issues regarding modularity as a FreeCAD user. For example, my post on my Fab Academy program already mentions using different categories for parameters.
I have been working on Variable Sets as an independent contractor for Ondsel. This work can be regarded as an extension of that work, but with a more fundamental solution that was out of the scope of the Ondsel contract. In that sense, I have experience contributing to FreeCAD and experience relevant to this proposed work.
I haven't worked on similar software before but I have solved similar tasks that are more architectural of nature before. An example is the Cashmere project ([1], [2]) that needed a clean interface between two existing systems.