-
Notifications
You must be signed in to change notification settings - Fork 431
Shrinking STEP Files (4.4G total repo size -> 2.6G) #223
Conversation
@easyw can you please comment on this? :) |
@sethhillbrand @Shackmeister The shrink is about 40%, so the gain is good but not a big difference. Zipping the library as it is done here: Anyway the shrinking method is intriguing :) EDIT |
@easyw Which model failed? I ask because I ran all files through NIST's STEP file analyzer and didn't find any invalid files. I also spot checked a number of files visually using freecad. |
@easyw if this is a good way to shrink the files, it could probably be embedded in stepup and the CQ scripts? :) @sethhillbrand I believe the question is if all step parsers can handle it :) |
@sethhillbrand a simple hierarchy step file will fail... the shrinker is flattering the structure and in some case just mess the structure up... |
@easyw Thanks for the example. I had only checked the files that exist in the packages3D repository, so I missed the possibility where there is a "=>". I pushed an update to the code that handles this. -- Edit -- |
@sethhillbrand please if you're going to change the shrinker post the update, so I can test it. |
STEP Files are self-referential but the STEP Files in this commit have many identical lines. This commit removes the identical lines and replaces them with a reference to a single unique line.
@easyw - I posted the shrinker in KiCad/kicad-packages3D-source#83 Let me know if you have concerns and I'll address them. |
@sethhillbrand |
I'm happy to fix this issue if the tool needs to support shrinking full board exports. However, my goal with this PR was to minimize the size of the included libraries for KiCAD while maintaining the same geometry. Definitely don't want to step on toes here so I won't push if it's not something you're interested in. |
having found some issue in the shrink-ed models, I would not trust this method unless after having checked every generated model through most used MCAD sw STEP parser... |
Is the most used MCAD sw STEP parser FreeCAD? Or would you suggest running the checks with a different software? |
Step library must be compatible with the wider MCAD sw available. OCC step format has been proven to be compatible to most sw MCAD (SW, NX, PTC, Catia, Inventor, SE, SpaceClaim, Fusion360, Onshape, etc). |
Thanks. I was asking about your statement:
Are you saying that the only way to accept the PR is to test every model in every piece of software? That seems a rather large request. Did I misunderstand what you were saying? |
The point is that OCC are a library tools widely used and deeply tested... for that reason the STEP exporting result can be read without issues on the other MCAD (commercial or not). |
By splitting the PinHeaders based on the materials, we can save an additional 10% file size.
hi @sethhillbrand as this approach does not seem completely "stable" and tested I do not think it can be used for now. eventhough I find it very interesting. should we still keep the PR open or should we perhaps move it over to an issue for further discussion? |
If there's a path to showing its stability, I'm happy to do the work to show that. My takeaway from @easyw was that there is not a reasonable path. If that's wrong, let me know and I'll happily take on what needs to be done. |
Hi @sethhillbrand Unfortunately STEP format is very complex and each MCAD parses it in its own way... I would close this PR. There is an option to have STEP file reduced been compliant to STEP ISO 10303-21 format... the stpZ extension which is a gzip-ed version of STEP text files... BR |
Right, that's kind of my point. When there's an issue like easyw/kicad-3d-models-in-freecad#151 , you open a bug report, fix the issue and regenerate the model. There's nothing that prevents us from doing that here as well so if there are things that I can do to improve the confidence in the reliability of this code, I'm happy to do them. As it stands right now, I updated the code to address both of the issues raised (although they don't affect the library parts, only complex assemblies). I haven't found additional issues and all of the models in the library render equivalently with and without shrinking. |
@sethhillbrand OCC are a world wide standard with very high reputation and a huge users base and experience. BR |
Well, I certainly don't want to have this included without full buy-in from the librarians, so I'll close this for now. |
STEP Files are self-referential but the STEP Files in this commit
have many identical lines. This commit removes the identical lines
and replaces them with a reference to a single unique line.
Source for shrinker available at KiCad/kicad-packages3D-source#83
Thanks for creating a pull request to contribute to the KiCad libraries! To speed up integration of your PR, please check the following items as you complete them: