Talk:OSE Collaboration Protocol
Andrewusu's thoughts on FreeCAD git integration
FreeCAD v0.17 and newer
As of FreeCAD version 0.17 the WebTools Workbench allows Git integration through manual steps.
However *.fcstd files are binary files, specifically zip archives, and binary files aren't really suitable for version control tools like Git.
To prevent the explosion in space usage this mal-use would cause, a git filter should be set up for these *.fcstd files, such as:
- costerwi/rezip, But requires Java JRE 8 or newer...
- callegar/Rezip, written in bash, won't work on Windows (unless cygwin is used)
- Zippey, written in python, appears to be less optimal than the other two approaches.
costerwi/rezip appears to be the most suitable. However, FreeCAD in a future version will support better integration with version control without such workarounds and additional workflow steps.
FreeCAD v0.18 and newer
Has realthunder's Assembly3 workbench. Supports links, which help eliminate prior memory limitations with larger assemblies, and need for such workarounds like File_Simplification. So long as the linked document is opened and the link is frozen, the assembly is displayed within the parent document as a single unmodifiable geometry. When the linked document is closed it won't be displayed anymore in the parent document.
I think it would be best if when the Assembly3 workbench isn't active,
That a simplified view of the model is presented in the Combo view, without the Constraints, Elements, Parts and additional hierarchy that Assembly3 at present introduces to FreeCAD:
FreeCAD v0.20 and newer
realthunder has made changes in FreeCAD to better support Version Control, however he writes "It is still in my fork. I think this feature will most likely land in the next 0.20 release".
realthunder has put in the plumbing to allow an external tool/service to automatically manage the version control of the CAD files.
At this time the use of such beta features may be premature, but I imaging you'll want to migrate projects to use Assembly3 instead of Assembly2 anyway.
My envisioned solution
While the solution with the FreeCAD WebTools Workbench and rezip should work... better possibilities exist, which will:
- Better handle multiple documents, allowing re-use of work done (why invent the wheel twice!)
- Each linked sub-assembly of a parent assembly will have their own document, in their own git branch, with their own history, allowing other assemblies to make use of and update that subassembly without changing the original parent assembly.
- Transparent git integration
- End-user does not have to interact with git or do any additional steps, other than save and enter a commit message
- Service will notify user of any update to a document they're working on
Use FreeCAD v0.20 once available, or realthunder's present fork.
Set up a service to respond to the signals, e.g. [1]. The signal data will include what files were modified/deleted/added. The service will:
- Interact with git. e.g. Commit the changes to a new revision.
- Push the new commit to a remote repository, if a remote repository is designated in the document properties.
- Put sub-assemblies into their own branch, and use git sub-repo to include those sub-assemblies in a subdirectory in the main branch (likely master).
- If a remote repository was designated for any sub-assembly, the service will push any change for that sub-assembly to that sub-assembly.
In addition to the service:
- Add a means of adding properties to the document, so that the FreeCAD user can use the GUI to designate a remote version control repository to push/pull the changes to.
- Add a means for the user to enter a commit message when they save the document.
Annotated Visual History
I'm not sure what would be the most optimal way to implement Annotated_Visual_History.
A simple idea would be to have:
- An ".annotated_visual_history_cache" folder, which is listed in .gitignore (not versioned)
- FreeCAD on opening a version controlled directory without, to interact with the service as the service iterates through git revisions, to cache each revision. On each revision, FreeCAD can take a set of isometric snapshots rotating around the assembly, resized to say 64x64 px. An image processing utility will assign a complexity score to each snapshot, and the snapshot with the maximal complexity score will be selected as the thumbnail. A complexity score being a proxy measure of what image best illustrates the part!
- Filesize might suffice as an indirect measurement of complexity, the largest image being the most complex, otherwise,
- ImageMagick's identify might suffice, with a grep of a -verbose output, or a -features measurement.
- Have a FreeCAD workbench, such as the WebTools workbench, able to interpret the git log and these thumbnails in a meaningful way for the user
Related docs: Collaboration_Architecture, FreeCAD_101