Arch Roof: Difference between revisions

From FreeCAD Documentation
(API and scripting links)
m ((Vertical Docnav))
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>
<!--T:30-->
{{docnav
|[[Arch_Grid|Grid]]
|[[Arch_Space|Space]]
|[[Arch_Module|Arch]]
|IconL=Arch_Grid.svg
|IconC=Workbench_Arch.svg
|IconR=Arch_Space.svg
}}

<!--T:13-->
<!--T:13-->
{{GuiCommand
{{GuiCommand
Line 15: Line 25:
The Roof tool allows you to create a sloped roof from a selected wire. The created roof object is parametric, keeping its relationship with the base object. The principle is that each edge is seen allotting a profile of roof (slope, width, overhang, thickness).
The Roof tool allows you to create a sloped roof from a selected wire. The created roof object is parametric, keeping its relationship with the base object. The principle is that each edge is seen allotting a profile of roof (slope, width, overhang, thickness).


<!--T:29-->
This tool is still in development, and might fail with very complex shapes.
This tool is still in development, and might fail with very complex shapes.


Line 64: Line 75:
</translate>
</translate>
{{Code|code=
{{Code|code=
makeRoof (baseobj,[facenr],[angles],[runs],[idrel],[thickness],[overhang],[name])
Roof = makeRoof(baseobj=None, facenr=0, angles=[45.,], run=[], idrel=[0,], thickness=[50.,], overhang=[100.,], name="Roof")
}}
}}
<translate>
<translate>

<!--T:24-->
<!--T:24-->
* Creates a {{incode|Roof}} object from the given {{incode|baseobj}}, which can be a closed wire or a solid object.
:Makes a roof based on a closed wire. You can provide a list of angles, run, idrel, thickness, overhang for each edges in the wire to define the roof shape. The default for angle is 45 and the list is automatically complete to match with number of edges in the wire.
** If {{incode|baseobj}} is a wire, you can provide lists for {{incode|angles}}, {{incode|run}}, {{incode|idrel}}, {{incode|thickness}}, and {{incode|overhang}}, for each edge in the wire to define the shape of the roof.
** The lists are automatically completed to match the number of edges in the wire.


<!--T:25-->
<!--T:25-->
Line 74: Line 88:
</translate>
</translate>
{{Code|code=
{{Code|code=
import Arch, Draft
import FreeCAD, Arch, Draft

rect = Draft.makeRectangle(30,40)
Rect = Draft.makeRectangle(3000, 4000)
Arch.makeRoof(rect,angles=[30.,])
Roof = Arch.makeRoof(Rect, angles=[30.,])
FreeCAD.ActiveDocument.recompute()

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(1000, 1000, 0)
p3 = FreeCAD.Vector(0, 2000, 0)
Wire = Draft.makeWire([p1, p2, p3], closed=True)
Roof2 = Arch.makeRoof(Wire)
FreeCAD.ActiveDocument.recompute()
}}
}}
<translate>


<translate>
<!--T:28-->
<!--T:28-->
{{docnav
|[[Arch_Grid|Grid]]
|[[Arch_Space|Space]]
|[[Arch_Module|Arch]]
|IconL=Arch_Grid.svg
|IconC=Workbench_Arch.svg
|IconR=Arch_Space.svg
}}

<!--T:31-->
{{Arch Tools navi}}
{{Arch Tools navi}}

<!--T:32-->
{{Userdocnavi}}
{{Userdocnavi}}
</translate>
</translate>

Revision as of 18:01, 6 December 2019

Arch Roof

Menu location
Arch → Roof
Workbenches
Arch
Default shortcut
R F
Introduced in version
-
See also
Arch Structure, Arch Wall

Description

The Roof tool allows you to create a sloped roof from a selected wire. The created roof object is parametric, keeping its relationship with the base object. The principle is that each edge is seen allotting a profile of roof (slope, width, overhang, thickness).

This tool is still in development, and might fail with very complex shapes.

View from above a building model showing the roof with certain transparency

How to use

  1. Create a wire with following the counterclockwise direction and select it.
  2. Press the Arch Roof button, or press R then F keys
  3. The default roof object could have a strange shape, it's because the tool have not all the needed informations.
  4. After creating the default roof, double click on the object in the tree view to access and edit all the properties. Angle must be between 0 and 90.
  5. Each line correspond to a roof pane. So you can set properties you want for each roof pane.
  6. To help you, you can set Angle or Run to 0 and defined a Relative Id, this make automatic calculs to find the data relative to the relative Id.
  7. It work like this :
    1. If Angle = 0 and Run = 0 then profile is identical to the relative profile.
    2. If Angle = 0 then angle is calculated so that the height is the same one as the relative profile.
    3. If Run = 0 then Run is calculated so that the height is the same one as the relative profile.
  8. At the end, set an angle to 90° to make a gable.
  9. Also you can check this video : https://www.youtube.com/watch?v=4Urwru71dVk

Options

Properties

  • DataAngles: List of the slope angle of the roof pane (an angle for each edge in the wire).
  • DataRuns: List of the width of the roof pane (a run for each edge in the wire).
  • DataIdRel: List of relation Id The slope angle of the roof
  • DataThickness: List of thickness of the roof pane. (a thickness for each edge in the wire).
  • DataOverhang: List of the overhang of the roof pane (an overhang for each edge in the wire).
  • DataFace: The face index of the base object to be used #Not really used

Scripting

See also: Arch API and FreeCAD Scripting Basics.

The Roof tool can be used in macros and from the Python console by using the following function:

Roof = makeRoof(baseobj=None, facenr=0, angles=[45.,], run=[], idrel=[0,], thickness=[50.,], overhang=[100.,], name="Roof")
  • Creates a Roof object from the given baseobj, which can be a closed wire or a solid object.
    • If baseobj is a wire, you can provide lists for angles, run, idrel, thickness, and overhang, for each edge in the wire to define the shape of the roof.
    • The lists are automatically completed to match the number of edges in the wire.

Example:

import FreeCAD, Arch, Draft

Rect = Draft.makeRectangle(3000, 4000)
Roof = Arch.makeRoof(Rect, angles=[30.,])
FreeCAD.ActiveDocument.recompute()

p1 = FreeCAD.Vector(0, 0, 0)
p2 = FreeCAD.Vector(1000, 1000, 0)
p3 = FreeCAD.Vector(0, 2000, 0)
Wire = Draft.makeWire([p1, p2, p3], closed=True)
Roof2 = Arch.makeRoof(Wire)
FreeCAD.ActiveDocument.recompute()