[Discussion] Orientation of Windows and Doors

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
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

[Discussion] Orientation of Windows and Doors

Post by vocx »

It seems people struggle to understand how to correctly place Arch Windows and Doors within Arch Walls, especially if they aren't parallel to the main XZ or YZ planes, or if they need to be moved to a different wall, or rotated to a different orientation once created. Another issue that is also confusing is that in many cases the window or door doesn't trigger a recompute of the host wall when changes occur, so the wall displays incorrect holes.

I collect a few threads that discuss these topics for reference. I found the tutorials by jpg87 very informative as well I decided to prepare a tutorial with some explanation on how the Normal property of the Window works, and how it can be calculated to orient the window in the desired position. I'm not entirely sure if this is correct, but it's something I can use as reference for the time being. In this thread, Arch Window on Non-Linear Wall?, Yorik explains a bit how the Window does its internal calculations for the Normal. I didn't see it before writing the tutorial, so I didn't include that information. Has anything changed significantly since then?
yorik wrote: Thu Apr 27, 2017 12:06 am obtaining a normal depends on your shape. In DraftGeomUtils module there is a getNormal() function that tries to obtain a normal from any shape you give to it. Better be it a flat shape, otherwise the result can be not what you want. But for something flat (face or wire(s)) it works well. This will get a normal for a selected object:

import DraftGeomUtils
DraftGeomUtils.getNormal(Gui.Selection.getSelection()[0].Shape)
I think from a usability point of view, the automatic calculation of the window's Normal should be improved. In the second tutorial by jpg87, and in the wiki, it is shown that even if you rotate the base sketch, or if you remap the sketch to a new plane, the Window doesn't automatically adjust the Normal.

In most cases, the user shouldn't be calculating the normal and changing the value manually. Maybe a button can be added to the Window's Task panel so the user can choose any face so that FreeCAD calculates the Normal and orients the object in the desired direction.
Last edited by vocx on Wed Apr 03, 2019 5:32 pm, edited 1 time in total.
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
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [Discussion] Orientation of Windows and Doors

Post by yorik »

vocx wrote: Mon Apr 01, 2019 8:36 am Has anything changed significantly since then?
Basically how things work now:

- you press the Window button, and hover the mouse over the wall where you wan tot insert it
- when your mouse is over a face, the tool gets the normal direction of that face, and orients the window on it
- when you click to insert the window, the last orientation is kept and determines how the base sketch must be positioned

Internally:

- If the Normal property of the window is set (not 0,0,0), it overrides all the rest and defines the normal direction (ie. the extrusion direction) of the window
- if not, the normal direction is taken by guessing the normal direction of the underlying 2D object (sketch or whatever) using DraftGeomUtils.getNormal().
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Discussion] Orientation of Windows and Doors

Post by vocx »

yorik wrote: Wed Apr 03, 2019 4:21 pm ...
- if not, the normal direction is taken by guessing the normal direction of the underlying 2D object (sketch or whatever) using DraftGeomUtils.getNormal().
What about a tool "Re-orient Normal", which does this calculation again, in case the window or the sketch is moved?
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
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [Discussion] Orientation of Windows and Doors

Post by yorik »

If the sketch is moved, and provided the Normal property of the window is (0,0,0), this calculation is done again automatically
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Discussion] Orientation of Windows and Doors

Post by vocx »

yorik wrote: Thu Apr 04, 2019 3:27 pm If the sketch is moved, and provided the Normal property of the window is (0,0,0), this calculation is done again automatically
Yes, I know. But from a usability point of view, a new, inexperienced user won't know that he or she has to put the normal to (0,0,0). It will be a long time until the user figures out (reads somewhere in the manual) that entering (0,0,0) does the trick. An explicit button, menu, or right click menu that says "Re-orient normal" which does this would be better.
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
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: [Discussion] Orientation of Windows and Doors

Post by yorik »

Hmm i see your point... Indeed that's a good idea. Maybe a right-click option? That's a good place for such things...
User avatar
Roy_043
Veteran
Posts: 8583
Joined: Thu Dec 27, 2018 12:28 pm

Re: [Discussion] Orientation of Windows and Doors

Post by Roy_043 »

Thank you @vocx for pointing out this discussion, I somehow missed it. And also thank you for the tutorial.

Some remarks from my side (note: I have not read the other topics vocx linked to):

1.
yorik wrote: Wed Apr 03, 2019 4:21 pmwhen your mouse is over a face, the tool gets the normal direction of that face, and orients the window on it
I actually hadn't really noticed this behavior before. Prior to following the tutorial I would always align the WP with the correct wall face. IMO this behavior should be explained in the Arch Window section of the wiki.

2.
When creating a sketch for a window you should pay close attention to the creation order of the "loops". The numbering of the wires in the "Windows elements" dialog depends on it. Again this is something that should ideally be mention in the wiki.

3.
Regarding the Normal property of windows:
IMO it would be a good idea to use 0,0,0 as the default Normal property for all windows. In most cases the underlying 2D object is aligned with the wall and using the normal of that object to create the window makes perfect sense. Note: for the correct extrusion of the window this normal vector must be reversed however.

Related topic:
https://forum.freecadweb.org/viewtopic.php?f=23&t=39760
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Discussion] Orientation of Windows and Doors

Post by vocx »

Roy_043 wrote: Fri Oct 04, 2019 1:11 pm 1.
I actually hadn't really noticed this behavior before. Prior to following the tutorial I would always align the WP with the correct wall face. IMO this behavior should be explained in the Arch Window section of the wiki.
I think this is not stressed in the wiki because it is "discoverable"; the user can figure this out just by trying. If you just select the window, and then move the tracker over a wall, you can see how the window aligns itself automatically.
2.
When creating a sketch for a window you should pay close attention to the creation order of the "loops". The numbering of the wires in the "Windows elements" dialog depends on it. Again this is something that should ideally be mention in the wiki.
Okay, I have added this bit.

It is evident that the Arch documentation is missing many things. I wish I had some time and motivation to bring the documentation on par with Draft Workbench's one. To document Draft, I basically had to test every single tool in the workbench and cross reference with the code, and see how everything worked, and then document that, including problems, if any.
3.
Regarding the Normal property of windows:
IMO it would be a good idea to use 0,0,0 as the default Normal property for all windows. ...
As I proposed earlier, I think it would be good to have a menu option, right click context menu, or button with a command "reset normal", or "reverse normal", to adjust the normal direction of the window. The user cannot be expected to know all this about normals, but right clicking is easier to discover. Unfortunately it hasn't been implemented. I think it wouldn't be that hard. Something like

Code: Select all

def reset_normal(self):
    self.normal = App.Vector(0, 0, 0)

def reverse_normal(self):
    self.normal = self.normal * -1
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.
Post Reply