Rethinking the "Part Library"
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: Rethinking the "Part Library"
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.
Re: Rethinking the "Part Library"
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.
Re: Rethinking the "Part Library"
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.
Re: Rethinking the "Part Library"
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.
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.
Re: Rethinking the "Part Library"
I can be wrong again, but this line is the first line of the introduction in https://wiki.freecadweb.org/Package_Metadata :
Which means that every new WB should be able to deal with this format. That means quite a lot of people.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.
About Nim. Latest Release 2.0.2. Here is Nim in 100 seconds and a Nim package. There are Qt and OCCT packages.
Re: Rethinking the "Part Library"
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.
Re: Rethinking the "Part Library"
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.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Rethinking the "Part Library"
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?
Re: Rethinking the "Part Library"
Yes. I'll be more explicit about that in the requirements.adrianinsaval wrote: ↑Tue Feb 28, 2023 11:54 pm Will this include an interface for importing parts form the library into a project?
Do you have an opinion? I had been imagining copying it.will it link to this part or copy it?
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Rethinking the "Part Library"
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?