Arch MeshToShape: Difference between revisions

From FreeCAD Documentation
(The corresponding tool Part ShapeFromMesh from the Part Workbench might be more suited for objects that contain curved surfaces.)
m (grammar and markup)
Line 48: Line 48:


<!--T:8-->
<!--T:8-->
* Turns the given {{incode|obj}}, a mesh, into a shape, joining coplanar facets.
The above code snippet converts 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|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.
* 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.
* {{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|flat}} is {{incode|True}}, it will force the wires to be perfectly planar to be sure they can be converted into faces, but this might leave gaps in the final shell.
* If {{incode|cut}} is {{incode|True}} holes in faces are made by subtraction.
* If {{incode|cut}} is {{incode|True}}, holes in faces are made by subtraction.
</translate>
</translate>


Line 80: Line 80:
</translate>
</translate>
{{Arch Tools navi{{#translation:}}}}
{{Arch Tools navi{{#translation:}}}}

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

Revision as of 11:49, 6 March 2020

Arch MeshToShape

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

Description

Arch MeshToShape converts a selected Mesh (Mesh Feature) object into a Shape (Part Feature) object.

This tool is optimized for objects with flat faces (no curves). The corresponding tool Part ShapeFromMesh from the Part Workbench might be more suited for objects that contain curved surfaces.

Usage

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

Properties

Limitations

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)

The above code snippet converts 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 converted 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)