Skip to content
This repository has been archived by the owner on Oct 2, 2020. It is now read-only.

Compress 3D models #369

Open
walkthetalk opened this issue Aug 16, 2018 · 14 comments
Open

Compress 3D models #369

walkthetalk opened this issue Aug 16, 2018 · 14 comments
Assignees
Labels
Enhancement Improves existing package 3D in the library
Milestone

Comments

@walkthetalk
Copy link

on archlinux:

Package Size: 289.2 MB
Install Size: 4.3 GB

so many space, can we have other file types, for zipped version to be installed?

@evanshultz
Copy link
Collaborator

你好!不可以,对不起.。
https://lists.launchpad.net/kicad-developers/msg36982.html
KiCad/kicad-winbuilder#53

Not now, but hopefully in the future.

@poeschlr
Copy link
Collaborator

poeschlr commented Aug 16, 2018

I assume that the 3d models are a separate package on arch. I doubt that they can be compressed to such a low value so i guess the ~200MB is the main kicad package not the package for the 3d models.
So if you do not want the 3d models you could simply not install that package. You can then download the 3d models that you need manually from the download page. (We offer single libs packaged as zip files.)


Edit: I just checked ubuntu. There the 3d model package lists a size of 600MB (so quite compressed) KiCad and the external tools used for 3d interfacing can not work with compressed files.
In addition: Such a high compression is only possible because all 3d models are in one file. (Compressing only single files results in much smaller space savings) If you would use the same compression on disk you would need to always decompress all files and store them uncompressed somewhere temporarily every time a 3d model is needed. This would take up quite some processing power and you would still need the storage during the time you need the files.

And i don't think storage space should be an issue nowadays. 1TB of hard disk space cost not so much any more. Even SSDs have can now reach >500GB. So i doubt the tradeoff is worth the effort.

@Misca1234
Copy link
Collaborator

I guess the thread can be closed?

@eujean
Copy link

eujean commented Dec 14, 2018

Perhaps this is a problem?

Total Download Size: 291.53 MiB
Total Installed Size: 4449.22 MiB

Note this is only for the 3d-packages, not including the kicad installer itself which is approximately 200 MiB.

I'm just curious how the models are stored, and how they are compresses at a compression rate of almost 95%.

@poeschlr
Copy link
Collaborator

Step files have quite some redundancy in them. If you then not only compress single files but full directories then you get quite a lot of potential. (After all: Step is human readable. A binary format would be much much smaller but that makes portability a lot harder to achieve. There is a reason step is the king in the mcad world.)

However this is only practical if you only need to compress and decompress them once. As always there is simply a tradeoff between computing power and storage. In todays world where storage is basically free one can optimize for computing speed. (Or would you rather wait 5 minutes everytime you open the 3d viewer till the 3d models are decompressed?)

If storage is a real concern than simply do not install the 3d models via the installer but only download the ones you really need.

@Franck78
Copy link

Franck78 commented Sep 8, 2020

Why do I loose my time reading issues that are not issues ????

Someone to close that please ?

@chschlue chschlue added this to the 6.0.0 milestone Sep 8, 2020
@chschlue chschlue added the Enhancement Improves existing package 3D in the library label Sep 8, 2020
@chschlue chschlue self-assigned this Sep 8, 2020
@chschlue chschlue changed the title can we have small size version? Compress 3D models Sep 8, 2020
@chschlue
Copy link
Contributor

chschlue commented Sep 8, 2020

This is an unresolved issue. If you don't like it, don't read it.

Also, you've been asked to work on the general tone of your comments before. Heed that advice.

@Franck78
Copy link

Franck78 commented Sep 8, 2020

I'm sorry but you have to read "a lot" of issues or thing that are not real issues but "things" sitting there.

example:
footprint merged:
easyw/kicad-3d-models-in-freecad#351

corresponding model waiting who knows what
#683

@hildogjr
Copy link

I would like to invite @sethhillbrand to this discussion. He made a nice study on reduce the STEP file size, having a algorithm to do so.

As far I tested in some STEP 3D models of KiCad, I got a good file size decrease (actual 3D files appear that doesn't passed to this process). Also I would like to mention the compressed step GZ format capability and compressed step ZIP. Could we clean the STEP for v6 (@sethhillbrand algorithm) and maybe compressed for v7?

@sethhillbrand
Copy link

I've been down this road before (#223) That was an enormously frustrating conversation that led nowhere productive.

If this is desired, I'm happy to provide pipeline code in Python to compress our models and verify the compression results (comparing model results in OCC). But I'm going to stay out of the discussion about whether this should be done. I believe it should but I don't want another disagreement with anonymous internet experts.

@Franck78
Copy link

Franck78 commented Oct 1, 2020

If there is a very little thing to do to the .step files, it's a check that 'filename' and 2 others fields are correctly filled.

Lot of PR are blocked or retarded because 'blah blah filename in step not good'.

The reason for this field is 'ease matching something with something else in some CAD'. Clearly outside of KiCAD.
A monthly check can fix all the new 3d step added. No one will cry if the 'match' is wrong during a month for a new 3dimage

That will save a lot of time here.

@chschlue
Copy link
Contributor

chschlue commented Oct 1, 2020

@hildogjr @sethhillbrand If anything, I would delay stepreducing the files, not the other way round.

Deflating the models should be safe in any case and is also reversible.
I also don't know why stepreducing would be a problem.

@hildogjr
Copy link

hildogjr commented Oct 1, 2020

I made some test with third-part model from https://grabcad.com/ and https://www.3dcontentcentral.com/. I also used the stepreducing algorithm to reduce some National Instruments 3D models of 100MB, finishing with a 83MB. I had no problem with Pcbnew or FreeCAD in any of those cases.

Now, using Nightly KiCad, I am also compressing those models into .STEP.GZ, using the extension .stpz, cause it's the default for FreeCad (I got a 18MB file of the above 83MB example). Again, no error or warning on both softwares, even using the exported board STEP model, stepreduce-ing it and compressing into GZ, and import into FreeCAD.

I just saw gain in the loading time of FreeCad.

I didn't test other CAD software or, models that not above or KiCad internal library. Someone can point some issue?

@Franck78
Copy link

Franck78 commented Oct 1, 2020

ATZ
ATL0M3B0S7=30F1%C3
ATDT18003317166

If you are older than 50, you may remember that.

What is this ? Simply order the v42bis MNP5 modem to call the Compuserve service. With compression enabled (%C3)

Funny to see that after 40 years, problem is not solved despite compressed filesystems available (zfs, ntfs,...)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement Improves existing package 3D in the library
Projects
None yet
Development

No branches or pull requests

9 participants