Mesh Scale/it: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
Line 17: Line 17:
}}
}}


<span id="Description"></span>
==Descrizione==
==Descrizione==


Il comando '''Scala''' scala gli oggetti mesh.
Il comando '''Scala''' scala gli oggetti mesh.


<span id="Usage"></span>
==Utilizzo==
==Utilizzo==


Line 30: Line 32:
# Specificare un fattore di scala, il valore deve essere maggiore di {{Value|0}}.
# Specificare un fattore di scala, il valore deve essere maggiore di {{Value|0}}.
# Premere il bottone {{button|OK}} per terminare il comando.
# Premere il bottone {{button|OK}} per terminare il comando.

==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 43: Line 74:
{{Mesh Tools navi{{#translation:}}}}
{{Mesh Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 10:40, 2 May 2023

Other languages:

Scala

Posizione nel menu
Mesh → Scala...
Ambiente
Mesh
Avvio veloce
Nessuno
Introdotto nella versione
-
Vedere anche
Nessuno

Descrizione

Il comando Scala scala gli oggetti mesh.

Utilizzo

  1. Selezionaare uno o più oggetti mesh.
  2. Esistono diversi modi per invocare il comando:
    • Premere il bottone Mesh Scale.
    • Selezionare l'opzione Meshes → Scale... dal menu.
  3. Il box dialogo Scaling si apre.
  4. Specificare un fattore di scala, il valore deve essere maggiore di 0.
  5. Premere il bottone OK per terminare il comando.

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