Macro FlattenWire: Difference between revisions
(Created page with '{{Macro|Name=FlattenWire|Description=This macro flattens draft wires that are not plane to their median Z coordinate|Author=Yorik}} import FreeCAD obj = FreeCAD.ActiveDocument…') |
mNo edit summary |
||
Line 9: | Line 9: | ||
for p in obj.Points: newppoints.append(FreeCAD.Vector(p.x,p.y,z)) |
for p in obj.Points: newppoints.append(FreeCAD.Vector(p.x,p.y,z)) |
||
obj.Points = newppoints |
obj.Points = newppoints |
||
{{languages | {{es|Macro_FlattenWire/es}} }} |
Revision as of 17:01, 24 August 2011
Description |
---|
This macro flattens draft wires that are not plane to their median Z coordinate Author: Yorik |
Author |
Yorik |
Download |
None |
Links |
Macros recipes How to install macros How to customize toolbars |
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