Macro Draw 2D Function/it: Difference between revisions
(Updating to match new version of source page) |
m (Created page with "{{Macro/it|Icon=Text-x-python|Name=draw2DFunction|Name/it=draw2DFunction|Description= Si usa per disegnare una funzione descritta da una equazione z=F(x) (piano Z-X)|Author=ig...") |
||
Line 1: | Line 1: | ||
{{Macro|Icon=Text-x-python|Name=draw2DFunction|Description= |
{{Macro/it|Icon=Text-x-python|Name=draw2DFunction|Name/it=draw2DFunction|Description= Si usa per disegnare una funzione descritta da una equazione z=F(x) (piano Z-X)|Author=ignoto}} |
||
Use it to draw a function described by a "equation" [z=F(x)] (Z-X plane) The example done here generate a parabol.<br /> |
Use it to draw a function described by a "equation" [z=F(x)] (Z-X plane) The example done here generate a parabol.<br /> |
Revision as of 11:01, 25 December 2013
File:Text-x-python draw2DFunction |
Descrizione |
---|
Si usa per disegnare una funzione descritta da una equazione z=F(x) (piano Z-X) Autore: ignoto |
Autore |
ignoto |
Download |
None |
Link |
Raccolta di macro Come installare le macro Personalizzare la toolbar |
Versione macro |
1.0 |
Data ultima modifica |
None |
Versioni di FreeCAD |
None |
Scorciatoia |
Nessuna |
Vedere anche |
Nessuno |
Use it to draw a function described by a "equation" [z=F(x)] (Z-X plane) The example done here generate a parabol.
Needs to be defined :
F = variable used in the function,
X = initial value of x,
Nb = Number of step,
Z = function express with x
ZZ = function express with xx
import FreeCAD, FreeCADGui, Part
import math
F=800
X=-500
Nb=10
Step=1000/Nb
Y=0
for I in range(Nb):
XX=X+Step
Z=X*X/(4*F)
ZZ=XX*XX/(4*F)
if I==0:
print "Le test est vrai !"
nomme=Part.makeLine((X,Y,Z),(XX,Y,ZZ))
WWire=Part.Wire([nomme])
else :
print "Le test est 2 !"
nomme=Part.makeLine((X,Y,Z),(XX,Y,ZZ))
WWire=Part.Wire([WWire,nomme])
X=XX
Part.show(WWire)