OpenSCAD ScaleMeshFeature: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 30: Line 30:


<!--T:5-->
<!--T:5-->
# Select the mesh object to be scaleed.
# Select the mesh object to be scaled.
# Click the {{KEY|OpenSCAD → Scale Mesh Feature...}} menu.
# Click the {{KEY|OpenSCAD → Scale Mesh Feature...}} menu.
# Select the desired axis in the dialog, or enter your own custom axis to use and click OK.
# Select the desired axis in the dialog, or enter your own custom axis to use and click OK.
* A new mesh object is created and mirrored, the original object is rendered hidden.
* A new mesh object is created and scaled, the original object is rendered hidden.


==Limitations== <!--T:16-->
==Limitations== <!--T:16-->


<!--T:6-->
<!--T:6-->
* The new mesh object is not parametric to the original mesh object, which means any changes to the original object do not get reflected in the new mirrored object.
* The new mesh object is not parametric to the original mesh object, which means any changes to the original object do not get reflected in the new scaled object.


==Notes== <!--T:17-->
==Notes== <!--T:17-->
Line 48: Line 48:
import OpenSCADUtils
import OpenSCADUtils
import Mesh
import Mesh
#this assumes an existing object in the document named "Mesh" that you wish to mirror
#this assumes an existing object in the document named "Mesh" that you wish to scale
original_mesh = App.ActiveDocument.Mesh
original_mesh = App.ActiveDocument.Mesh
scaled_mesh = OpenSCADUtils.scalemesh(original_mesh.Mesh, FreeCAD.Base.Vector(1,0,0))
scaled_mesh = OpenSCADUtils.scalemesh(original_mesh.Mesh, FreeCAD.Base.Vector(1,0,0))

Revision as of 12:54, 16 August 2020

Other languages:

OpenSCAD ScaleMesh

Menu location
OpenSCAD → Scale Mesh Feature
Workbenches
OpenSCAD
Default shortcut
None
Introduced in version
-
See also
Mesh Scale

Description

Creates a new scaled mesh object with independent scaling for each axis.

Usage

  1. Select the mesh object to be scaled.
  2. Click the OpenSCAD → Scale Mesh Feature... menu.
  3. Select the desired axis in the dialog, or enter your own custom axis to use and click OK.
  • A new mesh object is created and scaled, the original object is rendered hidden.

Limitations

  • The new mesh object is not parametric to the original mesh object, which means any changes to the original object do not get reflected in the new scaled object.

Notes

  • The function does not modify the existing mesh, but returns a new mesh.
  • The function can be accessed via python:
import OpenSCADUtils
import Mesh
#this assumes an existing object in the document named "Mesh" that you wish to scale
original_mesh = App.ActiveDocument.Mesh
scaled_mesh = OpenSCADUtils.scalemesh(original_mesh.Mesh, FreeCAD.Base.Vector(1,0,0))
Mesh.show(scaled_mesh)