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!
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: Rethinking the "Part Library"

Post by grd »

TBH, I don't really like XML, I like YAML a lot more, because YAML is much more readable (think Docker for instance) and XML is so verbose. That is the only thing that I want to say. I like the idea.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Rethinking the "Part Library"

Post by chennes »

grd wrote: Tue Feb 28, 2023 9:25 pm I don't really like XML, I like YAML a lot more
Agreed - it's also much safer, if you have an actual full-blown XML parser there are all kinds of security issues you have to worry about.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: Rethinking the "Part Library"

Post by grd »

chennes wrote: Tue Feb 28, 2023 10:35 pm Agreed - it's also much safer, if you have an actual full-blown XML parser there are all kinds of security issues you have to worry about.
Why did you use XML? Even the .ini file format would work.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Rethinking the "Part Library"

Post by chennes »

For Addon metadata? That's a little outside the scope of this discussion, but the basic answer is because FreeCAD already had an XML parser in it and I didn't anticipate needing to parse it outside FC.

For this project that's obviously not the case, so I think you are right, that something like YAML or ini files would be fine. I wasn't planning on specifying a specific metadata format in the job posting.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: Rethinking the "Part Library"

Post by grd »

I can be wrong again, but this line is the first line of the introduction in https://wiki.freecadweb.org/Package_Metadata :
Beginning in FreeCAD version 0.20, external addons (workbenches, macros, and preference packs) may be distributed with a metadata file describing the contents of the package.
Which means that every new WB should be able to deal with this format. That means quite a lot of people.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Rethinking the "Part Library"

Post by chennes »

An external WB does't have to be able to read that file, it just has to include it. I anticipate most Addon authors using Developer Mode in the Addon Manager to create the file, so they'll probably never have to look at the XML directly.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
grd
Posts: 328
Joined: Wed Apr 13, 2022 5:13 am
Location: Eindhoven, The Netherlands

Re: Rethinking the "Part Library"

Post by grd »

Then I was wrong. Sorry.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Rethinking the "Part Library"

Post by adrianinsaval »

don't we also already use a json parser? I like yaml better than json but definitively json over xml. Anyways, we should have some standard way of assigning P/Ns and other metadata inside a file IMO. Will this include an interface for importing parts form the library into a project? will it link to this part or copy it? will we need metadata about what objects to link if we are doing this?
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Rethinking the "Part Library"

Post by chennes »

adrianinsaval wrote: Tue Feb 28, 2023 11:54 pm Will this include an interface for importing parts form the library into a project?
Yes. I'll be more explicit about that in the requirements.
will it link to this part or copy it?
Do you have an opinion? I had been imagining copying it.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Rethinking the "Part Library"

Post by adrianinsaval »

Well linking would be ideal IMO, but it presents some challenges when sharing the model with others or moving to a different PC. Maybe make it optional?
Post Reply