Shrink filesize clone

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Koemi
Posts: 150
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Shrink filesize clone

Post by Koemi »

Hi!

Sometimes you have to test an assembly(1) inside another assembly(2).

I would love it if the result doesn't get sluggish (this can happen with large assemblies).

I am searching for a solution to create somekind of clone of assembly(1) which is 'hollow'. Nothing more than the outer shape of the original, expecting a much smaller filesize of assembly(1).

I tried Draft >> Clone. After that I removed all 'intelligent' parts and made a compound of the remaining clones. All fine. Except that the endresult grew almost 50% :(

It is not possible for me to share these files (classified). Sorry :mrgreen:
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Shrink filesize clone

Post by chrisb »

The material inside of a solid doesn't make the file bigger. If you want a file without any history you can use Part->Create a copy->Create simple copy and then delete the source objects.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Koemi
Posts: 150
Joined: Thu Dec 28, 2017 11:13 am
Location: The Netherlands

Re: Shrink filesize clone

Post by Koemi »

Thanks chrisb.

Is does the trick. The file shrinks from 11MB to 7MB. Quite a lot, but still also quite a large filesize.

The is no macro or something like that that creates a simple shell?
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Shrink filesize clone

Post by chrisb »

Koemi wrote: Fri Nov 15, 2019 1:21 pm The is no macro or something like that that creates a simple shell?
Not that I know of. And a vague guess tells me that a shell is not smaller in filesize than a solid. FreeCAD uses so called boundary representations, and I'm afraid, that a shell needs more information than a solid. This guess is supported by a small test I made: A cube as a shell results in a filesize of 21767 bytes, while a solid cube file has only 3350 bytes.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Shrink filesize clone

Post by triplus »

If you use FreeCAD 0.19 and right click on the "part" item in the tree view -> Link actions -> Make link. After drag and drop the resulting Link feature into the assembly document.

Any improvements?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Shrink filesize clone

Post by vocx »

Koemi wrote: Fri Nov 15, 2019 11:21 am ...
Sometimes you have to test an assembly(1) inside another assembly(2).
...
How are you creating the "assembly"? Are you using just PartDesign objects, or are you using an actual assembly workbench, like A2Plus?

In the development version, 0.19, a new object was introduced called "App::Link". This will be used to produce assemblies of assemblies as you probably want. Instead of copying the entire information from one assembly to another, it will only provide a "reference" to its Shape; this will make creating copies of objects, clones, and assemblies faster.

The Assembly4 workbench makes use of App::Link, so maybe you can give it a try. It only works on 0.19. It is a work in progress, so it may still be a bit unstable, so make sure you have backups.

If you must stay with 0.18 at the moment, then I'm afraid there aren't many options except reducing the number of objects. Each object brings complexity to the document, and it's what makes everything slow.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Shrink filesize clone

Post by vocx »

chrisb wrote: Fri Nov 15, 2019 3:39 pm ... And a vague guess tells me that a shell is not smaller in filesize than a solid...
Just a clarification, in general, meshes are always simpler than solid bodies. Meshes are ultimately just collections of points, that are tied by lines. A solid body like what FreeCAD uses (BREP) requires a bit of complexity because it defines many properties of the solids, like volume, and it can also do boolean operations.

Maybe at small scale a mesh (shell) is larger in size than a solid body. But at larger scales, the meshes are much more memory efficient. This is the reason computer graphics, video games, special effects, finite element simulations, etc., they all use meshes with many millions of polygons. They are much faster to render with specialized hardware than solid BREPs.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
chrisb
Veteran
Posts: 54305
Joined: Tue Mar 17, 2015 9:14 am

Re: Shrink filesize clone

Post by chrisb »

A mesh is always a shell, but not every FreeCAD shell is also a mesh. A mesh is always tesselated.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply