Arch MeshToShape: Difference between revisions

From FreeCAD Documentation
(Created page with '{{GuiCommand|Name=Arch MeshToShape|Workbenches=Arch|MenuLocation=Arch -> Conversion Tools -> Mesh to Shape|SeeAlso=Arch RemoveShape}} ==Description== This t…')
 
(Marked this version for translation)
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
{{GuiCommand|Name=Arch MeshToShape|Workbenches=[[Arch Module|Arch]]|MenuLocation=Arch -> Conversion Tools -> Mesh to Shape|SeeAlso=[[Arch RemoveShape]]}}
<translate>
<!--T:11-->
{{docnav|[[Arch_SplitMesh|Split Mesh]]|[[Arch_SelectNonSolidMeshes|Select non-solid meshes]]|[[Arch_Module|Arch]]|IconL=Arch_SplitMesh.svg |IconC=Workbench_Arch.svg |IconR=Arch_SelectNonSolidMeshes.png}}


<!--T:1-->
==Description==
{{GuiCommand
|Name=Arch MeshToShape
|MenuLocation=Arch → Utilities → Mesh to Shape
|Workbenches=[[Arch Module|Arch]]
|SeeAlso=[[Arch SplitMesh]], [[Arch RemoveShape]]
}}


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

<!--T:3-->
This tool converts a selected [[Mesh Module|Mesh]] object into a [[Part Module|Shape]] object. Note that this tool is optimized for objects with flat faces (no curves). The corresponding tool from the [[Part Workbench]] might be more suited for objects that contain curved surfaces.
This tool converts a selected [[Mesh Module|Mesh]] object into a [[Part Module|Shape]] object. Note that this tool is optimized for objects with flat faces (no curves). The corresponding tool from the [[Part Workbench]] might be more suited for objects that contain curved surfaces.


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

<!--T:5-->
# Select a mesh object.
# Press the {{Button|[[Image:Arch MeshToShape.svg|16px]] [[Arch MeshToShape|Mesh to Shape]]}} entry in {{MenuCommand|Arch Utilities Mesh to Shape}}.

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

<!--T:7-->
This tool can be used in [[macros]] and from the [[Python]] console by using the following function:
</translate>
{{Code|code=
new_obj = meshToShape(obj, mark=True, fast=True, tol=0.001, flat=False, cut=True)
}}
<translate>

<!--T:8-->
* Turns the given {{incode|obj}}, a mesh, into a shape, joining coplanar facets.
* If {{incode|mark}} is {{incode|True}}, non-solid objects will be marked in red.
* If {{incode|fast}} is {{incode|True}} it uses a faster algorithm by building a shell from the facets then removing splitter.
* {{incode|tol}} is the tolerance used when converting mesh segments to wires.
* If {{incode|flat}} is {{incode|True}} it will force the wires to be perfectly planar, to be sure they can be turned into faces, but this might leave gaps in the final shell.
* If {{incode|cut}} is {{incode|True}} holes in faces are made by subtraction.
</translate>

{{Code|code=
import Arch, Mesh, BuildRegularGeoms


Box = FreeCAD.ActiveDocument.addObject("Mesh::Cube", "Cube")
# Select a mesh object
Box.Length = 1000
# Press the {{KEY|[[Image:Arch MeshToShape.png|16px]] '''Mesh to Shape'''}} entry in Arch -> Conversion Tools menu
Box.Width = 2000
Box.Height = 1000
FreeCAD.ActiveDocument.recompute()


new_obj = Arch.meshToShape(Box)
==Scripting==
}}
<translate>
<!--T:12-->
{{docnav|[[Arch_SplitMesh|Split Mesh]]|[[Arch_SelectNonSolidMeshes|Select non-solid meshes]]|[[Arch_Module|Arch]]|IconL=Arch_SplitMesh.svg |IconC=Workbench_Arch.svg |IconR=Arch_SelectNonSolidMeshes.png}}


<!--T:13-->
This tool can by used in [[macros]] and from the python console by using the following function:
{{Arch Tools navi}}


<!--T:14-->
'''meshToShape (object,[mark])''': turns a mesh into a shape, joining coplanar facets. If
{{Userdocnavi}}
mark is True (default), non-solid objects will be marked in red
</translate>

Revision as of 22:39, 9 February 2019

Arch MeshToShape

Menu location
Arch → Utilities → Mesh to Shape
Workbenches
Arch
Default shortcut
None
Introduced in version
-
See also
Arch SplitMesh, Arch RemoveShape

Description

This tool converts a selected Mesh object into a Shape object. Note that this tool is optimized for objects with flat faces (no curves). The corresponding tool from the Part Workbench might be more suited for objects that contain curved surfaces.

How to use

  1. Select a mesh object.
  2. Press the Mesh to Shape entry in Arch → Utilities → Mesh to Shape.

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:

new_obj = meshToShape(obj, mark=True, fast=True, tol=0.001, flat=False, cut=True)
  • Turns the given obj, a mesh, into a shape, joining coplanar facets.
  • If mark is True, non-solid objects will be marked in red.
  • If fast is True it uses a faster algorithm by building a shell from the facets then removing splitter.
  • tol is the tolerance used when converting mesh segments to wires.
  • If flat is True it will force the wires to be perfectly planar, to be sure they can be turned into faces, but this might leave gaps in the final shell.
  • If cut is True holes in faces are made by subtraction.
import Arch, Mesh, BuildRegularGeoms

Box = FreeCAD.ActiveDocument.addObject("Mesh::Cube", "Cube")
Box.Length = 1000
Box.Width = 2000
Box.Height = 1000
FreeCAD.ActiveDocument.recompute()

new_obj = Arch.meshToShape(Box)