Tutorial custom placing of windows and doors/ru

Введение
Этот учебник покажет как поместить спроектированное пользователем окна и двери в модели здания. Он использует верстаки Draft, Arch, и Sketcher.

Используются следующие инструменты: Draft Grid, Draft Snap, Draft Wire, Arch Wall, Arch Window, и Sketcher NewSketch. Пользователь должен быть знаком с установкой ограничений в эскизах.

Этот учебник был вдохновлён учебниками, написанными jpg87 на форумах FreeCAD.
 * Arch Create a custom window
 * Arch : How to use your custom Window

Установка
1. Откройте FreeCAD, создайте новый пустой документ, и переключитесь на Верстак Arch.

2. Убедитесь, что единицы измерения установлены в меню правильно. Например, хороши для работы с расстояниями в типичных строениях; и установите число знаков после запятой на , чтобы учитывать малейшие доли метра.

3. Используйте кнопку Показывать сетку для показа сетки с достаточным разрешением. Вы можете изменить вид сетки в меню. Установите линии через каждые, с главными линиями каждые линий (каждый метр), и  всего (сетка покрывает площадь 50 x 50 метров).

4. Отодвиньте трёхмерный вид, если сетка слишком близка.

Теперь мы готовы сделать простейшую стену, где мы установим окна и двери.

Установка стены
5. Используйте инструмент Draft Wire для создания полилинии. Ведите её против часовой стрелки.
 * 5.1. Первая точка в (0, 4, 0); в диалоге введите ,   ,.
 * 5.2. Вторая точка в (2, 0, 0); в диалоге введите ,   ,.
 * 5.3. Третья точка в (4, 0, 0); в диалоге введите ,   ,.
 * 5.4. Четвёртая точка в (6, 2, 0); в диалоге введите ,   ,.
 * 5.4. Пятая точка в (6, 5, 0); в диалоге введите ,   ,.
 * 5.5. На клавиатуре нажмите для завершения полилинии.
 * 5.6. На клавиатуре нажмите для получения аксонометрического вида модели.
 * убедитесь, что чекбокс не отмечен, когда вводите абсолютные координаты.
 * точки могут быть определены указателем мыши по точкам сетки, с помощью панели Draft Snap и метода Draft Grid.
 * вы можете создать формы программированием на Python. Учтите, что большинство функций ожидают ввод в миллиметрах.

6. ВЫделите и кликните инструмент Arch Wall; появится стена с шириной (толщиной) по умолчанию 0,2 м и высотой 3 м.





Установка стандартных дверей и окон
7. Кликните инструмент Arch Window; в ниспадающем списке Preset выделите, и установите высоту в 2 м.
 * 7.1. Установите привязку на Draft Midpoint, и попробуйте выделить нижнюю грань передней стены; поверните standard view как требуется, чтобы зацепить грань, а не поверхность стены; когда активна средняя точка, кликните для установки двери.
 * 7.2. Кликните снова инструмент Arch Window, и установите другую дверь, на сей раз в средней точке крайней правой стены; поворачивайте standard view по необходимости.




 * это дистанция от пола до нижнего края элемента. Для дверей обычно 0 m, поскольку двери обычно на уровне пола; с другой стороны, окна обычно отделяет от пола от 0.5 до 1.5 m.  может быть установлен только при создании окна или двери из заготовки. Когда окно или двери вставлены, корректируйте их размещение редактированием вектора    базового эскиза (Sketch).

Создание пользовательских дверей и окон
8. Switch to the Sketcher Workbench; select the part of the wall to the right that has no door; click on the Sketcher NewSketch; select as attachment method. If the existing geometry obstructs your view, click on Sketcher ViewSection to remove it.

9. Draw a fancy sketch containing three closed wires. Make sure to provide constraints to all wires.
 * 9.1. The outside wire is the biggest one, and will define the main dimensions of the window object, and the size of the hole created when it's embedded in an Arch Wall. Make sure the dimensions are named appropriately, for example, and . A constraint also defines the curvature of the outer wire; give it an appropriate name, like.
 * 9.2. The second wire is offset from the outer wire, and together with it, they define the width of the fixed frame of the window. Name the offset appropriately, for example, . It will be used for both the top vertical and horizontal offsets. The bottom offset, if set to zero, will result in the fixed frame touching the bottom of the window; this can be used to model a door instead of a window. Give it an appropriate name, like.
 * 9.3. The third, innermost wire is offset from the second wire, and together with it, they define the frame of the window that can open. The innermost wire also defines the size of the glass panel. Again, give meaningful names to these offsets, for example, and.
 * 9.4. In order to build succesfully the sketch, use horizontal (Sketcher ConstrainHorizontal) and vertical (Sketcher ConstrainVertical) constraints for the straight sides; use auxiliary construction geometry (Sketcher ToggleConstruction), and tangential constraints (Sketcher ConstrainTangent) to correctly place the circular arcs at the top. As in this case the window is symmetrical, consider equality (Sketcher ConstrainEqual), symmetrical (Sketcher ConstrainSymmetric), and point on object (Sketcher ConstrainPointOnObject) constraints where it makes sense.





10. Once the sketch is fully constrained, press to exit the sketch (Sketcher LeaveSketch).
 * 10.1. Since a face of the wall was selected during the initial step of creating the sketch, the sketch is co-planar with that face; however, it may be in the wrong position, away from the wall. If this is the case, adjust within . Set  to  so the sketch is centered in the wall, and it is one meter above the floor level.
 * 10.2. You can see the named constraints under . The values can be modified to see the sketch change dimensions immediately.





11. Change back to the Arch Workbench and, with the new selected, use Arch Window. A window will be created, and will make a hole in the wall. The window is made from a custom sketch, and not from a preset, so it needs to be edited in order to correctly display its components, that is, the fixed frame, the inner frame, and the glass panel.



Настройка пользовательского окна
12. In the tree view select underlying, and press , or change the property  to.

13. Double click in the tree view to start editing it.
 * 13.1. Inside the dialog there are two panes,  and . There are three wires,, , and , and one component, . The wires refer to the closed loops that were drawn in the sketch; the components define the areas in the sketch that will be extruded to create frame or glass panels with real thicknesses; these areas are delimited by the wires. A window created from a preset already has two components,  and . The custom window needs to be edited to have a similar structure.




 * 13.2. Click on, and click the button to eliminate it.


 * 13.3. Click ; this shows the properties of a new component like, , , , , , and . Give a name, such as , choose for , and click on  and then ; they should highlight in the 3D viewport. Add a small value for , , and check the checkbox to add the default value. This default value is the length assigned to the  property; a similar default can be assigned to the  property. Click the  button to finish editing the component.


 * 13.4. Click ; give another name, such as, choose for , and click on  and then . Add a sensible , , and , . Then click the  button.


 * 13.5. Click ; give another name, such as, choose for , and click on . Add a sensible , , and , . Then click the  button. If any of the three components needs to be modified, select it and press ; modifications are only saved after pressing the  button.




 * 13.6. If everything is set, click to finish editing the window. The sketch may become hidden again, but the window will show distinct solid elements for the, the , and the . Give a value of  to  to assign a default thickness, which will be added to the value specified in the  component.





Duplicating the custom window
14. In the tree view, select and its underlying. Then go to, and answer if asked to duplicate unselected dependencies. A new and  will appear in the same position as the original elements.

15. Select the new. Go to the property, and click on the ellipsis next to the  value. In the 3D viewport select the left side of the wall which doesn't have any element; rotate the standard view as necessary. Change the to [-1 m, 0 m, 0 m] to center the window, and click. The sketch and the window should appear in a new position.
 * the attachment operation can also be performed by changing to the Part Workbench, and then using the menu.



16. You may adjust the dimensions of the new window by changing the named parameters in under, for example, set  to , and  to. Then press + to recompute the model. If the wall doesn't show a bigger hole for the new window, select the wall in the tree view, right click and choose, then press + again.

17. These operations have changed the position of the new window, but the opening in the wall doesn't look correct. It is slanted, that is, the hole is not perpendicular to the face of the wall, and it may even cut other parts of the wall. The problem is that has retained the  information of the original.



Normals of doors and windows
18. Each Arch Window object controls the extrusion of its body and the opening that is created in its host wall by means of the.

The normal is a vector that indicates a direction perpedicular to a wall. When a window or door preset is created with the Arch Window tool directly over an Arch Wall, the normal is automatically calculated, and the resulting window or door is correctly aligned; the first two objects, and, were created in this way.

In similar way, when a sketch is created by selecting a planar surface, it is oriented on this plane. Then when the Arch Window tool is used, the window will use as normal the perpendicular direction to the sketch. This was the case with the third object, the custom.

If the window already exists and needs to be moved, as was the case with the duplicated object, the sketch needs to be remapped to another plane; doing this moves both the sketch and the window, but the latter doesn't automatically update its normal, so it has incorrect extrusion information. The normal needs to be calculated manually and written to.

The three values of the normal vector are calculated as following.

Where is the angle of the local Z axis of the sketch with respect to the global Y axis.

When a sketch is created, it always has two axes, a local X (red) and a local Y (green). If the sketch is mapped to the global XY working plane, then these axes are aligned; but if the sketch is mapped on the global XZ or global YZ planes, as is common with windows and doors (the sketches are "standing up"), then the local Z (blue) forms an angle with the global Y axis; this angle varies from -180 to 180 degrees. The angle is considered positive if it opens counterclockwise, and it is negative if it opens clockwise, starting from the global Y axis.





If we look at the geometry created so far, we see the following normals.


 * The local Z is aligned with the global Y, therefore, the is zero. The normal vector is
 * The local Z is aligned with the global Y, therefore, the is zero. The normal vector is

or is.


 * The local Z is rotated 90 degrees from the global Y, therefore, the is 90 (positive, because it opens counterclockwise). The normal vector is
 * The local Z is rotated 90 degrees from the global Y, therefore, the is 90 (positive, because it opens counterclockwise). The normal vector is

or is.


 * The local Z is rotated 45 degrees from the global Y, therefore, the is 45 (positive, because it opens counterclockwise). The normal vector is
 * The local Z is rotated 45 degrees from the global Y, therefore, the is 45 (positive, because it opens counterclockwise). The normal vector is

or is.


 * The local Z direction is found by using the Draft Dimension tool and measuring the angle that the wall trace makes with the global Y axis, or any line aligned to it. This angle is ; the desired angle is the complement to this, so.
 * The local Z direction is found by using the Draft Dimension tool and measuring the angle that the wall trace makes with the global Y axis, or any line aligned to it. This angle is ; the desired angle is the complement to this, so.

This means the local Z axis is rotated 63.43 degrees from the global Y, therefore, the is -63.46 (negative, because it opens clockwise). The normal vector is

Therefore should be changed to.

After doing these changes, recompute the model with +. If the wall doesn't update the hole, select it in the tree view, right click and choose, then press + again.

19. The orientation of the extrusion of the window is resolved, together with the opening in the wall.



Final remarks
20. As demonstrated, the initial placement of the Arch Window is very important. The user should either
 * use the Arch Window tool to insert and automatically align a preset to a wall, or
 * map a sketch to the desired wall, and build the window after that.

If a window already exists, and it needs to be moved, the supporting sketch should be remapped to a new plane, and the of the window needs to be recalculated.

The new normal direction can be obtained by measuring the of the new wall with respect to the global Y axis, considering whether this angle is positive (counterclockwise) or negative (clockwise), and using a simple formula.

To confirm that the operations are correct, the absolute magnitude of the normal vector should be one. That is,