Macro FlattenWire

From FreeCAD Documentation
Revision as of 17:24, 24 August 2011 by Splineman (talk | contribs)

Generic macro icon. Create your personal icon with the same name of the macro FlattenWire

Description
Esta macro aplana contornos de croquizado que no son planos a la mediana de su coordenada Z

Author: Yorik
Author
Yorik
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

import FreeCAD
obj = FreeCAD.ActiveDocument.ActiveObject
z = 0
for p in obj.Points: z += p.z
z = z/len(obj.Points)
newpoints = []
for p in obj.Points: newppoints.append(FreeCAD.Vector(p.x,p.y,z))
obj.Points = newppoints
Available translations of this page: