- 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
If you want to color some of your models.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: If you want to color some of your models.
I've some things to add.
Regards / Viele Grüße
Max
Max
Re: If you want to color some of your models.
I see it only working on a document/model level currently.I think it would be useful if only selected models would be colored
I see it working fine on my Windows machine, Win 10 versions 19 and 20. Not sure how to test that.It's not working with part primitives
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.
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.
- Attachments
-
- Bluethread.JPG (3.92 KiB) Viewed 3024 times
Re: If you want to color some of your models.
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.
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.
- Attachments
-
- color1.JPG (33.75 KiB) Viewed 2971 times
Re: If you want to color some of your models.
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.
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.
Remember you might need to click "Shade/Flat Line" once or twice to synchronize the setting to the current model.
- Attachments
-
- Vision_color_plus2.FCMacro
- (7.41 KiB) Downloaded 60 times
-
- color_2.png (87.33 KiB) Viewed 2884 times
Last edited by freedman on Sun Oct 17, 2021 10:58 pm, edited 1 time in total.
Re: If you want to color some of your models.
This thread has some interesting details regarding cuts and coloring: https://forum.freecad.org/viewtopic.php ... b119b30f05
Regards / Viele Grüße
Max
Max