156 lines
8.1 KiB
HTML
156 lines
8.1 KiB
HTML
<html><head><title>Macro Assemblage Imprimante 3D/it</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Macro Assemblage Imprimante 3D/it</h1></div>
|
|
|
|
<div id="mw-content-text" lang="it" dir="ltr" class="mw-content-ltr"><hr/><div class="mw-parser-output"><table class="fcinfobox wikitable ct" width="100%" style="float: right; width: 230px; margin-left: 10px;">
|
|
<tr>
|
|
<td class="ctTitle">
|
|
<h3><span class="mw-headline" id="Macro_Assemblage_Imprimante_3D"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Text-x-python.png" class="image"><img alt="Text-x-python.png" src="32px-Text-x-python.png" width="32" height="32" srcset="/wiki/images/2/2c/Text-x-python.png 1.5x" /></a> Macro_Assemblage_Imprimante_3D</span></h3>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Descrizione
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven left">Simula il movimento di una stampante 3D sull'asse Z.
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Autore
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Fran6t&action=edit&redlink=1" class="new" title="User:Fran6t (page does not exist)">fran6t</a>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Link
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=Macros_recipes/it" title="Macros recipes/it">Esempi di macro</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=How_to_install_macros/it" title="How to install macros/it">Come installare le Macro</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=Customize_Toolbars/it" title="Customize Toolbars/it">Personalizzare la barra degli strumenti</a>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Versione
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven macro-version">1.0
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Data ultima modifica
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven macro-date">2015-07-13
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctToc"><br /><div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
|
|
<ul>
|
|
<li class="toclevel-1"><a href="#Macro_Assemblage_Imprimante_3D"><span class="tocnumber">1</span> <span class="toctext">Macro_Assemblage_Imprimante_3D</span></a></li>
|
|
<li class="toclevel-1 tocsection-1"><a href="#Uso"><span class="tocnumber">2</span> <span class="toctext">Uso</span></a></li>
|
|
<li class="toclevel-1 tocsection-2"><a href="#Il_File"><span class="tocnumber">3</span> <span class="toctext">Il File</span></a></li>
|
|
<li class="toclevel-1 tocsection-3"><a href="#Script"><span class="tocnumber">4</span> <span class="toctext">Script</span></a></li>
|
|
<li class="toclevel-1 tocsection-4"><a href="#Link"><span class="tocnumber">5</span> <span class="toctext">Link</span></a></li>
|
|
</ul>
|
|
</div>
|
|
|
|
</td></tr>
|
|
</table>
|
|
<p><br />
|
|
</p><p>Simula il movimento di una stampante 3D sull'asse Z
|
|
</p>
|
|
<div class="floatleft"><a href="https://www.freecadweb.org/wiki/index.php?title=File:Assemblage_Imprimante_3D.gif" class="image"><img alt="Assemblage Imprimante 3D.gif" src="Assemblage_Imprimante_3D.gif" width="495" height="530" /></a></div><div style="clear:both"></div>
|
|
<h2><span class="mw-headline" id="Uso">Uso</span></h2>
|
|
<p>Scaricare il file e aprirlo in FreeCAD
|
|
</p><p>Copiare la macro e incollarla nella console Python
|
|
</p><p>Per interrompere l'animazione digitare:
|
|
</p>
|
|
<pre>animation.stop() </pre>
|
|
<h2><span class="mw-headline" id="Il_File">Il File</span></h2>
|
|
<p><a rel="nofollow" class="external text" href="http://blog.passion-tarn-et-garonne.info/public/3D/pb-avec-freecad/00-assemblage-total.fcstd">00_assemblage_total.fcstd</a>
|
|
</p>
|
|
<h2><span class="mw-headline" id="Script">Script</span></h2>
|
|
<p>L'autore dello script che è stato adottato per questo progetto è <b><a rel="nofollow" class="external text" href="http://forum.freecadweb.org/memberlist.php?mode=viewprofile&u=2538">Javier Martínez García (JMG)</a></b>.
|
|
</p><p>00-assemblage-total.FCMacro
|
|
</p>
|
|
<pre># Mouvement va et vient du chariot et tete selon axe Z
|
|
#
|
|
# Pour arreter l'animation il faut taper animation.stop() dans la console
|
|
|
|
__author__ = "Javier Martínez García"
|
|
|
|
import FreeCAD as App, FreeCADGui as Gui, Part, time, sys, math, Draft, DraftGeomUtils
|
|
|
|
try:
|
|
from PyQt4 import QtGui,QtCore
|
|
except Exception:
|
|
from PySide import QtGui,QtCore
|
|
|
|
class Animation(object):
|
|
def __init__(self):
|
|
App.Console.PrintMessage('init')
|
|
App.ActiveDocument.recompute()
|
|
self.timer = QtCore.QTimer()
|
|
QtCore.QObject.connect(self.timer, QtCore.SIGNAL("timeout()"), self.my_update)
|
|
self.timer.start(50)
|
|
|
|
self.an = 0
|
|
self.Tige_Guide_X = 142
|
|
self.X_End_Tendeur = 90
|
|
self.X_Chariot = 102
|
|
self.Nema_17_motor_X = 119
|
|
self.Anti_Backslash_Z_Gauche = 88
|
|
self.Jhead_droite = 126.5
|
|
self.enstopX = 168
|
|
self.sens = 1
|
|
|
|
def my_update(self):
|
|
if ( self.an == 0 ) :
|
|
self.sens = 1
|
|
if ( self.an == 245 ) :
|
|
self.sens = -1
|
|
self.an = self.an + self.sens
|
|
self.Tige_Guide_X = self.Tige_Guide_X + self.sens
|
|
self.X_End_Tendeur = self.X_End_Tendeur + self.sens
|
|
self.X_Chariot = self.X_Chariot + self.sens
|
|
self.Nema_17_motor_X = self.Nema_17_motor_X + self.sens
|
|
self.Jhead_droite = self.Jhead_droite + self.sens
|
|
self.Anti_Backslash_Z_Gauche = self.Anti_Backslash_Z_Gauche + self.sens
|
|
self.enstopX = self.enstopX + self.sens
|
|
|
|
#12-X-End-Moteur
|
|
#FreeCAD.getDocument("_0_assemblage_total").getObject("Pocket013").Placement = App.Placement(App.Vector(-133,0,self.an),App.Rotation(App.Vector(0,0,1),0))
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("refine002").Placement = App.Placement(App.Vector(0,0,self.an),App.Rotation(App.Vector(0,0,1),0))
|
|
#Tige-Guide-X
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Pad025").Placement = App.Placement(App.Vector(-180,13.55,self.Tige_Guide_X),App.Rotation(App.Vector(0.57735,0.57735,0.57735),120))
|
|
#14-X-End-Tendeur
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Pocket011").Placement = App.Placement(App.Vector(236,0,self.X_End_Tendeur),App.Rotation(App.Vector(0,0,1),0))
|
|
#13-X-Chariot
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Pocket014").Placement = App.Placement(App.Vector(-18,25,self.X_Chariot),App.Rotation(App.Vector(1,0,0),90))
|
|
#Nema-17-motor-X
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Chamfer003").Placement = App.Placement(App.Vector(-205.2,63,self.Nema_17_motor_X),App.Rotation(App.Vector(1,0,0),90))
|
|
#15-Anti-Backslash-Z-x2-1
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Pad012").Placement = App.Placement(App.Vector(-156,-15,self.Anti_Backslash_Z_Gauche),App.Rotation(App.Vector(0.999985,0.00555547,0),180))
|
|
#Jhead-Droite
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("Pocket015").Placement = App.Placement(App.Vector(-50.8,-4.4,self.Jhead_droite),App.Rotation(App.Vector(0,0,1),0))
|
|
#Endstop X
|
|
FreeCAD.getDocument("_0_assemblage_total").getObject("refine003").Placement = App.Placement(App.Vector(-154.2,15,self.enstopX),App.Rotation(App.Vector(0.57735,0.57735,-0.57735),120))
|
|
def stop(self):
|
|
self.timer.stop()
|
|
|
|
animation = Animation() </pre>
|
|
<h2><span class="mw-headline" id="Link">Link</span></h2>
|
|
<p>La pagina della discussione nel forum: <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=12&t=11782">Je galere pour tourner une piece</a>
|
|
</p><p>Il canale Youtube dell'autore della macro <a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=KynMmsLJXV0">FreeCAD: Gear Animation Tutorial</a> e il suo <a rel="nofollow" class="external text" href="http://linuxforanengineer.blogspot.com.es/p/me.html">blog</a>
|
|
</p>
|
|
<div style="clear:both"></div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div><div class="printfooter">
|
|
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Macro_Assemblage_Imprimante_3D/it&oldid=240005">http://www.freecadweb.org/wiki/index.php?title=Macro_Assemblage_Imprimante_3D/it&oldid=240005</a>"</div>
|
|
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
|
|
</div>
|
|
</div>
|
|
<div id="mw-navigation">
|
|
<h2>Navigation menu</h2>
|
|
|
|
</body></html> |