Arch Fence: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Docnav)
 
(21 intermediate revisions by 9 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:16-->
{{Docnav
|[[Arch_Frame|Frame]]
|[[Arch_Truss|Truss]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_Frame.svg
|IconR=Arch_Truss.svg
|IconC=Workbench_Arch.svg
}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Arch Fence|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch → Fence|Version=0.19}}
|Name=Arch Fence
|MenuLocation=Arch → Fence
|Workbenches=[[Arch_Workbench|Arch]]
|Version=0.19
}}


==Description== <!--T:2-->
==Description== <!--T:2-->


<!--T:3-->
<!--T:3-->
The [[Arch Fence|Arch Fence]] is a object that builds a fence by repeating a single fence post and section along a given path.
The [[Arch_Fence|Arch Fence]] is a object that builds a fence by repeating a single fence post and section along a given path.


</translate>
<!--T:13-->
[[Image:Arch Fence description example.png|600px]]
[[Image:Arch Fence description example.png|600px]]
<translate>


==How to use== <!--T:4-->
==Usage== <!--T:4-->


===Creating from scratch=== <!--T:5-->
===Creating from scratch=== <!--T:5-->
Line 19: Line 35:
<!--T:6-->
<!--T:6-->
# Use a workbench of your choice to create a single fence post and a single section.
# Use a workbench of your choice to create a single fence post and a single section.
# Create the path the fence should follow using the [[Sketcher Module|Sketcher Workbench]] or [[Draft Module|Draft Workbench]].
# Create the path the fence should follow using the [[Sketcher_Workbench|Sketcher Workbench]] or [[Draft_Workbench|Draft Workbench]].
# Switch back to the [[Arch Module|Arch Workbench]].
# Switch back to the [[Arch_Workbench|Arch Workbench]].
# Select the section, post and path in exactly that order.
# Select the section, post and path in exactly that order.
# Press the {{Button|[[Image:Arch Fence.svg|16px]] [[Arch Fence|Arch Fence]]}} button
# Press the {{Button|[[Image:Arch_Fence.svg|16px]] [[Arch_Fence|Arch Fence]]}} button


==Options== <!--T:7-->
==Options== <!--T:7-->
Line 33: Line 49:
==Properties== <!--T:9-->
==Properties== <!--T:9-->


=== Data === <!--T:10-->
=== Data === <!--T:28-->

<!--T:10-->
* {{PropertyData|Path}}: The path the fence should follow
* {{PropertyData|Path}}: The path the fence should follow
* {{PropertyData|Post}}: A single fence post to repeat
* {{PropertyData|Post}}: A single fence post to repeat
Line 39: Line 57:
* {{PropertyData|Number Of Posts}}: The total number of posts used to build the fence. This is calculated automatically.
* {{PropertyData|Number Of Posts}}: The total number of posts used to build the fence. This is calculated automatically.
* {{PropertyData|Number Of Sections}}: The total number of sections used to build the fence. This is calculated automatically.
* {{PropertyData|Number Of Sections}}: The total number of sections used to build the fence. This is calculated automatically.

=== View === <!--T:29-->

<!--T:19-->
* {{PropertyView|Use Original Colors}}: When set to {{TRUE}} the fence will use the colors from the original section and post. Otherwise the ShapeColor of the fence will be used to colorize the fence.

== Notes == <!--T:26-->

<!--T:27-->
* Arch Fence was introduced in FC v0.19 by user furti.
* [https://forum.freecadweb.org/viewtopic.php?t=36149 Forum thread] discussing Arch Fence functionality


==Scripting== <!--T:11-->
==Scripting== <!--T:11-->


<!--T:12-->
<!--T:12-->
The Fence tool can be used in [[macros]] and from the [[Python]] console by using the following function:
The Fence tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following function:

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 50: Line 80:
<translate>
<translate>


<!--T:14-->
<!--T:18-->
Example:
{{Arch Tools navi}}


</translate>
{{Code|code=
import FreeCAD
import Part
import Arch

parts = []

parts.append(Part.makeBox(2000, 50, 30, FreeCAD.Vector(0, 0, 1000 - 30)))
parts.append(Part.makeBox(2000, 50, 30))
parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector(0, 15, 30)))
parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector(1980, 15, 30)))

for i in range(8):
parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector((2000 / 9 * (i + 1)) - 10, 15, 30)))

Part.show(Part.makeCompound(parts), "Fence_section")
fence_section = FreeCAD.ActiveDocument.Fence_section

sketch = FreeCAD.ActiveDocument.addObject("Sketcher::SketchObject", "Path")
sketch.Placement = FreeCAD.Placement(FreeCAD.Vector(0, 0, 0), FreeCAD.Rotation(0, 0, 0, 1))
sketch.addGeometry(Part.LineSegment(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(20000, 0, 0)), False)
sketch.addGeometry(Part.LineSegment(FreeCAD.Vector(20000, 0, 0), FreeCAD.Vector(20000, 20000, 0)), False)

post = Part.makeBox(100, 100, 1000, FreeCAD.Vector(0, 0, 0))
Part.show(post, "Post")
post = FreeCAD.ActiveDocument.Post

Fence = Arch.buildFence(fence_section, post, sketch)
}}
<translate>


<!--T:17-->
{{Docnav
|[[Arch_Frame|Frame]]
|[[Arch_Truss|Truss]]
|[[Arch_Workbench|Arch]]
|IconL=Arch_Frame.svg
|IconR=Arch_Truss.svg
|IconC=Workbench_Arch.svg
}}


<!--T:15-->
{{Userdocnavi}}
</translate>
</translate>
{{Arch Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 14:18, 9 March 2022

Arch Fence

Menu location
Arch → Fence
Workbenches
Arch
Default shortcut
None
Introduced in version
0.19
See also
None

Description

The Arch Fence is a object that builds a fence by repeating a single fence post and section along a given path.

Usage

Creating from scratch

  1. Use a workbench of your choice to create a single fence post and a single section.
  2. Create the path the fence should follow using the Sketcher Workbench or Draft Workbench.
  3. Switch back to the Arch Workbench.
  4. Select the section, post and path in exactly that order.
  5. Press the Arch Fence button

Options

For now the tool assumes the following

  1. The Path is drawn on the XY-Plane
  2. Section and Post are drawn at the origin so that they stand upright in front view

Properties

Data

  • DataPath: The path the fence should follow
  • DataPost: A single fence post to repeat
  • DataSection: A single section to repeat
  • DataNumber Of Posts: The total number of posts used to build the fence. This is calculated automatically.
  • DataNumber Of Sections: The total number of sections used to build the fence. This is calculated automatically.

View

  • ViewUse Original Colors: When set to true the fence will use the colors from the original section and post. Otherwise the ShapeColor of the fence will be used to colorize the fence.

Notes

  • Arch Fence was introduced in FC v0.19 by user furti.
  • Forum thread discussing Arch Fence functionality

Scripting

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

Fence = buildFence(section, post, path)

Example:

import FreeCAD
import Part
import Arch

parts = []

parts.append(Part.makeBox(2000, 50, 30, FreeCAD.Vector(0, 0, 1000 - 30)))
parts.append(Part.makeBox(2000, 50, 30))
parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector(0, 15, 30)))
parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector(1980, 15, 30)))

for i in range(8):
    parts.append(Part.makeBox(20, 20, 1000 - 60, FreeCAD.Vector((2000 / 9 * (i + 1)) - 10, 15, 30)))

Part.show(Part.makeCompound(parts), "Fence_section")
fence_section = FreeCAD.ActiveDocument.Fence_section

sketch = FreeCAD.ActiveDocument.addObject("Sketcher::SketchObject", "Path")
sketch.Placement = FreeCAD.Placement(FreeCAD.Vector(0, 0, 0), FreeCAD.Rotation(0, 0, 0, 1))
sketch.addGeometry(Part.LineSegment(FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(20000, 0, 0)), False)
sketch.addGeometry(Part.LineSegment(FreeCAD.Vector(20000, 0, 0), FreeCAD.Vector(20000, 20000, 0)), False)

post = Part.makeBox(100, 100, 1000, FreeCAD.Vector(0, 0, 0))
Part.show(post, "Post")
post = FreeCAD.ActiveDocument.Post

Fence = Arch.buildFence(fence_section, post, sketch)