Surface Filling - Riempimento di superficie

From FreeCAD Documentation
Revision as of 17:25, 3 October 2020 by Renatorivo (talk | contribs) (Created page with "===Dati===")
Other languages:

This documentation is not finished. Please help and contribute documentation.

GuiCommand model explains how commands should be documented. Browse Category:UnfinishedDocu to see more incomplete pages like this one. See Category:Command Reference for all commands.

See WikiPages to learn about editing the wiki pages, and go to Help FreeCAD to learn about other ways in which you can contribute.

Surface Filling

Posizione nel menu
Surface → Riempimento...
Ambiente
Surface|Version=0.17
Avvio veloce
Nessuno
Introdotto nella versione
-
Vedere anche
Nessuno

Descrizione

Surface Filling crea una superficie da una serie di bordi collegati.

La superficie può essere modificata aggiungendo bordi di vincolo e vertici attraverso i quali deve passare la superficie.

Esempio di una superficie riempita, delimitata da quattro spigoli situati nel piano XY; (a sinistra) solo i quattro bordi e (a destra) una curva aggiunta nello spazio che definisce la curvatura della superficie

Utilizzo

  1. Assicurati di avere almeno tre bordi o curve nello spazio che formano un contorno chiuso. Ad esempio, questi possono essere creati con gli strumenti di Draft o di Sketcher. L'uso di tre bordi crea una superficie triangolare; quattro bordi una superficie quadrilatera.
    • Se opportuno, all'interno del contorno chiuso possono essere disegnate delle curve. Non è necessario che tocchino i bordi. Queste curve possono essere utilizzate per controllare la curvatura della superficie risultante.
    • Allo stesso modo, è possibile utilizzare un numero di vertici con lo stesso scopo per indicare dove deve passare la superficie.
  2. Premere il pulsante Surface filling.
  3. Nella sezione Boundary, premere Add edge.
  4. Usare il puntatore per selezionare i bordi desiderati nella vista 3D; viene visualizzata un'anteprima della forma finale dopo aver selezionato i bordi validi che formano un contorno chiuso.
    • Facoltativamente, andare alla sezione Curvature: non-boundary edges, premere Add edge, e selezionare i bordi desiderati nella vista 3D.
    • Facoltativamente, andare alla sezione Curvature: non-boundary vertices, press Add vertex, e scegliere i vertici desiderati nella vista 3D.
  5. Premere OK per completare l'operazione.

Gli spigoli di base che formano il contorno chiuso, così come i vertici e gli spigoli ausiliari, possono appartenere a curve 2D di Draft o di Sketcher, ma possono anche appartenere a oggetti solidi 3D come quelli creati con Part o PartDesign Workbenches.

Opzioni

  • Boundary section:
    • Add edge: press once to start picking Boundary edges in the 3D view. Straight edges such as Draft Wires and Sketcher Polylines, or curved edges such as Draft BSplines and Sketcher BSplines can be chosen, as well as any edge from solid objects, like those of PartDesign Bodies and Part Primitives.
    • Remove edge: press once to start picking edges in the 3D view; these edges must have been previously picked with Add edge.
    • Right mouse button: open the context menu and select Remove, or press Del in the keyboard, to remove the currently selected edge in the list.
  • Curvature: non-boundary edges section; the Add edge button is available to pick auxiliary edges (straight lines or B-Splines) to control the curvature of the surface. The surface will be forced to pass through these auxiliary edges. This works best when the auxiliary edges lie inside the region delimited by the Boundary edges.
  • Curvature: non-boundary vertices section; similar to the non-boundary edges, the user can pick auxiliary vertices to control the curvature. These vertices may be free standing Draft Points or Part Points, or may belong to any edge (straight lines or B-Splines), or be a corner vertex in a solid object. In this case, the surface will be constrained to pass through these auxiliary points.
  • Press Cancel or Esc to abort the current operation.

Proprietà

Una Surface Filling (classe Surface::Filling) è derivato dalla base Part Feature (classe Part::Feature, attraverso la sottoclasse Part::Spline), quindi condivide tutte le proprietà di quest'ultima.

Oltre alle proprietà descritte in Part Feature, Surface Filling ha le seguenti proprietà nell'editor delle proprietà.

Dati

Filling

  • DatiProperty: description of the property
  • VistaProperty: description of the property

View

Base

  • VistaControl Points (Bool): it defaults to false; if set to true, it will show an overlay with the control points of the surface.

Limitations

The surface code from the internal OpenCASCADE modelling kernel is fragile, and cannot handle wrong input properly. The following situations may cause problems, and may crash the program, so they should be avoided:

  • Adding DatiBoundary Edges to that would result in several closed faces. In this case, those edges should be added as DatiUnbound Edges to control the curvature only.
  • Using parametric DatiBoundary Edges (for example, Draft_BSplines) that when recomputed fail to produce a closed boundary. That is, the edges to be used as DatiBoundary Edges must always form a closed shape, even if their internal properties change.

Scripting

See also: FreeCAD Scripting Basics.

The Surface Filling tool can be used in macros and from the Python console by adding the Surface::Filling object.

  • The edges to be used to define the surface must be assigned as a LinkSubList to the BoundaryEdges property of the object.
  • Auxiliary edges and vertices must be assigned as a LinkSubLists to the UnboundEdges and Points properties of the object.
  • All objects with edges need to be computed before they can be used as input for the properties of the Filling object.
import FreeCAD as App
import Draft

doc = App.newDocument()

a = App.Vector(-20, -20, 0)
b = App.Vector(-18, 25, 0)
c = App.Vector(60, 26, 0)
d = App.Vector(33, -20, 0)

points1 = [a, App.Vector(-20, -8, 0), App.Vector(-17, 7, 0), b]
obj1 = Draft.make_bspline(points1)

points2 = [b, App.Vector(0, 25, 0), c]
obj2 = Draft.make_bspline(points2)

points3 = [c, App.Vector(37, 4, 0), d]
obj3 = Draft.make_bspline(points3)

points4 = [d, App.Vector(-2, -18, 0), a]
obj4 = Draft.make_bspline(points4)
doc.recompute()

surf = doc.addObject("Surface::Filling", "Surface")
surf.BoundaryEdges = [(obj1, "Edge1"),
                      (obj2, "Edge1"),
                      (obj3, "Edge1"),
                      (obj4, "Edge1")]
doc.recompute()

# ---------------------------------------------------------
points_spl = [App.Vector(-10, 0, 2),
              App.Vector(4, 0, 7),
              App.Vector(18, 0, -5),
              App.Vector(25, 0, 0),
              App.Vector(30, 0, 0)]
aux_edge = Draft.make_bspline(points_spl)
doc.recompute()

surf.UnboundEdges = [(aux_edge, "Edge1")]
doc.recompute()

# ---------------------------------------------------------
aux_v1 = Draft.make_line(App.Vector(-13, -12, 5),
                         App.Vector(-13, -12, -5))
aux_v2 = Draft.make_line(App.Vector(-3, 18, 5),
                         App.Vector(-3, 18, -5))
doc.recompute()

surf.Points = [(aux_v1, "Vertex2"),
               (aux_v2, "Vertex1")]
doc.recompute()