Difference between revisions of "Arch MeshToShape"

From FreeCAD Documentation
Jump to: navigation, search
m (Added template)
m
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
<translate>
 
<translate>
 
<!--T:11-->
 
<!--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}}
+
{{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-->
 
<!--T:1-->
Line 9: Line 16:
 
|MenuLocation=Arch → Utilities → Mesh to Shape
 
|MenuLocation=Arch → Utilities → Mesh to Shape
 
|Workbenches=[[Arch Module|Arch]]
 
|Workbenches=[[Arch Module|Arch]]
|SeeAlso=[[Arch SplitMesh]], [[Arch RemoveShape]]
+
|SeeAlso=[[Arch SplitMesh|Arch SplitMesh]], [[Arch RemoveShape|Arch RemoveShape]]
 
}}
 
}}
  
Line 15: Line 22:
  
 
<!--T:3-->
 
<!--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 {{KEY|[[Image:Workbench_Part.svg|16px]] [[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 {{KEY|[[Image:Workbench_Part.svg|16px]] [[Part Workbench|Part Workbench]]}} might be more suited for objects that contain curved surfaces.
  
 
==How to use== <!--T:4-->
 
==How to use== <!--T:4-->
Line 24: Line 31:
  
 
==Scripting== <!--T:6-->
 
==Scripting== <!--T:6-->
{{Emphasis|See also:}} [[Arch API]] and [[FreeCAD Scripting Basics]].
+
{{Emphasis|See also:}} [[Arch API|Arch API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
  
 
<!--T:7-->
 
<!--T:7-->
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>
 
</translate>
 
{{Code|code=
 
{{Code|code=
Line 55: Line 62:
 
}}
 
}}
 
<translate>
 
<translate>
 +
 
<!--T:12-->
 
<!--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}}
+
{{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-->
 
<!--T:13-->

Revision as of 11:02, 21 January 2020

Other languages:
čeština • ‎Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎română • ‎русский • ‎svenska

Arch MeshToShape.svg 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 Workbench Part.svg Part Workbench might be more suited for objects that contain curved surfaces.

How to use

  1. Select a mesh object.
  2. Press the Arch MeshToShape.svg 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)