Surface BlendCurve: Difference between revisions

From FreeCAD Documentation
(Created page with "<languages/> <translate> {{Docnav |Fill boundary curves | |Surface |IconL=Surface_CurveOnMesh.svg |IconR= |IconC=Workbench_Surface.svg }} {{GuiCommand |Name=Surface Blend Curve |MenuLocation=Surface → Blend Curve |Workbenches=Surface |Version=0.21 }} ==Description== {{Button|16px Surface Blend Curve}} creates a Bezier curve between two edges, with desi...")
 
(added reference to Curves_Workbench, complete the way to launch the command)
 
(12 intermediate revisions by 3 users not shown)
Line 2: Line 2:
<translate>
<translate>


<!--T:27-->
{{Docnav
{{Docnav
|[[Surface_CurveOnMesh|Fill boundary curves]]
|[[Surface_CurveOnMesh|CurveOnMesh]]
|
|
|[[Surface_Workbench|Surface]]
|[[Surface_Workbench|Surface]]
Line 11: Line 12:
}}
}}


<!--T:28-->
{{GuiCommand
{{GuiCommand
|Name=Surface Blend Curve
|Name=Surface BlendCurve
|MenuLocation=Surface → Blend Curve
|MenuLocation=Surface → Blend Curve
|Workbenches=[[Surface_Workbench|Surface]]
|Workbenches=[[Surface_Workbench|Surface]]
Line 18: Line 20:
}}
}}


==Description==
==Description== <!--T:29-->


<!--T:30-->
{{Button|[[File:BlendCurve.svg|16px]] [[Surface_BlendCurve|Surface Blend Curve]]}} creates a Bezier curve between two edges, with desired continuity.
{{Button|[[File:Surface_BlendCurve.svg|16px]] [[Surface_BlendCurve|Surface Blend Curve]]}} creates a Bezier curve between two edges, with desired continuity.


<!--T:31-->
The base geometry can belong to curves created with the [[Draft_Workbench|Draft Workbench]] or the [[Sketcher_Workbench|Sketcher Workbench]], but can also belong to solid objects such as those created with the [[Part_Workbench|Part Workbench]].
The base geometry can belong to curves created with the [[Draft_Workbench|Draft Workbench]] or the [[Sketcher_Workbench|Sketcher Workbench]], but can also belong to solid objects such as those created with the [[Part_Workbench|Part Workbench]].


</translate>
</translate>
[[File:Surface BlendCurve G3 example.png|400px]]
[[File:Surface_BlendCurve_G3_example.png|400px]]
[[File:Surface_BlendCurve_Comb.png|400px]]
[[File:Surface BlendCurve Comb.png|400px|Surface Blend Curve joining 2 edges with G3 conitnuity and curvature comb]]
<translate>
<translate>
<!--T:32-->
{{Caption|Surface Blend Curve joining 2 edges with G3 continuity. Curvature comb is smooth at contact points.}}
{{Caption|Surface Blend Curve joining 2 edges with G3 continuity. Orange polygon represent the control points. Curvature comb (from [[Curves_Workbench|Curves addon]]) is smooth at contact points.}}


==Usage==
==Usage== <!--T:33-->


<!--T:34-->
# Select two edges in the [[3D_view|3D view]]
# Select two edges in the [[3D_view|3D view]]
# There are several ways to invoke the command:
# Press the {{Button|[[File:BlendCurve.svg|16px]] [[Surface_BlendCurve|Surface Blend Curve]]}} button.
#* Press the {{Button|[[Image:Surface_BlendCurve.svg|16px]] [[Surface_BlendCurve|Surface Blend Curve]]}} button.
#* Select the {{MenuCommand|Surface → [[Image:Surface_BlendCurve.svg|16px]] Blend Curve}} option from the menu.
# Adjust the curve shape in the object Data properties
# Adjust the curve shape in the object Data properties


Line 39: Line 47:


<!--T:18-->
<!--T:18-->
A [[Surface_BlendCurve|Surface Blend Curve]] is derived from the basic [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class, through the {{incode|Part::Spline}} subclass), therefore it shares all the latter's properties.
A [[Surface_BlendCurve|Surface Blend Curve]] is derived from the basic [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class, through the {{incode|Part::Spline}} subclass), therefore it shares all the latter's properties.


<!--T:19-->
<!--T:19-->
Line 46: Line 54:
=== Data === <!--T:20-->
=== Data === <!--T:20-->


<!--T:35-->
{{TitleProperty|Blend Curve}}
{{TitleProperty|Blend Curve}}


<!--T:36-->
* {{PropertyData|Start Edge|LinkSubList}}: First input edge.
* {{PropertyData|Start Edge|LinkSub}}: First input edge.
* {{PropertyData|Start Continuity|Integer}}: Geometric continuity value
* {{PropertyData|Start Continuity|Integer}}: Geometric continuity value
* {{PropertyData|Start Parameter|Float}}: Normalized parameter along edge; from {{Value|0.0}}(edge start) to {{Value|1.0}}(edge end).
* {{PropertyData|Start Parameter|Float}}: Normalized parameter along edge; from {{Value|0.0}}(edge start) to {{Value|1.0}}(edge end).
* {{PropertyData|Start Size|Float}}: Size of the tangent.
* {{PropertyData|Start Size|Float}}: Size of the tangent.
* {{PropertyData|End Edge|LinkSubList}}: Second input edge.
* {{PropertyData|End Edge|LinkSub}}: Second input edge.
* {{PropertyData|End Continuity|Integer}}: Geometric continuity value
* {{PropertyData|End Continuity|Integer}}: Geometric continuity value
* {{PropertyData|End Parameter|Float}}: Normalized parameter along edge; from {{Value|0.0}}(edge start) to {{Value|1.0}}(edge end).
* {{PropertyData|End Parameter|Float}}: Normalized parameter along edge; from {{Value|0.0}}(edge start) to {{Value|1.0}}(edge end).
* {{PropertyData|End Size|Float}}: Size of the tangent.
* {{PropertyData|End Size|Float}}: Size of the tangent.


=== View ===
=== View === <!--T:37-->


<!--T:38-->
{{TitleProperty|Base}}
{{TitleProperty|Base}}


<!--T:39-->
* {{PropertyView|Control Points|Bool}}: it defaults to {{FALSE}}; if set to {{TRUE}}, it will show an overlay with the control points of the curve.
* {{PropertyView|Control Points|Bool}}: it defaults to {{FALSE}}; if set to {{TRUE}}, it will show an overlay with the control points of the curve.


== Scripting ==
== Scripting == <!--T:40-->


<!--T:26-->
<!--T:26-->
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:27-->
<!--T:41-->
The Surface Filling tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by adding the {{incode|Surface::Filling}} object.
The Blend Curve tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by adding the {{incode|Surface::FeatureBlendCurve}} object.
* The edges to be used to define the surface must be assigned as a [[LinkSubList|LinkSubList]] to the {{incode|BoundaryEdges}} property of the object.
* The edges to be used to define the curve must be assigned as [[LinkSub|LinkSub]] to the {{incode|StartEdge}} and {{incode|EndEdge}} properties of the object.
* Auxiliary edges and vertices must be assigned as a [[LinkSubList|LinkSubLists]] to the {{incode|UnboundEdges}} and {{incode|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 Blend Curve object.
* All objects with edges need to be computed before they can be used as input for the properties of the Filling object.


</translate>
</translate>
Line 81: Line 92:
doc = App.newDocument()
doc = App.newDocument()


a = App.Vector(-20, -20, 0)
points1 = [App.Vector(-20, -20, 0), App.Vector(-20, -8, 0), App.Vector(-17, 7, 0), App.Vector(-18, 25, 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)
obj1 = Draft.make_bspline(points1)


points2 = [b, App.Vector(0, 25, 0), c]
points2 = [App.Vector(60, 26, 0), App.Vector(37, 4, 0), App.Vector(33, -20, 0)]
obj2 = Draft.make_bspline(points2)
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()
doc.recompute()


surf = doc.addObject("Surface::Filling", "Surface")
bcurve = doc.addObject("Surface::FeatureBlendCurve","BlendCurve")
surf.BoundaryEdges = [(obj1, "Edge1"),
bcurve.StartEdge = (obj1, 'Edge1')
(obj2, "Edge1"),
bcurve.EndEdge = (obj2, 'Edge1')
bcurve.EndParameter = 1.00
(obj3, "Edge1"),
bcurve.StartSize = -5.00
(obj4, "Edge1")]
bcurve.EndSize = -5.00
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()
doc.recompute()
}}
}}
Line 132: Line 112:




<!--T:9-->
<!--T:42-->
{{Docnav
{{Docnav
|[[Surface_CurveOnMesh|CurveOnMesh]]
|
|
|[[Surface_GeomFillSurface|Fill boundary curves]]
|[[Surface_Workbench|Surface]]
|[[Surface_Workbench|Surface]]
|IconL=
|IconL=Surface_CurveOnMesh.svg
|IconR=Surface_GeomFillSurface.svg
|IconR=
|IconC=Workbench_Surface.svg
|IconC=Workbench_Surface.svg
}}
}}

Latest revision as of 20:48, 2 June 2023

Other languages:

Surface BlendCurve

Menu location
Surface → Blend Curve
Workbenches
Surface
Default shortcut
None
Introduced in version
0.21
See also
None

Description

Surface Blend Curve creates a Bezier curve between two edges, with desired continuity.

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.

Surface Blend Curve joining 2 edges with G3 continuity. Orange polygon represent the control points. Curvature comb (from Curves addon) is smooth at contact points.

Usage

  1. Select two edges in the 3D view
  2. There are several ways to invoke the command:
  3. Adjust the curve shape in the object Data properties

Properties

A Surface Blend Curve 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 Blend Curve has the following properties in the property editor.

Data

Blend Curve

  • DataStart Edge (LinkSub): First input edge.
  • DataStart Continuity (Integer): Geometric continuity value
  • DataStart Parameter (Float): Normalized parameter along edge; from 0.0(edge start) to 1.0(edge end).
  • DataStart Size (Float): Size of the tangent.
  • DataEnd Edge (LinkSub): Second input edge.
  • DataEnd Continuity (Integer): Geometric continuity value
  • DataEnd Parameter (Float): Normalized parameter along edge; from 0.0(edge start) to 1.0(edge end).
  • DataEnd Size (Float): Size of the tangent.

View

Base

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

Scripting

See also: FreeCAD Scripting Basics.

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

  • The edges to be used to define the curve must be assigned as LinkSub to the StartEdge and EndEdge properties of the object.
  • All objects with edges need to be computed before they can be used as input for the properties of the Blend Curve object.
import FreeCAD as App
import Draft

doc = App.newDocument()

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

points2 = [App.Vector(60, 26, 0), App.Vector(37, 4, 0), App.Vector(33, -20, 0)]
obj2 = Draft.make_bspline(points2)

doc.recompute()

bcurve = doc.addObject("Surface::FeatureBlendCurve","BlendCurve")
bcurve.StartEdge = (obj1, 'Edge1')
bcurve.EndEdge = (obj2, 'Edge1')
bcurve.EndParameter = 1.00
bcurve.StartSize = -5.00
bcurve.EndSize = -5.00

doc.recompute()