FreeCAD 0.17 and Arch Window

A forum dedicated to the Draft, Arch and BIM workbenches development.
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

FreeCAD 0.17 and Arch Window

Postby damian » Wed Sep 14, 2016 8:54 am

OS: Ubuntu 14.04.5 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8405 (Git)
Build type: None
Branch: master
Hash: 05a25967bd756405a688526f4b63c5fad6e71378
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17

Good morning

The Arch's presets are working well in FreeCAD 0.17. There is a curious thing with the windows.

1º) I've drawn a wall, which is not parallel to X axis
Kazam_screenshot_00000.png
Kazam_screenshot_00000.png (265.2 KiB) Viewed 2423 times
2º) I try to draw a window and I have two situations:
if I move the cursor down and left all is correct
Kazam_screenshot_00001.png
Kazam_screenshot_00001.png (259.21 KiB) Viewed 2423 times
if I move the cursor up and right the window takes a mistake normal
Kazam_screenshot_00002.png
Kazam_screenshot_00002.png (260.38 KiB) Viewed 2423 times
This is the end result
Kazam_screenshot_00003.png
Kazam_screenshot_00003.png (282.54 KiB) Viewed 2423 times
If the wall is 'wireframe', in all situations the normal is wrong

Frequently, I like to draw the windows from scratch, and in FreeCAD 0.17 I am having problems.
Kazam_screenshot_00004.png
Kazam_screenshot_00004.png (287.66 KiB) Viewed 2423 times
In this last case, the normal is correct but the window takes the placement of the base sketch, when the window's placement must be angle 0 axis (0,0,1) position (0,0,0). And it doesn't also execute the removeComponents.
Running the Python command 'Arch_Window' failed:
Traceback (most recent call last):
File "/usr/lib/freecad-daily/Mod/Arch/ArchWindow.py", line 432, in Activated
FreeCADGui.doCommand("host=Arch.make"+Draft.getType(host)+"(FreeCAD.ActiveDocument."+host.Name+")")
File "/usr/lib/freecad-daily/Mod/Draft/Draft.py", line 171, in getType
if "Proxy" in obj.PropertiesList:

'list' object has no attribute 'PropertiesList'
am I loosing anything?

Thank you
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: FreeCAD 0.17 and Arch Window

Postby damian » Wed Sep 14, 2016 12:58 pm

About making windows from scratch, in FreeCAD 0.16

Code: Select all

>>> sketch.Support
(<Part::PartFeature>, ['Face1'])
>>> 
in FreeCAD 0.17

Code: Select all

>>> sketch.Support
[(<Part::PartFeature>, ('Face1',))]
>>> 
lines 415 to 418 in ArchWindow.py
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: FreeCAD 0.17 and Arch Window

Postby damian » Wed Sep 14, 2016 1:12 pm

and making the window from scratch with a Draft rectangle, in FreeCAD 0.17
Kazam_screenshot_00000.png
Kazam_screenshot_00000.png (227.81 KiB) Viewed 2391 times
in FreeCAD 0.16 this operation works fine
User avatar
yorik
Site Admin
Posts: 11031
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: FreeCAD 0.17 and Arch Window

Postby yorik » Fri Sep 16, 2016 2:39 am

Hm indeed some bugs seem to have appeared when creating windows from a sketch, I'll look into it...
But for your first problems, everything seems normal here, I think you probably didn't snap correctly to the face. Try enabling the "nearest" snap, usually it works better
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: FreeCAD 0.17 and Arch Window

Postby damian » Fri Sep 16, 2016 12:39 pm

yorik wrote:But for your first problems, everything seems normal here
It does not a problem. I commented it because it seems curious.
The issue seems to be that I define the wall's face as working plane (I was drawing something in the face). If I maintain the original working plane (xy), the mechanism is much more precise. Please, forget it.
yorik wrote:some bugs seem to have appeared when creating windows from a sketch
Yes, the improvements in the sketcher module. This really is important.
Thank you
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: FreeCAD 0.17 and Arch Window

Postby damian » Sun Sep 18, 2016 9:06 am

Good morning:
I would like to do a more regulated description of the problem "creating a window from scratch in FreeCAD 0.17".

The steps to reproduce the 'bug' are included in Window's wiki page (http://freecadweb.org/wiki/index.php?title=Arch_Window):
Creating from scratch
Optionally, select a face on the Arch object where you want the window to be incuded
Switch to the Sketcher Workbench
Create a new sketch
Draw one or more closed wires
Close the sketch
Switch back to the Arch Workbench
Press the Arch Window.png Arch Window button, or press W then I keysquote
The problems are two:
1º) when the new window object takes its base object in ArchWindow.py line 67

Code: Select all

obj.Base = baseobj
it also copy the baseobj.Placement, resulting a window with mistaken Placement.
I would like to propose doing

Code: Select all

obj.Base = baseobj
pl = FreeCAD.Placement()
obj.Placement = pl
2º) when the windowCommand executes removeComponent in ArchWindow.py line 439, it looks for a Tuple in line 415, but finds a List, resulting that the remove command is not executed
I would like to propose doing

Code: Select all

if isinstance(obj.Support,list):
    host = obj.Support[0][0]
This two patch are working fine for me, for the moment ...
By
User avatar
yorik
Site Admin
Posts: 11031
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: FreeCAD 0.17 and Arch Window

Postby yorik » Mon Sep 19, 2016 7:12 pm

I don't like much your first idea, because, if, for example, you draw a sketch on a wall, if you do that, the window will not be placed on top of the sketch. I actually don't see what case this would be fixing?

Your second proposal I just added in git commit 008fed6.
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: FreeCAD 0.17 and Arch Window

Postby damian » Tue Sep 20, 2016 8:46 am

yorik wrote:I don't like much your first idea
me too ...
Renato Rebelo
Posts: 255
Joined: Mon May 19, 2014 1:14 pm
Location: Vouzela - Portugal

Re: FreeCAD 0.17 and Arch Window

Postby Renato Rebelo » Tue Nov 22, 2016 10:45 pm

damian wrote:and making the window from scratch with a Draft rectangle, in FreeCAD 0.17
Kazam_screenshot_00000.png
in FreeCAD 0.16 this operation works fine
Hello Yorik
I can confirm that the sketch-based window location bug remains :(

Renato

OS: Ubuntu 16.04.1 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8972 (Git)
Build type: None
Branch: master
Hash: 14594dde32d3af23d496a0b630db18480e618249
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
my native language is not English, please excuse me any incorrectness, I apologize for any inconvenience caused, thank you
User avatar
yorik
Site Admin
Posts: 11031
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: FreeCAD 0.17 and Arch Window

Postby yorik » Thu Nov 24, 2016 8:37 pm

Renato Rebelo wrote:I can confirm that the sketch-based window location bug remains :(
Hopefully this should now be fixed with git commit 6b8b3ec