There are different issues here, so it's not easy to sort things out.
Basically the wall alignment works like this: You have a baseline only, which can be positioned any possible way in space. So it's not possible to tell which side is left or right. So what we try is to figure out a normal direction. When we have a baseline and a normal direction (basically a perpendicular direction to it, which indicates "the up side"), then we can consistently tell where left and right are, given the direction of the baseline. This is a very basic vector math cross product operation.
Obviously, if the direction of the baseline OR the normal is flipped, the right and left sides change. So indeed the direction in which you draw wall segments is important.
The normal direction can not always be guessed. If you have a (non-linear) polyline, for example, the normal direction is easy. But for a single line, there are 360° possible normal directions.
The wall object does a very simple guess in that last case, basically picking the one from these 360 that points upwards on the Z axis. But it can fail for any number of reasons too.
At the end I would say this: It fails often, indeed, many walls get inverted left/right sides, but it's a solid system that makes the walls behave consistently even if you move or rotate them in any possible position, allowing to use walls not only for "classical", vertical walls, but any other situation where you'd require a wall-like object. I think overall the system is valid.
Maybe we could refine it, though. For example, check against the current working plane at wall creation, try to guess better, an store somewhere if the above rule needs to be inverted
Why are windows sometimes placed upside down and back to front
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 44
- Joined: Fri May 18, 2018 9:07 pm
Re: Why are windows sometimes placed upside down and back to front
My original wall was based on a simple orthagonal dwire in the xy plane with aligned with the x and y axes. As such I would expect all the face normal vectors of the wall to have the simple normalised formats 1,0,0, 0,1,0 or 0,0,1. Hovever what I see when things go wrong are working planes with rotational axes 1/√3,1/√3,1/√3. My suspicion would fall on floating points
errors, especially comparison with zero straddle. If you are interested, have a look at this excellent web site https://floating-point-gui.de, the xkcd link is a corker.
Roger
errors, especially comparison with zero straddle. If you are interested, have a look at this excellent web site https://floating-point-gui.de, the xkcd link is a corker.
Roger
Last edited by wearyhacker on Sun Dec 08, 2019 3:43 pm, edited 2 times in total.
Re: Why do arch wall segements sometimes have inside and outside reversed.
@yorik
I have to admit that I do not understand how there can be confusion about what is 'up' when you have an extruded wall with a normal property. But the problem that prompted this discussion: some windows are inserted 180 degrees rotated (upside down) may (indeed) be a different issue than the topic title suggests. The current behavior (see my previous 2 posts) is a bit strange IMO.
You mention that Walls should have some flexibility regarding their position in 3D space. But at the moment walls can only be based on pre-made sketches if they are parallel to the global XY plane.
I have to admit that I do not understand how there can be confusion about what is 'up' when you have an extruded wall with a normal property. But the problem that prompted this discussion: some windows are inserted 180 degrees rotated (upside down) may (indeed) be a different issue than the topic title suggests. The current behavior (see my previous 2 posts) is a bit strange IMO.
You mention that Walls should have some flexibility regarding their position in 3D space. But at the moment walls can only be based on pre-made sketches if they are parallel to the global XY plane.
-
- Posts: 44
- Joined: Fri May 18, 2018 9:07 pm
Re: Why are windows sometimes placed upside down and back to front
I propose we change the thread title to "Why are windows sometimes placed upside down and back to front". As long as forum can still still track the thread. At least it would allow me to remove the type from my original version.
Last edited by wearyhacker on Sun Dec 08, 2019 3:43 pm, edited 1 time in total.
Re: Why do arch wall segments sometimes have inside and outside reversed.
I'll start a new topic to discuss this issue.
Last edited by Roy_043 on Sun Dec 08, 2019 4:05 pm, edited 1 time in total.
Re: Why do arch wall segements sometimes have inside and outside reversed.
You should be able to do it editing your first postwearyhacker wrote: ↑Fri Dec 06, 2019 7:09 pm I propose we change the thread title to "Why are windows sometimes placed upside down and back to front".
follow my experiments on BIM modelling for architecture design
Re: Why are windows sometimes placed upside down and back to front
About the new topic title: "Why are windows sometimes placed upside down and back to front".
I can only confirm the upside down problem. The issue does not seem to involve back to front placement. In the image the door on the left was inserted first. The 2nd door was inserted 180 degrees rotated (upside down) but not back to front.
I can only confirm the upside down problem. The issue does not seem to involve back to front placement. In the image the door on the left was inserted first. The 2nd door was inserted 180 degrees rotated (upside down) but not back to front.
- Attachments
-
- 2nd_Door_180degrees_Rotated.png (9.24 KiB) Viewed 1113 times
Re: Why are windows sometimes placed upside down and back to front
I'm getting this trouble too on FreeCAD 0.20; Place a door on a wall and orientation is correct, then place another door on the same wall and orientation is upside-down.
Re: Why are windows sometimes placed upside down and back to front
PR to fix the upside-down issue:
https://github.com/FreeCAD/FreeCAD/pull/7249
https://github.com/FreeCAD/FreeCAD/pull/7249