Page 2 of 2

Re: If you want to color some of your models.

Posted: Wed Oct 13, 2021 8:01 pm
by M4x
I've some things to add.
  • I think it would be useful if only selected models would be colored (or recolored) = according to using Random color. Maybe even do exactly the same / use random color if you'd like to keep this functionality in your macro.
  • The same goes for Default color and flat lines (= only selected models / bodies)
  • It's not working with part primitives

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 1:50 am
by freedman
I think it would be useful if only selected models would be colored
I see it only working on a document/model level currently.
It's not working with part primitives
I see it working fine on my Windows machine, Win 10 versions 19 and 20. Not sure how to test that.

I have some newer code that is more efficient and maybe will run better. It would be great if you could try it. I will post in a day or so.
Thanks

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 10:41 am
by PJT
The problem I have with colours is that if I colour a part and then cut it (to show a cross section) the cut surfaces revert to the default greys and don't keep the colour of the original part. This is especially a problem when I have a compound model of many parts each with their own colour. Does you macro account for / fix that problem? See the attache picture - the blue threaded insert inside the outer threaded tube is supposed to be blue but the cut surface is just a s grey as all the other parts.

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 3:15 pm
by freedman
I wonder if this is graphic card related or a setting. I use open GL in FreeCAD preferences. We certainly see different things, could you post your OS? Here is a pic of a pocket on a thread, I see the same (full color) with a boolean subtract in Part. Maybe this a Help system question.

This macro is an automation tool, no decision making included. It's designed to be a time saver and reflects what the user could do manually with many mouse clicks.

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 4:39 pm
by Syres
PJT wrote: Fri Oct 15, 2021 10:41 am The problem I have with colours is that if I colour a part and then cut it (to show a cross section) the cut surfaces revert to the default greys and don't keep the colour of the original part.
In my experience with both Windows and Linux since 0.16 this has always been the case, you have to make the 'cutter' the same colour as the object being cut beforehand and it works as expected.

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.26153 (Git)
Build type: Release
Branch: master
Hash: 346ff3815dba32c59e62c0892f0bbc03da901cad
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 7:16 pm
by freedman
Here is my latest. I added the Deviation setting. Each object has a deviation setting and we have two options, "Default" and "High resolution". High resolution will make the curved edges more rounded. Unlike the other visual settings, changing deviation of the model requires the macro to perform a recompute to finish and can take a few seconds, longer on large models. I was kind of hesitant to add deviation settings (because of the recompute) but it really is the last visual setting that can make a big difference in viewing. See in the pic the difference between default and high resolution (right) on two identical pads. If new objects/sketches/features are added then a reclick of the resolution button will refresh the model.

Remember you might need to click "Shade/Flat Line" once or twice to synchronize the setting to the current model.

Re: If you want to color some of your models.

Posted: Fri Oct 15, 2021 9:36 pm
by M4x
PJT wrote: Fri Oct 15, 2021 10:41 am The problem I have with colours is that if I colour a part and then cut it (to show a cross section) the cut surfaces revert to the default greys and don't keep the colour of the original part.
This thread has some interesting details regarding cuts and coloring: https://forum.freecad.org/viewtopic.php ... b119b30f05