Mesh TrimByPlane: Difference between revisions
(Added button option) |
(Button text.) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 28: | Line 28: | ||
<!--T:6--> |
<!--T:6--> |
||
# Select a single mesh object and a single [[ |
# Select a single mesh object and a single [[Part_Plane|Part plane]]. The (extended) plane should intersect the mesh object. |
||
# There are several ways to invoke the command: |
# There are several ways to invoke the command: |
||
#* Press the {{Button|[[Image:Mesh_TrimByPlane.svg|16px]] [[Mesh_TrimByPlane| |
#* Press the {{Button|[[Image:Mesh_TrimByPlane.svg|16px]] [[Mesh_TrimByPlane|Trim mesh with a plane]]}} button. |
||
#* Select the {{MenuCommand|Meshes → Cutting → [[Image:Mesh_TrimByPlane.svg|16px]] Trim mesh with a plane}} option from the menu. |
#* Select the {{MenuCommand|Meshes → Cutting → [[Image:Mesh_TrimByPlane.svg|16px]] Trim mesh with a plane}} option from the menu. |
||
# The {{MenuCommand|Trim by plane}} dialog box opens. |
# The {{MenuCommand|Trim by plane}} dialog box opens. |
||
Line 37: | Line 37: | ||
#* {{button|Above}} |
#* {{button|Above}} |
||
#* {{button|Split}}: removes the faces and parts of faces above the plane, and creates a new mesh object containing them. |
#* {{button|Split}}: removes the faces and parts of faces above the plane, and creates a new mesh object containing them. |
||
==Scripting== <!--T:8--> |
|||
<!--T:9--> |
|||
See also: [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]]. |
|||
<!--T:10--> |
|||
To trim a mesh with a plane use its {{incode|trimByPlane}} method. |
|||
</translate> |
|||
{{Code|code= |
|||
import FreeCAD as App |
|||
import Mesh |
|||
# Create a non-parametric box-shaped mesh: |
|||
msh = App.ActiveDocument.addObject("Mesh::Feature", "Mesh") |
|||
msh.Mesh = Mesh.createBox(30, 40, 50) |
|||
msh.ViewObject.DisplayMode = "Flat Lines" |
|||
# Define a plane by a base point and a normal vector: |
|||
pnt = App.Vector(25, 0, 0) |
|||
nor = App.Vector(0, 0, 1) |
|||
# We need to work on a copy of the msh.Mesh object: |
|||
new_msh = msh.Mesh.copy() |
|||
# Trim that copy: |
|||
new_msh.trimByPlane(pnt, nor) |
|||
# Update msh.Mesh: |
|||
msh.Mesh = new_msh |
|||
}} |
|||
<translate> |
|||
Line 52: | Line 85: | ||
{{Mesh Tools navi{{#translation:}}}} |
{{Mesh Tools navi{{#translation:}}}} |
||
{{Userdocnavi{{#translation:}}}} |
{{Userdocnavi{{#translation:}}}} |
||
{{clear}} |
Latest revision as of 16:44, 25 November 2023
Mesh TrimByPlane |
Menu location |
---|
Meshes → Cutting → Trim mesh with a plane |
Workbenches |
Mesh |
Default shortcut |
None |
Introduced in version |
- |
See also |
Mesh PolyCut, Mesh PolyTrim |
Description
The Mesh TrimByPlane command trims faces and parts of faces on one side of a plane from a mesh object.
Usage
- Select a single mesh object and a single Part plane. The (extended) plane should intersect the mesh object.
- There are several ways to invoke the command:
- Press the Trim mesh with a plane button.
- Select the Meshes → Cutting → Trim mesh with a plane option from the menu.
- The Trim by plane dialog box opens.
- Select the side you want to keep by pressing one of the buttons:
- Below
- Above
- Split: removes the faces and parts of faces above the plane, and creates a new mesh object containing them.
Scripting
See also: FreeCAD Scripting Basics.
To trim a mesh with a plane use its trimByPlane
method.
import FreeCAD as App
import Mesh
# Create a non-parametric box-shaped mesh:
msh = App.ActiveDocument.addObject("Mesh::Feature", "Mesh")
msh.Mesh = Mesh.createBox(30, 40, 50)
msh.ViewObject.DisplayMode = "Flat Lines"
# Define a plane by a base point and a normal vector:
pnt = App.Vector(25, 0, 0)
nor = App.Vector(0, 0, 1)
# We need to work on a copy of the msh.Mesh object:
new_msh = msh.Mesh.copy()
# Trim that copy:
new_msh.trimByPlane(pnt, nor)
# Update msh.Mesh:
msh.Mesh = new_msh
Mesh
- Miscellaneous: Import mesh, Export mesh, Create mesh from shape, Regular solid, Unwrap Mesh, Unwrap Face
- Modifying: Harmonize normals, Flip normals, Fill holes, Close hole, Add triangle, Remove components, Remove components by hand, Smooth, Refinement, Decimation, Scale
- Boolean: Union, Intersection, Difference
- Cutting: Cut mesh, Trim mesh, Trim mesh with a plane, Create section from mesh and plane, Cross-sections
- Components and segments: Merge, Split by components, Create mesh segments, Create mesh segments from best-fit surfaces
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub