98 lines
4.7 KiB
HTML
98 lines
4.7 KiB
HTML
<html><head><title>Macro Creating faces from a DXF file/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 Creating faces from a DXF file/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="Facce_da_DXF"><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> Facce da DXF</span></h3>
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Descrizione
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven left">Questa macro crea delle facce dai file DXF.
|
|
</td></tr>
|
|
<tr>
|
|
<th class="ctOdd">Autore
|
|
</th></tr>
|
|
<tr>
|
|
<td class="ctEven"><a href="https://www.freecadweb.org/wiki/index.php?title=User:Shoogen&action=edit&redlink=1" class="new" title="User:Shoogen (page does not exist)">shoogen</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">2014-10-29
|
|
</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="#Facce_da_DXF"><span class="tocnumber">1</span> <span class="toctext">Facce da DXF</span></a></li>
|
|
<li class="toclevel-1 tocsection-1"><a href="#Descrizione"><span class="tocnumber">2</span> <span class="toctext">Descrizione</span></a></li>
|
|
<li class="toclevel-1 tocsection-2"><a href="#Uso"><span class="tocnumber">3</span> <span class="toctext">Uso</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>
|
|
<h2><span class="mw-headline" id="Descrizione">Descrizione</span></h2>
|
|
<p>Questa macro crea facce da un file DXF, i "Layer" sono riconosciuti separatamente e inseriti in gruppi.
|
|
</p><p>Nel file ci devono essere i gruppi.
|
|
</p>
|
|
<h2><span class="mw-headline" id="Uso">Uso</span></h2>
|
|
<p>Avviare la macro e tutti gli oggetti vengono analizzati e trasformati in facce.
|
|
</p><p>Nota: un oggetto non chiuso restituisce un errore
|
|
</p>
|
|
<h2><span class="mw-headline" id="Script">Script</span></h2>
|
|
<p>Macro Creating faces from a DXF file.FCMacro
|
|
</p>
|
|
<pre>import FreeCAD,Part,OpenSCAD2Dgeom
|
|
doc = App.ActiveDocument
|
|
for group in doc.findObjects('App::DocumentObjectGroup'):
|
|
try:
|
|
edges=sum((obj.Shape.Edges for obj in group.Group \
|
|
if hasattr(obj,'Shape')),[])
|
|
face = OpenSCAD2Dgeom.edgestofaces(edges)
|
|
faceobj = doc.addObject('Part::Feature','face_%s' % group.Name)
|
|
faceobj.Label = 'face_%s' % group.Label
|
|
faceobj.Shape = face
|
|
except Part.OCCError: # Exception: #
|
|
FreeCAD.Console.PrintError('Error in Group %s (%s)' % (group.Name,group.Label)+"\n") </pre>
|
|
<h2><span class="mw-headline" id="Link">Link</span></h2>
|
|
<p>Nel forum <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=3&t=8144">Creating faces from a DXF file</a>
|
|
</p><p>Questo è un esempio: <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/viewtopic.php?f=3&t=8280&p=67863#p67840">Generate 3D solid from intersection of three imported 2D</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_Creating_faces_from_a_DXF_file/it&oldid=253185">http://www.freecadweb.org/wiki/index.php?title=Macro_Creating_faces_from_a_DXF_file/it&oldid=253185</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> |