Rethinking the "Part Library"

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Rethinking the "Part Library"

Post by chennes »

A few weeks ago we merged a new metadata file format for use with addons: in the current master this is only used for manually-installed Preference Packs, but I'm currently working on modifying the Addon Manager to make use of this new metadata information. In tandem with that development, we've gotten a few reports of problems installing the FreeCAD "Parts" addon, probably due to its huge size (the zip file is nearly 4gb).

I'd like to take this opportunity to brainstorm a better long-term solution to our Parts library. It's not getting any smaller! I'd bet that most users only use a few parts out of it, so I'm wondering if there's a better way to allow people to just download selected parts on-demand. Of course you can already do this by hand, but since the addon manager is getting some new capabilities right now, the time is right for considering new ways of thinking about the parts library.

One idea I have is to create a new type of addon called "part" -- this is in addition to the existing or forthcoming "workbench", "macro", and "preferencepack". The metadata file would list out the usual metadata for each part, and include a direct download link. Then, either the Addon manager, or some new "Part manager" would present this metadata for users, who could select one or more individual parts to download on-demand.

Another idea is to create a "partlibrary" package type -- the idea is similar to the above, but instead of being one part at a time, it's whole collections of parts. This is more difficult to implement because right now there's no mechanism to clone or download those folders: ideally we'd need to split them into their own git submodules.

Alternately, if we go the git submodule route, we could just stick with the existing addons setup (no new tag needed) but list out those part submodules instead of, or in addition to, having users download the whole thing.

There are probably hundreds of other possibilities, those are just the ones on my mind as I work on Addon Manager this afternoon. What are you ideas and thoughts on this?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Adding Parts as a new type of add-on?

Post by M4x »

Did you have a look at how KiCad is doing the distribution of there footprints? They've changed it a while ago. I assume to solve basically the same problem.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Adding Parts as a new type of add-on?

Post by Zolko »

chennes wrote: Sat Oct 23, 2021 5:46 pm One idea I have is to create a new type of addon called "part"
I think that your idea is great, but please choose another name as "part" because that one is used and abused all over in FreeCAD.

chennes wrote: Sat Oct 23, 2021 5:46 pm Another idea is to create a "partlibrary" package type
I prefer such a library to individual parts. What's more, it's quite straightforward to do in FreeCAD to have a single document containing many parts and bodies, and then copy or link only one of them
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Adding Parts as a new type of add-on?

Post by chennes »

Zolko wrote: Mon Oct 25, 2021 6:26 am please choose another name as "part"
:lol: True enough! Got a suggestion?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
drmacro
Veteran
Posts: 8867
Joined: Sun Mar 02, 2014 4:35 pm

Re: Adding Parts as a new type of add-on?

Post by drmacro »

chennes wrote: Mon Oct 25, 2021 3:33 pm
Zolko wrote: Mon Oct 25, 2021 6:26 am please choose another name as "part"
:lol: True enough! Got a suggestion?
FWIW

When I'm discussing FC I avoid using the word part, I specifically use a phrase; referring to Part workbench, Part Design workbench. I avoid using the word part to refer to a solid.

I typically use the word component. For instance a bolt is a component. A Body for use in an assembly, I refer to as a component.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: Adding Parts as a new type of add-on?

Post by adrianinsaval »

is it posible to have a web interface for the library and use it in the app like this addon: https://forum.freecadweb.org/viewtopic.php?f=8&t=62131
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Adding Parts as a new type of add-on?

Post by Zolko »

chennes wrote: Mon Oct 25, 2021 3:33 pm
Zolko wrote: Mon Oct 25, 2021 6:26 am please choose another name as "part"
True enough! Got a suggestion?
Component Library ?
try the Assembly4 workbench for FreCAD — tutorials here and here
marcin86
Posts: 92
Joined: Fri Dec 20, 2019 1:20 pm
Location: Poznan/Poland

Re: Adding Parts as a new type of add-on?

Post by marcin86 »

@Chennes - fantastic work with Add-on manager:) and of course fantastic work all Freecaders :)

I think it will be nice to include in Freecad:
- sheet metal (other story)
- bolts / nuts (Fastners)

or make new function on "Addon manager" - Library parts:

1) Add to "Addon manager" new type of add-ons "Library parts" - PICTURE 1
2) Include/merge to Freecad -> Freecad-library but empty version " - PICTURE 2
https://github.com/FreeCAD/FreeCAD-library
3) Add "Add part from library" to Assembly3 - PICTURE 3

How mechanical designer works? I create some parts +-10, then I assembly them, then I add some fasteners and make constrains - so "Add part from library" should be in assembly module.

What should be in Add-on manager - library to chose (separated)
-> Fasteners
-> Beams
-> Flanges
-> Piping elements
-> Architekture stuff
-> .....

If i don't need clamps, doors, roof I don't download them - only what I need :)

So in future: Add-on manager - Packages:

Freecad Mechanical - Package
include workbench: sheet metal, ...... ,....
include library: bolts, nuts, beams

Freecad Piping-Mechanical - Package
include workbench: dodo, ...... ,....
include library: pipes, flanges ATME, fitings

Freecad Offshre-Mechanical - Package
include workbench: dodo, ...... ,....
include library: lifting padeyes, .... ,.........

Freecad BIMguys - Package:
workbenches: Texture, ......
include library: doors, roofs, windows

Freecad Electricalguy - Package
include workbench: ...., ...... ,....
include library: electric connectors , .... ,.........

Have nice day!
Marcin
Attachments
PIC3.PNG
PIC3.PNG (67.63 KiB) Viewed 4985 times
PIC2.PNG
PIC2.PNG (391.12 KiB) Viewed 4985 times
PIC1.PNG
PIC1.PNG (43.31 KiB) Viewed 4985 times
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Adding Parts as a new type of add-on?

Post by chennes »

I am leaning in the direction of a "smarter" Parts Library addon. Right now it's just a blind download of all of these files. I think instead the Parts Library addon itself could be made more intelligent, and not actually download any part until it was told to do so. Maybe it could use the GitHub REST API to do the part fetching, and only use git to synchronize the list of available parts? The tree-based structure of the library would make it easy to download either individual components or entire tree branches. This doesn't require a new kind of addon, just some more structure to the parts library.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3881
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Rethinking the "Part Library"

Post by chennes »

OK, I poked at this a little bit more this evening, and I'm getting closer to a concrete proposal for a "Component Library Manager". Here are my basic thoughts:

Design Goals
  1. No huge up-front download
  2. Only download the components you need, but batching enabled (e.g. "all doors", "all fasteners", etc.)
  3. Get component info/thumbnail image before downloading
  4. Support private local collections
  5. Support user-specified (possibly private) git repos
  6. Optional check for updated components
  7. Optional notice of new components added
  8. Easily create PR to have your component added to official library, from within FreeCAD
  9. Track license requirements so attribution is simple
  10. Internal API so other parts of FreeCAD can easily open dialog to grab parts
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply