Mesh Scale/de: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
Line 32: Line 32:
# Specify a scaling factor, the value must be larger than {{Value|0}}.
# Specify a scaling factor, the value must be larger than {{Value|0}}.
# Press the {{button|OK}} button to finish the command.
# Press the {{button|OK}} button to finish the command.

==Scripting==

See also: [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].

To scale a mesh use its {{incode|transformGeometry}} method.

{{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(10, 10, 10)
msh.ViewObject.DisplayMode = "Flat Lines"

# Create and scale a matrix:
mat = App.Matrix()
mat.scale(2.0, 3.0, 4.0) # Unequal scaling.

# We need to work on a copy of the msh.Mesh object:
new_msh = msh.Mesh.copy()

# Transform that copy:
new_msh.transformGeometry(mat)

# Update msh.Mesh:
msh.Mesh = new_msh
}}




Line 45: Line 74:
{{Mesh Tools navi{{#translation:}}}}
{{Mesh Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 10:40, 2 May 2023

Mesh Skalieren

Menüeintrag
Netze → Skalieren...
Arbeitsbereich
Mesh
Standardtastenkürzel
Keiner
Eingeführt in Version
-
Siehe auch
Keiner

Beschreibung

Der Befehl Mesh Skalieren passt die Größe von Netzobjekten an.

Anwendung

  1. Select one or more mesh objects.
  2. There are several ways to invoke the command:
    • Press the Mesh Scale button.
    • Select the Meshes → Scale... option from the menu.
  3. The Scaling dialog box opens.
  4. Specify a scaling factor, the value must be larger than 0.
  5. Press the OK button to finish the command.

Scripting

See also: FreeCAD Scripting Basics.

To scale a mesh use its transformGeometry 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(10, 10, 10)
msh.ViewObject.DisplayMode = "Flat Lines"

# Create and scale a matrix:
mat = App.Matrix()
mat.scale(2.0, 3.0, 4.0) # Unequal scaling.

# We need to work on a copy of the msh.Mesh object:
new_msh = msh.Mesh.copy()

# Transform that copy:
new_msh.transformGeometry(mat)

# Update msh.Mesh:
msh.Mesh = new_msh