After Arch Remove geometry changes color

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

After Arch Remove geometry changes color

Post by bitacovir »

Create a wall with Arch Wall tool
Create a cube with PartWB
Move the cube on the wall to perform Arch Remove
Select first the cube and second the wall
Perform Arch Remove
Turn on the hidden cube. The color and transparency of the cube are different (blue, 80%).

Is It a new feature?

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18213 (Git)
Build type: Release
Branch: master
Hash: 22babc09954ac6fda9135ee71d68550921659b1c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: After Arch Remove geometry changes color

Post by Roy_043 »

I assume it is. Note: the Point color remains unchanged.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: After Arch Remove geometry changes color

Post by vocx »

bitacovir wrote: Mon Sep 16, 2019 2:21 pm ...
Is It a new feature?
...
Depends on your definition of "new", but yes this is the normal behavior for a few months. Is it not present in 0.18?

I quickly looked at the source, but I don't know where the color change is defined.

When you press the Arch Remove button, it calls _CommandRemove(), https://github.com/FreeCAD/FreeCAD/blob ... s.py#L1342, which then calls Arch.removeComponents() https://github.com/FreeCAD/FreeCAD/blob ... ds.py#L158

It basically adds objects to the Subtraction attribute. So maybe there is some code inside the Object to change the appearance of each Subtraction element.
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.
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: After Arch Remove geometry changes color

Post by bitacovir »

vocx wrote: Mon Sep 16, 2019 8:53 pm
Depends on your definition of "new", but yes this is the normal behavior for a few months. Is it not present in 0.18?
Thanks. It is new for me. I used to work with boolean operation rather than Arch Remove.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: After Arch Remove geometry changes color

Post by Roy_043 »

If you want to find it in the code: look at ArchCommands.py line 269. The construction color from the preferences is used.

As already mentioned the point color is not handled. @vocx: I think you have permissions to fix this (pull request etc.)?

Code: Select all

def setAsSubcomponent(obj):
    '''Sets the given object properly to become a subcomponent (addition, subtraction)
    of an Arch component'''
    Draft.ungroup(obj)
    if FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch").GetBool("applyConstructionStyle",True):
        if FreeCAD.GuiUp:
            color = getDefaultColor("Construction")
            if hasattr(obj.ViewObject,"LineColor"):
                obj.ViewObject.LineColor = color
            if hasattr(obj.ViewObject,"ShapeColor"):
                obj.ViewObject.ShapeColor = color
            if hasattr(obj.ViewObject,"Transparency"):
                obj.ViewObject.Transparency = int(color[3]*100)
            obj.ViewObject.hide()
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: After Arch Remove geometry changes color

Post by vocx »

Roy_043 wrote: Tue Sep 17, 2019 7:45 am ...

As already mentioned the point color is not handled. @vocx: I think you have permissions to fix this (pull request etc.)?
What does it mean not handled? Do you also want to change the color of the point? Do you prefer a different color?

Everybody has permission to submit a pull request, but only a few developers can merge the requests, which I can't.

So, sure, I can submit a change, but since Yorik is traveling currently, he may take a while to merge things. As long as it's not urgent, I think we can just submit the change to the queue and wait for him.
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.
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: After Arch Remove geometry changes color

Post by Roy_043 »

vocx wrote: Tue Sep 17, 2019 5:48 pm What does it mean not handled?
Roy_043 wrote: Mon Sep 16, 2019 7:24 pm Note: the Point color remains unchanged.
And by 'queue' you mean the bug tracker I presume?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: After Arch Remove geometry changes color

Post by vocx »

Roy_043 wrote: Tue Sep 17, 2019 7:26 pm And by 'queue' you mean the bug tracker I presume?
That the color of the points remains unchanged is not a huge problem, unless you are very obsessive that the points should definitely also change their color.

No, man, no bug tracker; I just mean this: pull request #2532.

Now the pull request sits on the queue. The administrators can merge it if they want, although most probably they will wait for Yorik to return so he does it.
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.
User avatar
Roy_043
Veteran
Posts: 8577
Joined: Thu Dec 27, 2018 12:28 pm

Re: After Arch Remove geometry changes color

Post by Roy_043 »

OK, thanks for the pull request.
Indeed: it is not very important, but not reporting these little things when you stumble over them would not make sense IMO.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: After Arch Remove geometry changes color

Post by yorik »

Thanks for the fix, sorry for the delay! :) It's merged now
Post Reply