Subtractions/Additions when Arch.Component is placed in App.Part

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Subtractions/Additions when Arch.Component is placed in App.Part

Post by gbParametric »

Subtractions and Additions doesn't seem to work correctly, if Arch.Component is placed into App.Part.

To reproduce :
1)Place arch column in random(Non zero) location
2)Add App.Part container
3)Add column to container
4)Create cube
5)Place cube in App.Part
6)Adjust cube in desired place
7)Add it to Subtractions

It seems that when subtraction is made, the placements of hierarchical data structures is not taken into account.
Maybe im missing something, im relatively new to FreeCAD.

The Cut with plane function doesn't seem to work either.

Edit(added version info)

Edit(added files and pictures to better explain problem)

A Little explanation:
Im using App.Part objects as an assembly container, and i usually find myself to want to cut it, with objects that are
in other App.Part containers or are in global space


1)Cube(can be any other object to cut with) in global coordinate system(not placed in any App.Part)
Example_for_forum.FCStd
(13.24 KiB) Downloaded 20 times

2)Cube in other App.Part
Example_for_forum2.FCStd
(14.25 KiB) Downloaded 20 times

3)Two Arch.Structure objects located in separate App.Part containers.
Using plane from other Arch.Structure to cut with(CutWithPlane command in BIM/Arch workbench)
Example_for_forum3(cut with plane).FCStd
(19.47 KiB) Downloaded 21 times
Desired outcome in picture
Example_Cut_With_Plate.png
Example_Cut_With_Plate.png (75.58 KiB) Viewed 1060 times

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.28915 +3 (Git)
Build type: Release
Branch: gbStructureDev
Hash: cf1244bf73ade22a98d212b25eba211b1c56b91c
Python 3.8.6+, Qt 5.15.2, Coin 4.0.1, OCC 7.5.3
Locale: English/Europe (en_150)
Installed mods: 
  * BIM 2021.12.0
  * BOLTSFC
  * Design456 0.0.1
  * dodo
  * fasteners 0.3.51
  * Manipulator 1.4.9
  * parts_library
  * Reinforcement
Last edited by gbParametric on Sat Aug 13, 2022 12:51 pm, edited 1 time in total.
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by paullee »

Please post images and model file for ease of understanding :)
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by gbParametric »

paullee wrote: Sat Aug 13, 2022 8:02 am Please post images and model file for ease of understanding :)
Sure!! Updated post with aditional information :)
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by paullee »

Not familiar with App:Part.

All Arch Object has Subtraction attribute, put the cube in the Subtraction, and the latter would be boolean cut out.
  1. Moved the Arch Structure out from the App:Part, it return to its 'original disposition', then found the Cube is not superimposed at the former's location.
  2. Move the Cube to the location of Arch Structure, put the Cube in the Subtraction to do the boolean cut
    ( Example_for_forum_r.FCStd )
  3. Now move back the Arch Structure to the App:Part, it gain the latter's placement
    ( Example_for_forum_r2.FCStd )
Good luck :)
Example_for_forum_r.FCStd
(15.31 KiB) Downloaded 19 times
Example_for_forum_r2.FCStd
(15.42 KiB) Downloaded 19 times

Screenshot from 2022-08-14 00-28-07.png
Screenshot from 2022-08-14 00-28-07.png (193.52 KiB) Viewed 1018 times
Screenshot from 2022-08-14 00-32-01.png
Screenshot from 2022-08-14 00-32-01.png (185.1 KiB) Viewed 1018 times
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by gbParametric »

paullee wrote: Sat Aug 13, 2022 4:35 pm .
Thanks,for tips, but this would not really work for what im trying to achieve.
Im learning FreeCad to eventually use it for making Structural models for Buildings, and
the workflow needs to be as robust as possible. I would have 1000+ of Arch.Structure objects.
I opened this thread to discuss implementation of this feature.
Maybe i should add something to title, to make it more clear ? :)

It seems that App.Part is one of core features of FreeCAD since its available in every workbench,
and it should be supported for these basic opertations.

I'm looking at source code at the moment, and i think it wouldn't be so hard to implement this feature.
but im pretty new to this project, so it takes some time, to figure out all in's and out's
paullee
Veteran
Posts: 5097
Joined: Wed May 04, 2016 3:58 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by paullee »

OK, maybe I see what you mean now :)

Somehow Arch objects behave like below, which seems discussed before:-
  1. When objects are added in Subtraction (/Addition), it do boolean fuse / cut
  2. Changing the Arch object's Placement, one may expect the 'composite object' (with Subtraction / Addition) move together...
  3. ... but not - the objects in Subtraction / Addition stay in their original locations, only the Arch object itself pick up the new Placement
  4. Other peoples may find the current behaviour 'as expected'
Maybe adding some kind of 'transform' attribute to let user to choose the expected behaviour ?

Likewise, should some attributes be added for the Arch Object take into account of App:Part container's placement?
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by gbParametric »

paullee wrote: Sat Aug 13, 2022 5:54 pm .
My thought was :
in ArchComponent.py is a function:
def addToComponent(compobject,addobject,mod=None):

you can check if component object is inside a App.Part with :
compobject.getParentGeoFeatureGroup()

if it returns not None,
1)then the component is inside App.Part,
2)use the Placement from parent App.Part
3)bring addobject inside local corrdinates of App.Part
4)add it to subtractions/additions

Its only pseido code at the moment, when ill get free time, i will test it.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by Roy_043 »

What is your reason for putting the Subtraction object in a different Std_Part, with a different Placement, from the component that you want to subtract from? Can you clarify your intended workflow?
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by Roy_043 »

gbParametric wrote: Sat Aug 13, 2022 6:29 pm you can check if component object is inside a App.Part with :
compobject.getParentGeoFeatureGroup()
With the current Link system objects can have multiple parents. So it is probably not as straightforward as you may think.
gbParametric
Posts: 23
Joined: Wed Apr 20, 2022 9:06 pm

Re: Subtractions/Additions when Arch.Component is placed in App.Part

Post by gbParametric »

Roy_043 wrote: Sat Aug 13, 2022 6:42 pm What is your reason for putting the Subtraction object in a different Std_Part, with a different Placement, from the component that you want to subtract from? Can you clarify your intended workflow?
1) I have Column assembly(App.Part), that consists of Steel Column(Arch.Structure), bunch of plates(Arch.Structure)and bolts, lets say i wanna cut the end of the column off, so that it would be in the same angle as roof.

2) I have the same column, but this time there's a roof beam, that need to be connected, both are inside the 2 different App.Part objects,
i wanna use one of the beam planes to cut column and one of column planes to cut the beam.
Post Reply