Surface Filling: Difference between revisions
(Docnav) |
|||
(45 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
{{Docnav |
{{Docnav |
||
| |
| |
||
|[[Surface_GeomFillSurface| |
|[[Surface_GeomFillSurface|GeomFillSurface]] |
||
|[[Surface_Workbench|Surface]] |
|[[Surface_Workbench|Surface]] |
||
|IconL= |
|IconL= |
||
|IconR= |
|IconR=Surface_GeomFillSurface.svg |
||
|IconC=Workbench_Surface.svg |
|IconC=Workbench_Surface.svg |
||
}} |
}} |
||
Line 23: | Line 23: | ||
<!--T:13--> |
<!--T:13--> |
||
{{Button|[[File:Surface_Filling.svg|16px]] [[Surface_Filling|Surface Filling]]}} creates a surface from a series of connected boundary edges. |
{{Button|[[File:Surface_Filling.svg|16px]] [[Surface_Filling|Surface Filling]]}} creates a surface from a series of connected boundary edges. The curvature of the surface can be additionally controlled by non-boundary edges and vertices, and a support surface. |
||
<!--T: |
<!--T:15--> |
||
⚫ | |||
The surface can be modified by adding constraint edges and vertices which the surface must pass through. |
|||
</translate> |
</translate> |
||
[[Image:Surface_Filling_example.png|600px]] |
[[Image:Surface_Filling_example.png|600px]] |
||
<translate> |
<translate> |
||
<!--T:12--> |
<!--T:12--> |
||
{{Caption| |
{{Caption|Two filled surfaces delimited by four edges located on the XY plane. The surface on the right is additionally controlled by a non-boundary edge.}} |
||
==Usage== <!--T:3--> |
==Usage== <!--T:3--> |
||
<!--T:4--> |
<!--T:4--> |
||
⚫ | |||
# Make sure you have at least three edges or curves in space forming a closed contour. For example, these can be created with tools of the [[File:Workbench_Draft.svg|20px]] [[Draft_Workbench|Draft]] or the [[File:Workbench_Sketcher.svg|20px]] [[Sketcher_Workbench|Sketcher]] workbenches. Using three edges would create a triangular surface; four edges a quadrilateral surface. |
|||
# The {{MenuCommand|Boundaries}} task panel opens. See [[#Options|Options]]. |
|||
#* 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. |
|||
# Select two or more edges in the [[3D_view|3D view]]: |
|||
#* Likewise, a number of vertices can be used with the same purpose to indicate where the surface must go through. |
|||
#* There is no need to press the {{Button|Add edge}} button in the {{MenuCommand|Boundaries}} section at this time. |
|||
⚫ | |||
#* The edges must be selected in consecutive order. |
|||
# Inside the {{MenuCommand|Boundary}} section, press {{Button|Add edge}}. |
|||
#* The edges must be connected, but the complete boundary need not be closed. |
|||
# Use the pointer to pick the desired edges in the [[3D_view|3D view]]; a preview of the final shape will be shown after selecting valid edges that form a closed contour. |
|||
#* The complete boundary should not self-intersect. |
|||
#* Optionally, go to the {{MenuCommand|Curvature: non-boundary edges}} section, press {{Button|Add edge}}, and pick the desired edges from the [[3D_view|3D view]]. |
|||
#* For a 360° circular boundary two semicircular edges can be selected. |
|||
#* Optionally, go to the {{MenuCommand|Curvature: non-boundary vertices}} section, press {{Button|Add vertex}}, and pick the desired vertices from the [[3D_view|3D view]]. |
|||
# A preview of the final shape will be shown once enough valid geometry has been selected. |
|||
⚫ | |||
# Optionally select a {{MenuCommand|Support surface}}. See [[#Example|Example]]. |
|||
# Optionally select one or more {{MenuCommand|Edge constraints}}. |
|||
⚫ | |||
# Optionally select one or more {{MenuCommand|Vertex constraints}}. |
|||
⚫ | The base |
||
⚫ | |||
==Options== <!--T:5--> |
==Options== <!--T:5--> |
||
<!--T:16--> |
<!--T:16--> |
||
* {{MenuCommand| |
* In the {{MenuCommand|Boundaries}} section a support surface and boundary edges can specified: |
||
** Press the {{Button|Support surface}} button and select a face in the [[3D_view|3D view]] to add a support surface. |
|||
** {{Button|Add edge}}: press once to start picking {{MenuCommand|Boundary edges}} in the [[3D_view|3D view]]. Straight edges such as {{Button|[[File:Draft_Wire.svg|16px]] [[Draft_Wire|Draft Wires]]}} and {{Button|[[File:Sketcher_CreatePolyline.svg|16px]] [[Sketcher_CreatePolyline|Sketcher Polylines]]}}, or curved edges such as {{Button|[[File:Draft_BSpline.svg|16px]] [[Draft_BSpline|Draft BSplines]]}} and {{Button|[[File:Sketcher_CreateBSpline.svg|16px]] [[Sketcher_CreateBSpline|Sketcher BSplines]]}} can be chosen, as well as any edge from solid objects, like those of {{Button|[[File:PartDesign_Body.svg|16px]] [[PartDesign_Body|PartDesign Bodies]]}} and {{Button|[[File:Part_Primitives.svg|16px]] [[Part_Primitives|Part Primitives]]}}. |
|||
*** Click the [[File:Edit-cleartext.svg|16px]] icon to remove the support surface. |
|||
⚫ | |||
** Press the {{Button|Add edge}} button once to start selecting boundary edges in the [[3D_view|3D view]]. |
|||
** {{KEY|Right mouse button}}: open the context menu and select {{Button|Remove}}, or press {{KEY|Del}} in the keyboard, to remove the currently selected edge in the list. |
|||
** There are several ways to deselect boundary edges: |
|||
⚫ | |||
*** Select an edge in the list and press {{KEY|Delete}}. |
|||
*** Right-click an edge in the list and select {{MenuCommand|Remove}} from the context menu. |
|||
<!--T:17--> |
<!--T:17--> |
||
* In the {{MenuCommand|Edge constraints}} section non-boundary edges can be specified: |
|||
* {{MenuCommand|Curvature: non-boundary edges}} section; the {{Button|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 {{MenuCommand|Boundary edges}}. |
|||
** The selection options are similar to those for boundary edges. |
|||
* {{MenuCommand|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 {{Button|[[File:Draft_Point.svg|16px]] [[Draft_Point|Draft Points]]}} or {{Button|[[File:Part_Point.svg|16px]] [[Part_Point|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. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
* In the {{MenuCommand|Vertex constraints}} section non-boundary vertices can be specified: |
|||
** The selection options are similar to those for boundary edges. |
|||
⚫ | |||
The {{MenuCommand|Support surface}} option can be used to set an initial surface. If not set it will be computed automatically. The filled surface is computed by deformation of the support surface in order to satisfy the given constraints. {{MenuCommand|Support surface}} can also be an additional constraint for the final surface. To get an idea of what it's doing you can try this simple example: |
|||
⚫ | |||
⚫ | |||
<!--T:33--> |
|||
The {{MenuCommand|Support surface}} acts as an additional constraint for the surface. The following simple example will give you an idea how this works: |
|||
<!--T:34--> |
|||
# In the [[File:Workbench_Part.svg|16px]] [[Part_Workbench|Part Workbench]] create a [[File:Part_Cylinder.svg|16px]][[Part_Cylinder|cylinder]] and set its {{PropertyData|Angle}} to {{Value|180°}}. |
# In the [[File:Workbench_Part.svg|16px]] [[Part_Workbench|Part Workbench]] create a [[File:Part_Cylinder.svg|16px]][[Part_Cylinder|cylinder]] and set its {{PropertyData|Angle}} to {{Value|180°}}. |
||
# Switch to the [[File:Workbench_Surface.svg|16px]] [[Surface_Workbench|Surface Workbench]] and press the {{Button|[[File:Surface_Filling.svg|16px]] [[Surface_Filling| |
# Switch to the [[File:Workbench_Surface.svg|16px]] [[Surface_Workbench|Surface Workbench]] and press the {{Button|[[File:Surface_Filling.svg|16px]] [[Surface_Filling|Filling]]}} button. |
||
# Select the two semi-circular edges and the two straight edges that connect them. |
# Select the two semi-circular edges and the two straight edges that connect them. |
||
# The result matches the four boundary edges, but the inner shape is quite different from the cylindrical face. |
# The result matches the four boundary edges, but the inner shape is quite different from the cylindrical face. |
||
# Edit the Surface object and for the {{MenuCommand|Support surface}} select the cylindrical |
# Edit the Surface object and for the {{MenuCommand|Support surface}} select the cylindrical face. |
||
# The modified shape matches the cylindrical |
# The modified shape matches the cylindrical face much more closely. |
||
== Limitations == <!--T:28--> |
|||
⚫ | |||
The surface code from the internal [[OpenCASCADE|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 {{PropertyData|Boundary Edges}} to that would result in several closed faces. In this case, those edges should be added as {{PropertyData|Unbound Edges}} to control the curvature only. |
|||
* Using parametric {{PropertyData|Boundary Edges}} (for example, {{Button|[[File:Draft_BSpline.svg|16px]] [[Draft_BSpline|Draft BSplines]]}}) that when recomputed fail to produce a closed boundary. That is, the edges to be used as {{PropertyData|Boundary Edges}} must always form a closed shape, even if their internal properties change. |
|||
==Properties== <!--T:6--> |
==Properties== <!--T:6--> |
||
Line 197: | Line 202: | ||
{{Docnav |
{{Docnav |
||
| |
| |
||
|[[Surface_GeomFillSurface| |
|[[Surface_GeomFillSurface|GeomFillSurface]] |
||
|[[Surface_Workbench|Surface]] |
|[[Surface_Workbench|Surface]] |
||
|IconL= |
|IconL= |
||
|IconR= |
|IconR=Surface_GeomFillSurface.svg |
||
|IconC=Workbench_Surface.svg |
|IconC=Workbench_Surface.svg |
||
}} |
}} |
Latest revision as of 15:12, 2 June 2023
Surface Filling |
Menu location |
---|
Surface → Filling |
Workbenches |
Surface |
Default shortcut |
None |
Introduced in version |
0.17 |
See also |
None |
Description
Surface Filling creates a surface from a series of connected boundary edges. The curvature of the surface can be additionally controlled by non-boundary edges and vertices, and a support surface.
The base geometry can belong to curves created with the Draft Workbench or the Sketcher Workbench, but can also belong to solid objects such as those created with the Part Workbench or the PartDesign Workbench.
Two filled surfaces delimited by four edges located on the XY plane. The surface on the right is additionally controlled by a non-boundary edge.
Usage
- Press the Filling button.
- The Boundaries task panel opens. See Options.
- Select two or more edges in the 3D view:
- There is no need to press the Add edge button in the Boundaries section at this time.
- The edges must be selected in consecutive order.
- The edges must be connected, but the complete boundary need not be closed.
- The complete boundary should not self-intersect.
- For a 360° circular boundary two semicircular edges can be selected.
- A preview of the final shape will be shown once enough valid geometry has been selected.
- Optionally select a Support surface. See Example.
- Optionally select one or more Edge constraints.
- Optionally select one or more Vertex constraints.
- Press OK button.
Options
- In the Boundaries section a support surface and boundary edges can specified:
- Press the Support surface button and select a face in the 3D view to add a support surface.
- Press the Add edge button once to start selecting boundary edges in the 3D view.
- There are several ways to deselect boundary edges:
- Press the Remove edge button once to start deselecting edges in the 3D view.
- Select an edge in the list and press Delete.
- Right-click an edge in the list and select Remove from the context menu.
- In the Edge constraints section non-boundary edges can be specified:
- The selection options are similar to those for boundary edges.
- In the Vertex constraints section non-boundary vertices can be specified:
- The selection options are similar to those for boundary edges.
- Press Esc or the Cancel button to abort the operation.
Example
The Support surface acts as an additional constraint for the surface. The following simple example will give you an idea how this works:
- In the Part Workbench create a cylinder and set its DataAngle to
180°
. - Switch to the Surface Workbench and press the Filling button.
- Select the two semi-circular edges and the two straight edges that connect them.
- The result matches the four boundary edges, but the inner shape is quite different from the cylindrical face.
- Edit the Surface object and for the Support surface select the cylindrical face.
- The modified shape matches the cylindrical face much more closely.
Properties
A Surface Filling (Surface::Filling
class) is derived from the basic Part Feature (Part::Feature
class, through the Part::Spline
subclass), therefore it shares all the latter's properties.
In addition to the properties described in Part Feature, the Surface Filling has the following properties in the property editor.
Data
Filling
- DataBoundary Edges (
LinkSubList
): boundary edges; C0 is required for edges without a corresponding face. - DataBoundary Faces (
StringList
): - DataBoundary Order (
IntegerList
): order of constraint on boundary faces;0
,1
, and2
are possible. - DataUnbound Edges (
LinkSubList
): unbound constraint edges; C0 is required for edges without a corresponding face. - DataUnbound Faces (
StringList
): - DataUnbound Order (
IntegerList
): order of constraint on unbound faces;0
,1
, and2
are possible. - DataFree Faces (
LinkSubList
): free constraint on a face. - DataFree Order (
IntegerList
): order of constraint on free faces. - DataPoints (
LinkSubList
): constraint points on surface. - DataInitial Face (
LinkSub
): initial surface to use. - DataDegree (
Integer
): starting degree, it defaults to3
. - DataPoints On Curve (
Integer
): number of points on an edge for constraint. - DataIterations (
Integer
): number of iterations, it defaults to2
. - DataAnisotropy (
Bool
): it defaults tofalse
. - DataTolerance2d (
Float
): 2D tolerance, it defaults to0.0
. - DataTolerance3d (
Float
): 3D tolerance, it defaults to0.0
. - DataTol Angular (
Float
): G1 tolerance, it defaults to0.01
. - DataTol Curvature (
Float
): G2 tolerance, it defaults to0.10
. - DataMaximum Degree (
Integer
): maximum curve degree, it defaults to8
. - DataMaximum Segments (
Integer
): maximum number of segments, it defaults to9
.
View
Base
- ViewControl Points (
Bool
): it defaults tofalse
; if set totrue
, it will show an overlay with the control points of the surface.
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
andPoints
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()
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub