Lens/FreeCAD Integration

Lens Addon and FreeCAD fine-grained recomputes

Since the last post I have been working on the Lens addon and fine-grained recomputes in FreeCAD. In the Lens addon, I have added support for switching instances and for profiles. The fine-grained recomputes work is phase 1 of the implementation of what I proposed in enhancement proposal FEP-0010: Variant Parts.

Lens Addon enhancements

The Lens addon now supports not only switching instances, but also profiles which enable you to seamlessly switch between different Lens servers. The most important Pull Requests (PRs) are:

This led to a new release of the Lens addon version 2025.11.21.01 which is now available through the FreeCAD Addon Manager!

To make this happen, quite some issues needed to be solved, some of which included the Ondsel Lens server as well. They mainly involved setting up the server for a development environment to test the profiles.

There is also an issue on the server that I can't easily solve myself and affects the Lens addon:

The addon itself has seen some improvements as well, mostly related to managing versions for the addon (package.xml) and adding pre-commit and CI support for linting and remaing REUSE compliant:

Finally, I've updated the FreeCAD forum and there is a First Robotics Competition team working in FreeCAD that set up an Ondsel Server as well:

Fine-grained recomputes

For the work on fine-grained recomputes I submitted a PR. Important links:

The discussion on enhancement proposal FEP-0010: Variant Parts is ongoing. I brought it up again at FreeCAD developer meeting on Saturday 15 November. I introduced the changes that I made as a result of the discussion, mostly introducing a separation of concerns between "true" input properties and exposing properties.

Input properties allow you to refer to parent document objects from child document objects without needing complicated constructs such as hidden references that are not user-friendly. Exposed properties allow users to express the design intent which properties are meant to parameterize a part.

Support for fine-grained recomputes and input properties has been implemented in PR #25603: Fine-grained recomputes. It maintains a graph of dependencies between properties by means of inlists and outlists of dependency edges, edges that describe an edge in the dependency graph between properties. This PR tries to add this functionality with minimum changes to the original code, adding a runtime switch to recompute with the old coarse-grained dependency checking and with the new fine-grained dependency checking. The PR also adds various tests, some of which should work for both coarse-grained recompute, some only for fine-grained recomputed, and some only for coarse-grained recomputes. I hope this PR can help improve the discussion on the topic.

Enhancement Proposal Variant Parts

On this page, I will describe the progress I make on the NLnet Lens/FreeCAD integration project. In this post on the enhancement proposal for variant parts. Important links:

One of the first tasks is creating an enhancement proposal for Variant Parts. An enhancement proposal is a formal process to introduce large new changes to FreeCAD. Since the discussion may take a while, I focused on this part first.

Variant Parts are not only useful for parametric modeling, they are also useful for the Lens platform. The variant parts give users what I call an "Application Geometry Interface" in the form of properties that users can change to parameterize a part. This Application Geometry Interface serves two purposes: It makes it possible to create a variant by changing one of these properties. It also make it possible for the Lens platform to provide users these properties on the website to parameterize the parts.

With the Variant Parts enhancement proposal, the FreeCAD community can be involved before the code has been written for a change as large as this one. Since this proposal has already been preceded by the Research Variant Parts project (outcomes here), I have been able to move this proposal from the "Draft" staged to "Proposed" stage. We will now have a period of discussions before which this proposal will hopefully move to the "Accepted" stage.