Arch 3Views: Difference between revisions

From FreeCAD Documentation
(Marked this version for translation)
(Fixed Arch_IfcSpreadsheet link(s).)
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Template:UnfinishedDocu}}
<translate>
<translate>
<!--T:25-->
<!--T:25-->
{{Docnav
{{docnav|[[Arch_ToggleIfcBrepFlag|Toggle IFC Brep flag]]|[[Arch_MakeIfcSpreadsheet|Create IFC spreadsheet...]]|[[Arch_Module|Arch]]}}
|[[Arch_ToggleIfcBrepFlag|Toggle IFC Brep flag]]
|[[Arch_IfcSpreadsheet|Create IFC spreadsheet...]]
|[[Arch_Module|Arch]]
|IconL=Arch_ToggleIfcBrepFlag.svg
|IconR=Arch_IfcSpreadsheet.svg
|IconC=Workbench_Arch.svg
}}


<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand
|Name=Arch 3Views
|Name=Arch 3Views
|Workbenches=[[Arch Module|Arch]]
|MenuLocation=Arch → Utilities → 3 Views from mesh
|MenuLocation=Arch → Utilities → 3 Views from mesh
|Workbenches=[[Arch_Module|Arch]]
|SeeAlso=[[Arch SplitMesh]], [[Arch MeshToShape]]
|SeeAlso=[[Arch_SplitMesh|Arch SplitMesh]], [[Arch_MeshToShape|Arch MeshToShape]]
}}
}}


Line 16: Line 22:


<!--T:4-->
<!--T:4-->
{{Emphasis|This command is currently not in use.}} It will serve to generate flat, shape-based views from a [[Mesh Module|Mesh]] based object, to be used by the [[Arch Equipment]] tool.
{{Emphasis|This command is currently not in use.}} It will serve to generate flat, shape-based views from a [[Mesh_Module|Mesh]] based object, to be used by the {{KEY|[[Image:Arch Equipment.svg|24px]] [[Arch_Equipment|Arch Equipment]]}} tool.


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


<!--T:5-->
<!--T:5-->
# Select a Mesh object.
# Select a Mesh object.
# Select menu {{MenuCommand|Arch → Utilities → [[Image:Arch 3Views.svg|16px]] [[Arch 3Views|3Views]]}}.
# Select the {{KEY|[[Image:Arch 3Views.svg|16px]]}} button, or {{KEY|Arch}}{{KEY|Utilities}}{{KEY|[[Image:Arch 3Views.svg|16px]] [[Arch_3Views|3Views]]}} from the top menu.


== Scripting == <!--T:12-->
== Scripting == <!--T:12-->
{{Emphasis|See also:}} [[Arch API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[Arch_API|Arch API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:13-->
<!--T:13-->
This tool can be used in [[macros]] and from the [[Python]] console by using the following function:
This tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function:
</translate>
{{Code|code=
{{Code|code=
shape = createMeshView(obj, direction=FreeCAD.Vector(0, 0, -1), outeronly=False, largestonly=False)
shape = createMeshView(obj, direction=FreeCAD.Vector(0, 0, -1), outeronly=False, largestonly=False)
}}
}}
<translate>

<!--T:14-->
<!--T:14-->
* Creates a flat {{incode|shape}} that is the projection of the given mesh object ({{incode|obj}}) in the given {{incode|direction}}.
* Creates a flat {{incode|shape}} that is the projection of the given mesh object ({{incode|obj}}) in the given {{incode|direction}}.
Line 43: Line 50:
<!--T:16-->
<!--T:16-->
Example:
Example:
</translate>
{{Code|code=
{{Code|code=
import FreeCAD, Draft, Arch, Mesh, MeshPart
import FreeCAD, Draft, Arch, Mesh, MeshPart


<!--T:17-->
Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2000, 2000, 0)])
Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2000, 2000, 0)])
Wall = Arch.makeWall(Line, width=150, height=3000)
Wall = Arch.makeWall(Line, width=150, height=3000)
FreeCAD.ActiveDocument.recompute()
FreeCAD.ActiveDocument.recompute()


<!--T:18-->
Shape = Wall.Shape.copy(False)
Shape = Wall.Shape.copy(False)
Shape.Placement = Wall.getGlobalPlacement()
Shape.Placement = Wall.getGlobalPlacement()


<!--T:19-->
mesh_obj = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "Mesh")
mesh_obj = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "Mesh")
mesh_obj.Mesh = MeshPart.meshFromShape(Shape=Shape, MaxLength=520)
mesh_obj.Mesh = MeshPart.meshFromShape(Shape=Shape, MaxLength=520)
Line 61: Line 66:
FreeCAD.ActiveDocument.recompute()
FreeCAD.ActiveDocument.recompute()


<!--T:20-->
XAxis = FreeCAD.Vector(1, 0, 0)
XAxis = FreeCAD.Vector(1, 0, 0)
YAxis = FreeCAD.Vector(0, 1, 0)
YAxis = FreeCAD.Vector(0, 1, 0)
ZAxis = FreeCAD.Vector(0, 0, -1)
ZAxis = FreeCAD.Vector(0, 0, -1)


<!--T:21-->
s1 = Arch.createMeshView(mesh_obj, ZAxis)
s1 = Arch.createMeshView(mesh_obj, ZAxis)
s2 = Arch.createMeshView(mesh_obj, XAxis)
s2 = Arch.createMeshView(mesh_obj, XAxis)
s3 = Arch.createMeshView(mesh_obj, YAxis)
s3 = Arch.createMeshView(mesh_obj, YAxis)


<!--T:22-->
Part.show(s1)
Part.show(s1)
Part.show(s2)
Part.show(s2)
Part.show(s3)
Part.show(s3)


<!--T:23-->
Wall.ViewObject.Visibility = False
Wall.ViewObject.Visibility = False
mesh_obj.ViewObject.Visibility = False
mesh_obj.ViewObject.Visibility = False
}}
}}
<translate>


<!--T:26-->
<!--T:26-->
{{Docnav
{{docnav|[[Arch_ToggleIfcBrepFlag|Toggle IFC Brep flag]]|[[Arch_MakeIfcSpreadsheet|Create IFC spreadsheet...]]|[[Arch_Module|Arch]]}}
|[[Arch_ToggleIfcBrepFlag|Toggle IFC Brep flag]]
|[[Arch_IfcSpreadsheet|Create IFC spreadsheet...]]
|[[Arch_Module|Arch]]
|IconL=Arch_ToggleIfcBrepFlag.svg
|IconR=Arch_IfcSpreadsheet.svg
|IconC=Workbench_Arch.svg
}}


<!--T:11-->
[[Category:Arch]]

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

{{Userdocnavi{{#translation:}}}}

Revision as of 19:33, 9 December 2020

Arch 3Views

Menu location
Arch → Utilities → 3 Views from mesh
Workbenches
Arch
Default shortcut
None
Introduced in version
-
See also
Arch SplitMesh, Arch MeshToShape

Description

This command is currently not in use. It will serve to generate flat, shape-based views from a Mesh based object, to be used by the Arch Equipment tool.

Usage

  1. Select a Mesh object.
  2. Select the button, or ArchUtilities 3Views from the top menu.

Scripting

See also: Arch API and FreeCAD Scripting Basics.

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

shape = createMeshView(obj, direction=FreeCAD.Vector(0, 0, -1), outeronly=False, largestonly=False)
  • Creates a flat shape that is the projection of the given mesh object (obj) in the given direction.
  • If outeronly is True only the outer contour is taken into consideration, discarding the inner holes.
  • If largestonly is True only the largest segment of the given mesh will be used.

Use Part.show() to display the resulting flat shape.

Example:

import FreeCAD, Draft, Arch, Mesh, MeshPart

Line = Draft.makeWire([FreeCAD.Vector(0, 0, 0), FreeCAD.Vector(2000, 2000, 0)])
Wall = Arch.makeWall(Line, width=150, height=3000)
FreeCAD.ActiveDocument.recompute()

Shape = Wall.Shape.copy(False)
Shape.Placement = Wall.getGlobalPlacement()

mesh_obj = FreeCAD.ActiveDocument.addObject("Mesh::Feature", "Mesh")
mesh_obj.Mesh = MeshPart.meshFromShape(Shape=Shape, MaxLength=520)
mesh_obj.ViewObject.DisplayMode = "Flat Lines"
FreeCAD.ActiveDocument.recompute()

XAxis = FreeCAD.Vector(1, 0, 0)
YAxis = FreeCAD.Vector(0, 1, 0)
ZAxis = FreeCAD.Vector(0, 0, -1)

s1 = Arch.createMeshView(mesh_obj, ZAxis)
s2 = Arch.createMeshView(mesh_obj, XAxis)
s3 = Arch.createMeshView(mesh_obj, YAxis)

Part.show(s1)
Part.show(s2)
Part.show(s3)

Wall.ViewObject.Visibility = False
mesh_obj.ViewObject.Visibility = False