Moving Windows/Doors

A forum dedicated to the Draft, Arch and BIM workbenches development.
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

Ok, replaced all relevant lines.

Anyone would like to test any cornercases ? :)

ArchComponent.py
(97.83 KiB) Downloaded 19 times

Test_ ArchSketch_ 49_ Window-Placement_r3.FCStd
(75.94 KiB) Downloaded 14 times

Screenshot from 2022-03-15 07-59-03.png
Screenshot from 2022-03-15 07-59-03.png (215.25 KiB) Viewed 1112 times
Attachments
Screenshot from 2022-03-15 07-59-15.png
Screenshot from 2022-03-15 07-59-15.png (221.98 KiB) Viewed 1112 times
User avatar
Roy_043
Veteran
Posts: 5456
Joined: Thu Dec 27, 2018 12:28 pm

Re: Moving Windows/Doors

Post by Roy_043 »

Do you understand the last elif in?:
https://github.com/FreeCAD/FreeCAD/blob ... #L776-L786

AFAICT only Windows have a Subvolume property. So when would the code in the elif block execute?
User avatar
Roy_043
Veteran
Posts: 5456
Joined: Thu Dec 27, 2018 12:28 pm

Re: Moving Windows/Doors

Post by Roy_043 »

paullee wrote: Tue Mar 15, 2022 1:04 am Ok, replaced all relevant lines.
Thanks, that seems to work OK. Note that you will have to rebase before doing a PR as the ArchComponent.py file has seen several changes.

Attached is one of your test files with an added 'twisted' roof. The file was recomputed and saved in V0.19, so the subtractions you see when opening the file are faulty. Recomputing in V0.20 with your last ArchComponent.py file fixes this.
Attachments
Test_ Arch Door Opening_ 3_ Sketch_ Wall Offseted Roof.fcstd
(35.28 KiB) Downloaded 17 times
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

Roy_043 wrote: Tue Mar 15, 2022 12:56 pm Attached is one of your test files with an added 'twisted' roof. The file was recomputed and saved in V0.19, so the subtractions you see when opening the file are faulty. Recomputing in V0.20 with your last ArchComponent.py file fixes this.
There is something strange about the Roof.

Recompute make the openings of door and subtraction volume of roof correct.

Recompute the Wall again, the subtraction volume of roof seems shifted. Recompute another time, it further shift again, until there is no more subtraction :shock:
Screenshot from 2022-03-16 01-43-18.png
Screenshot from 2022-03-16 01-43-18.png (213.42 KiB) Viewed 968 times
Screenshot from 2022-03-16 01-43-29.png
Screenshot from 2022-03-16 01-43-29.png (203.5 KiB) Viewed 968 times
Screenshot from 2022-03-16 01-43-35.png
Screenshot from 2022-03-16 01-43-35.png (205.14 KiB) Viewed 968 times
Screenshot from 2022-03-16 01-43-40.png
Screenshot from 2022-03-16 01-43-40.png (206.03 KiB) Viewed 968 times
Screenshot from 2022-03-16 01-43-45.png
Screenshot from 2022-03-16 01-43-45.png (204.73 KiB) Viewed 968 times
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

Roy_043 wrote: Tue Mar 15, 2022 12:33 pm Do you understand the last elif in?:
https://github.com/FreeCAD/FreeCAD/blob ... #L776-L786

AFAICT only Windows have a Subvolume property. So when would the code in the elif block execute?
Catch-all condition which are not covered by the if / elif above ?

yorik wrote: Sat Mar 12, 2022 9:44 am Ping
User avatar
Roy_043
Veteran
Posts: 5456
Joined: Thu Dec 27, 2018 12:28 pm

Re: Moving Windows/Doors

Post by Roy_043 »

paullee wrote: Tue Mar 15, 2022 5:48 pm compute the Wall again, the subtraction volume of roof seems shifted.
Confirmed.

There are two reasons for this:
  1. The getSubVolume function in ArchRoof.py re-uses the already generated SubVolume (self.sub), if available.
  2. No copy is made of the SubVolume of the roof, either in ArchRoof.py or in ArchComponent.py.
So each time you recompute the wall the placement of the same roof SubVolume shape is again manipulated.

There are some interesting questions here:
Where should the copy of the SubVolume be created? I would say in ArchComponent.py. Not sure.
AFAICT the generated SubVolume of a Window is not re-used. Why is that? It might make models faster.
Last edited by Roy_043 on Wed Mar 16, 2022 7:58 am, edited 1 time in total.
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

Thanks, would have a better look :)
User avatar
yorik
Founder
Posts: 12928
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Moving Windows/Doors

Post by yorik »

paullee wrote: Tue Mar 15, 2022 6:04 pm AFAICT only Windows have a Subvolume property. So when would the code in the elif block execute?
Catch-all condition which are not covered by the if / elif above ?
Yes. The idea is that you could develop other kinds of embeddable objects. All they need is a Subvolume shape, which would then be recognized and used here. I have used that once to make windows with App:Parts...
Roy_043 wrote: Tue Mar 15, 2022 9:13 pm AFAICT the generated SubVolume of a Window is not re-used. Why is that? It might make models faster.
That is a good idea, actually. It should be kept as a cache...
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

Thanks :D
paullee
Veteran
Posts: 4437
Joined: Wed May 04, 2016 3:58 pm

Re: Moving Windows/Doors

Post by paullee »

yorik wrote: Wed Mar 16, 2022 11:29 am
Roy_043 wrote: Tue Mar 15, 2022 9:13 pm AFAICT the generated SubVolume of a Window is not re-used. Why is that? It might make models faster.
That is a good idea, actually. It should be kept as a cache...
Then, probably need a flag to identify if the 'base' Window/Roof shape had been updated so the subvolume needs updating before the latter is re-used (self.sub), right ?
Post Reply