Powierzchnia 3D: Wypełnianie
|Surface → Filling|
|Introduced in version|
creates a surface from a series of connected boundary edges.
The surface can be modified by adding constraint edges and vertices which the surface must pass through.
Example of a filled surface, delimited by four edges located in the XY plane; (left) only the four edges, and (right) one additional curve in space that defines the curvature of the surface
- Make sure you have at lease three edges or curves in space forming a closed contour. For example, these can be created with tools of the Draft Workbench or the Sketcher. Using three edges would create a triangular surface; four edges a quadrilateral surface.
- Optionally, curves can be drawn inside the closed contour, not necessarily touching the edges. These curves can be used to control the curvature of the resulting surface.
- Likewise, a number of vertices can be used with the same purpose to indicate where the surface must go through.
- Press the button.
- Inside the Boundary section, press .
- Use the pointer to pick the desired edges in the 3D view; a preview of the final shape will be shown after selecting valid edges that form a closed contour.
- Press to complete the operation.
The base edges that form the closed contour, as well as the auxiliary vertices and edges, can belong to 2D curves from Draft or the Sketcher, but can also belong to 3D solid objects such as those created with the Part or PartDesign Workbenches.
- Boundary section:
- 3D view. Straight edges such as and , or curved edges such as and can be chosen, as well as any edge from solid objects, like those of and . : press once to start picking Boundary edges in the
- 3D view; these edges must have been previously picked with . : press once to start picking edges in the
- : open the context menu and select , or press in the keyboard, to remove the currently selected edge in the list.
- Curvature: non-boundary edges section; the 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 or , 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 or to abort the current operation.
- DANEBoundary Edges (
LinkSubList): boundary edges; C0 is required for edges without a corresponding face.
- DANEBoundary Faces (
- DANEBoundary Order (
IntegerList): order of constraint on boundary faces;
- DANEUnbound Edges (
LinkSubList): unbound constraint edges; C0 is required for edges without a corresponding face.
- DANEUnbound Faces (
- DANEUnbound Order (
IntegerList): order of constraint on unbound faces;
- DANEFree Faces (
LinkSubList): free constraint on a face.
- DANEFree Order (
IntegerList): order of constraint on free faces.
- DANEPoints (
LinkSubList): constraint points on surface.
- DANEInitial Face (
LinkSub): initial surface to use.
- DANEDegree (
Integer): starting degree, it defaults to
- DANEPoints On Curve (
Integer): number of points on an edge for constraint.
- DANEIterations (
Integer): number of iterations, it defaults to
- DANEAnisotropy (
Bool): it defaults to
- DANETolerance2d (
Float): 2D tolerance, it defaults to
- DANETolerance3d (
Float): 3D tolerance, it defaults to
- DANETol Angular (
Float): G1 tolerance, it defaults to
- DANETol Curvature (
Float): G2 tolerance, it defaults to
- DANEMaximum Degree (
Integer): maximum curve degree, it defaults to
- DANEMaximum Segments (
Integer): maximum number of segments, it defaults to
- WIDOKControl Points (
Bool): it defaults to
false; if set to
true, it will show an overlay with the control points of the surface.
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 DANEBoundary Edges to that would result in several closed faces. In this case, those edges should be added as DANEUnbound Edges to control the curvature only.
- Using parametric DANEBoundary Edges (for example, ) that when recomputed fail to produce a closed boundary. That is, the edges to be used as DANEBoundary Edges must always form a closed shape, even if their internal properties change.
See also: FreeCAD Scripting Basics.
- The edges to be used to define the surface must be assigned as a LinkSubList to the
BoundaryEdgesproperty of the object.
- Auxiliary edges and vertices must be assigned as a LinkSubLists to the
Pointsproperties 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()