FreeCAD-Doc/localwiki/Macro_Assemblage_Imprimante_3D-fr.html
2018-07-19 18:47:02 -05:00

156 lines
8.2 KiB
HTML

<html><head><title>Macro Assemblage Imprimante 3D/fr</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/fr</h1></div>
<div id="mw-content-text" lang="fr" 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">Description
</th></tr>
<tr>
<td class="ctEven left">Simulates the motion of a 3D printer in the Z axis..
</td></tr>
<tr>
<th class="ctOdd">Auteur
</th></tr>
<tr>
<td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Fran6t&amp;action=edit&amp;redlink=1" class="new" title="User:Fran6t (page does not exist)">fran6t</a>
</td></tr>
<tr>
<th class="ctOdd">Liens
</th></tr>
<tr>
<td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=Macros_recipes/fr" title="Macros recipes/fr">Recettes macros</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=How_to_install_macros/fr" title="How to install macros/fr">Comment installer une macro</a><br /><a href="https://www.freecadweb.org/wiki/index.php?title=Customize_Toolbars/fr" title="Customize Toolbars/fr">Comment ajouter une barre d'outils</a>
</td></tr>
<tr>
<th class="ctOdd">Version
</th></tr>
<tr>
<td class="ctEven macro-version">1.0
</td></tr>
<tr>
<th class="ctOdd">Date dernière modification
</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="#Utilisation"><span class="tocnumber">2</span> <span class="toctext">Utilisation</span></a></li>
<li class="toclevel-1 tocsection-2"><a href="#Le_fichier"><span class="tocnumber">3</span> <span class="toctext">Le fichier</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="#Liens"><span class="tocnumber">5</span> <span class="toctext">Liens</span></a></li>
</ul>
</div>
</td></tr>
</table>
<p><br />
</p><p>Simulation de mouvement d'une imprimante 3D dans l'axe 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="Utilisation">Utilisation</span></h2>
<p>Téléchargez le fichier et ouvrez le dans FreeCAD
</p><p>Copiez la macro dans le console Python de FreeCAD
</p><p>Pour arrêter l'animation faites&#160;:
</p>
<pre>animation.stop() </pre>
<h2><span class="mw-headline" id="Le_fichier">Le fichier</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'auteur du script est <b><a rel="nofollow" class="external text" href="http://forum.freecadweb.org/memberlist.php?mode=viewprofile&amp;u=2538">Javier Martínez García (JMG)</a></b> et est adapté pour ce projet.
</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 )&#160;:
self.sens = 1
if ( self.an == 245 )&#160;:
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="Liens">Liens</span></h2>
<p>La discussion sur le forum&#160;: <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=12&amp;t=11782">Je galere pour tourner une piece</a>
</p><p>Le canal sur Youtube de l'auteur de la macro <a rel="nofollow" class="external text" href="https://www.youtube.com/watch?v=KynMmsLJXV0">FreeCAD: Gear Animation Tutorial</a> and its <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/fr&amp;oldid=240003">http://www.freecadweb.org/wiki/index.php?title=Macro_Assemblage_Imprimante_3D/fr&amp;oldid=240003</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>