Macro Facce da DXF

From FreeCAD Documentation
This page is a translated version of the page Macro Creating faces from a DXF file and the translation is 100% complete.
Other languages:

Facce da DXF

Descrizione
Questa macro crea delle facce dai file DXF.

Versione macro: 1.0
Ultima modifica: 2014-10-29
Versione FreeCAD: Tutte versione
Download: Icona per la ToolBar
Autore: shoogen
Autore
shoogen
Download
Icona per la ToolBar
Link
Versione macro
1.0
Data ultima modifica
2014-10-29
Versioni di FreeCAD
Tutte versione
Scorciatoia
Nessuna
Vedere anche
Nessuno

Descrizione

Questa macro crea facce da un file DXF, i "Layer" sono riconosciuti separatamente e inseriti in gruppi.

Nel file ci devono essere i gruppi.

Uso

Avviare la macro e tutti gli oggetti vengono analizzati e trasformati in facce.

Nota: un oggetto non chiuso restituisce un errore

Script

ToolBar Icon

Macro_Creating_faces_from_a_DXF_file.FCMacro

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")

Link

Nel forum Creating faces from a DXF file

Questo è un esempio: Generate 3D solid from intersection of three imported 2D