Arch : How to use your custom Window

A place to share learning material: written tutorials, videos, etc.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Arch : How to use your custom Window

Post by jpg87 »

Hi,
Here's another tutorial for duplicating, positioning, guiding and embedding your custom window in a host wall.

https://www.dropbox.com/s/deysvhc3pjk1x ... w.pdf?dl=0
(Fixed some details on December 27, 2018)

En français : https://www.dropbox.com/s/y2ginnkvm46c0 ... e.pdf?dl=0

Design by jpg87.jpg
Design by jpg87.jpg (83.37 KiB) Viewed 5370 times
My website : http://help-freecad-jpg87.fr updated 2023/11/06
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Arch : How to use your custom Window

Post by paullee »

Thanks for the tutorial!

Very comprehensive! Learn new feature I haven't used :)
User avatar
regis
Posts: 725
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: Arch : How to use your custom Window

Post by regis »

Dangerously cool. :lol:
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch : How to use your custom Window

Post by vocx »

jpg87 wrote: Sun Dec 23, 2018 9:12 pm Hi,
Here's another tutorial for duplicating, positioning, guiding and embedding your custom window in a host wall.
I think it's pretty cool. Could you document the parts of the window better in the Arch Window wiki? The wiki produces the official documentation and I think it is missing in the description of the placement of Windows and Doors, especially if you want to rotate them. In particular the Normal property is not well described in the wiki. Using the sine and cosine functions to calculate the normal of the window should be described better, because otherwise it looks like it works by magic.
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
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Arch : How to use your custom Window

Post by jpg87 »

vocx wrote: Sat Mar 30, 2019 6:19 am I think it's pretty cool. Could you document the parts of the window better in the Arch Window wiki? The wiki produces the official documentation and I think it is missing in the description of the placement of Windows and Doors, especially if you want to rotate them. In particular the Normal property is not well described in the wiki. Using the sine and cosine functions to calculate the normal of the window should be described better, because otherwise it looks like it works by magic.
Thank you.
I'll see what I can do, but for the wiki it will take me a little longer !
My website : http://help-freecad-jpg87.fr updated 2023/11/06
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch : How to use your custom Window

Post by vocx »

jpg87 wrote: Sun Mar 31, 2019 2:18 pm Thank you.
I'll see what I can do, but for the wiki it will take me a little longer !
I took inspiration from your tutorial and produced this Tutorial custom placing of windows and doors. I am not sure if the description of the Normal is entirely correct. For example, what happens when the Window is placed on an inclined wall or roof. How is the normal calculated in that case; the Z component should be non-zero I presume.

I would think the Arch Window or Door should be smart enough to recalculate the Normal if it's moved. Maybe this can be improved in the code.
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
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Arch : How to use your custom Window

Post by jpg87 »

vocx wrote: Sun Mar 31, 2019 7:45 pm I took inspiration from your tutorial and produced this Tutorial custom placing of windows and doors.
I consulted your tutorial from the automatic translation of Google (I do not master enough reading directly from a text written in English to be sure to understand everything).
I notice that you make many explanations about why actions: it is very good for those who wait more. In my case, I have the bad habit of writing rather "instructions" (which I call "push buttons"!).
vocx wrote: Sun Mar 31, 2019 7:45 pm I am not sure if the description of the Normal is entirely correct. For example, what happens when the Window is placed on an inclined wall or roof. How is the normal calculated in that case; the Z component should be non-zero I presume.
The normal is of course a three-dimensional vector: there will be a non-zero component in Z.
vocx wrote: Sun Mar 31, 2019 7:45 pm I would think the Arch Window or Door should be smart enough to recalculate the Normal if it's moved. Maybe this can be improved in the code.
When I wrote my tutorial, I also thought that normal was automatically recalculated. I had named the dimensions in the basic sketch of the wall hoping to be able to modify the walls and windows parametrically. If I remember correctly, everything was not working perfectly yet, but I'm sure it will become possible ...

A general remark: I know that Draft WB is an important tool for Arch WB. But I find that using Sketcher WB is so much more user-friendly now that I've added the NewSketch icon to the Arch toolbars and use it all the time. But it's a personal point of view of course!
My website : http://help-freecad-jpg87.fr updated 2023/11/06
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch : How to use your custom Window

Post by vocx »

jpg87 wrote: Tue Apr 02, 2019 5:37 pm I notice that you make many explanations about why actions: it is very good for those who wait more. In my case, I have the bad habit of writing rather "instructions" (which I call "push buttons"!).
There are different styles of learning. Some people just want to be told what to do. Other people want to know "why". So I try to be direct, but explain the reasoning as well.
The normal is of course a three-dimensional vector: there will be a non-zero component in Z.
But how do you calculate it in that case?
When I wrote my tutorial, I also thought that normal was automatically recalculated.
The normal is automatically calculated, but the value needs to be set to [0,0,0], apparently. It will not always work, of course. I went on a search for information, and I wrote this [Discussion] Orientation of Windows and Doors.

One of the important threads is an old one. Arch Window on Non-Linear Wall?
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)
More information about this needs to be included in the wiki documentation, but I haven't had time to add it, so maybe you'd like to also contribute.
A general remark: I know that Draft WB is an important tool for Arch WB. But I find that using Sketcher WB is so much more user-friendly now that I've added the NewSketch icon to the Arch toolbars and use it all the time. But it's a personal point of view of course!
I think the BIM Workbench has the Sketcher NewSketch in the toolbars. The BIM Workbench is made by the same author of Draft and Arch, Yorik, and it extends Arch with more tools for a better experience with architectural design. If you are serious into working with buildings, you should probably install BIM through the AddonManager.

I don't remember where I read this, maybe in his own blog, but in general Yorik favors Draft objects (Draft Wire mostly). I think the reasoning is that Draft Wires can Draft Snap to the grid and to other objects, while Sketches can't. This allows you to place objects in a very precise location visually, without entering exact numbers. The Draft Stretch operation is also a fairly recent tool, which means it is possible to stretch the underlying wire of an Arch Walls and see the results immediately.

I think for drawing Windows and Doors, Sketcher makes the most sense, as you need to control fine details; but for everything else, Draft wires work okay. Being honest I couldn't use Sketcher with Arch when I first tried FreeCAD, so I stuck to Draft; maybe if I had had a different experience early on, the story would have gone differently.
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
jpg87
Posts: 809
Joined: Thu Mar 16, 2017 7:16 am
Location: Limoges - France
Contact:

Re: Arch : How to use your custom Window

Post by jpg87 »

vocx wrote: Tue Apr 02, 2019 7:22 pm The normal is of course a three-dimensional vector: there will be a non-zero component in Z.

But how do you calculate it in that case?
The predefined windows appear to fit properly on a sloping roof structure.
For custom windows, I do tests to set the normal, but it's still not clear enough.

vocx wrote: Tue Apr 02, 2019 7:22 pm I think the BIM Workbench has the Sketcher NewSketch in the toolbars. The BIM Workbench is made by the same author of Draft and Arch, Yorik, and it extends Arch with more tools for a better experience with architectural design. If you are serious into working with buildings, you should probably install BIM through the AddonManager.
I have already tested the BIM: the NewSketch tool is actually integrated. In fact, I only "play" with Arch and BIM. I am a training mechanic. My workflow in Arch is not very conventional.

vocx wrote: Tue Apr 02, 2019 7:22 pm The normal is automatically calculated, but the value needs to be set to [0,0,0], apparently.
I read Yorik's explanations. If I understand correctly, as often in FC, if we leave zeros, FC uses its own results. We must enter these values ​​only if there is a problem.

vocx wrote: Tue Apr 02, 2019 7:22 pm One of the important threads is an old one. Arch Window on Non-Linear Wall?

yorik wrote: ↑
Thu Apr 27, 2017 2: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)

More information about this needs to be included in the wiki documentation, but I haven't had time to add it, so maybe you'd like to also contribute.
I do not know how to program. So, as I did in the tutorial that you quote, I like to work from pilot sketches to adjust the movements or positioning from these sketches.
What I would like is to be able to add my custom windows to the list of predefined windows. Do you know how to do it?
My website : http://help-freecad-jpg87.fr updated 2023/11/06
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Arch : How to use your custom Window

Post by vocx »

jpg87 wrote: Wed Apr 03, 2019 3:20 pm I do not know how to program. So, as I did in the tutorial that you quote, I like to work from pilot sketches to adjust the movements or positioning from these sketches.
I don't mean that you need to program, just that if you identify how things work, you should put the information in the part of the wiki that deals with it. Then more people will become aware of the quirks that FreeCAD has.
What I would like is to be able to add my custom windows to the list of predefined windows. Do you know how to do it?
I checked the code, it seems the first eight window and door presets are hardcoded into the ArchWindow.py file. This guarantees that if a user needs a window or door, at least a few presets will always be available.
https://github.com/FreeCAD/FreeCAD/blob ... ow.py#L225

You can get more presets by installing the Parts Library from the AddonManager. Then the window tool will search a directory for additional presets.
https://github.com/FreeCAD/FreeCAD/blob ... ow.py#L760

The Parts Library installs to the directory $HOME/.FreeCAD/Mod/parts_library/

In particular, the preset files should be in the architectural section, under Window or Door, and under another directory, for example,

Code: Select all

/home/username/.FreeCAD/Mod/parts_library/Architectural\ Parts/Windows/Custom/
/home/username/.FreeCAD/Mod/parts_library/Architectural\ Parts/Doors/Custom/
The presets are nothing more than FreeCAD files containing a single window based on a parametric sketch that has named constrains. So, if you already built a nice window, you may copy it to a single file, place it in the parts_library directory, and it should be found. However, at this point you are basically importing a FreeCAD file just like any other. So instead of using the Parts Library, you may wish to keep all your reusable components in your own folder and include them into your working project as you see fit.

However, if you really want to contribute to the Parts Library, the README says

Code: Select all

If you made some interesting objects with FreeCAD, why not share them here? Others might find them
useful. The procedure is simple:

1. Create a github account for yourself
2. Fork this repository using the "Fork" button on the top right corner of this page
3. Follow the [github instructions](https://help.github.com/articles/fork-a-repo/) to clone your fork on your computer
4. Make all the changes you need, create more folders if necessary, and place your files in them
5. Upload (push) your changes to your fork on github (refer to the github help for instructions)
6. When your fork has been updated, you can submit a [pull request](https://help.github.com/articles/creating-a-pull-request/) to have your changes merged into the official library. A member of the community will review your proposed additions and accept the merge.

Each Part should be correctly named, and placed into subdirectories by family or type. They should also
be available in both .FcStd and .stp formats, and optionally in .stl format (because github lets you
visualize them). They should also be as simple as possible, and parametric
so users can easily change their dimensions. In the file properties of each .FcStd file, the author
should also be mentioned, and the license information if available.

**Note**: Please DO NOT use accented characters in your file names, thanks!!!

If you are interested in contributing to this library on a more long-term basis, please ask for write 
access to this repository on this FreeCAD forum thread: http://forum.freecadweb.org/viewtopic.php?f=19&t=4205
The Parts Library is its own github repository, https://github.com/FreeCAD/FreeCAD-library You should commit parts to it.
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