aerocaps.geom.surfaces.BezierSurface#

class BezierSurface(points: List[List[Point3D]], name: str = 'BezierSurface', construction: bool = False)[source]#

Bases: Surface

Bézier surface class. A NURBS surface with no internal knots and all weights equal to unity.

__init__(points: List[List[Point3D]], name: str = 'BezierSurface', construction: bool = False)[source]#

A Bézier surface is a parametric surface described by a matrix of control points and defined on a rectangular domain \(\{u \in [0,1], v \in [0,1]\}\). The mathematical expression for the Bézier surface is identical to that of the Bézier curve except with an extra dimension:

\[\mathbf{S}(u,v) = \sum\limits_{i=0}^n \sum\limits_{j=0}^m B_{i,n}(u) B_{j,m}(v) \mathbf{P}_{i,j}\]

Where \(B_{i,n}(t)\) is the Bernstein polynomial given by

\[B_{i,n}(t) = {n \choose i} t^i (1-t)^{n-i}\]

An example of a Bézier surface with \(n=2\) and \(m=3\) is shown below. Note that the only control points that lie directly on the surface are the corner points of the control point mesh. This is analogous to the fact that only the starting and ending control points of Bézier curves lie directly on the curve. In fact, Bézier curves derived from the bounding rows and columns of control points exactly represent the boundary curves of the surface. In this example, the control points given by \(\mathbf{P}_{i,j=0}\) and \(\mathbf{P}_{i,j=m}\) represent quadratic Bézier curves (\(n=2\)), and the control points given by \(\mathbf{P}_{i=0,j}\) and \(\mathbf{P}_{i=n,j}\) represent cubic Bézier curves (\(m=3\)).

../_images/bezier_surf_2x3.png

A \(2 \times 3\) Bézier surface with control points and control point net lines shown#

../_images/bezier_surf_2x3_mesh_only.png

A \(2 \times 3\) Bézier surface with isoparametric curves in both \(u\) and \(v\) shown#

Bézier surfaces can be constructed either via the default constructor with a nested list of aerocaps.geom.point.Point3D objects of by a 3-D numpy array. For example, say we have six Point3D objects, A-F and would like to use them to create a \(2 \times 1\) Bézier surface. Using the default constructor with the point objects,

surf = BezierSurface([[pA, pB], [pC, pD], [pE, pF]])

Using the array class method and point \(xyz\) float values given by pA_x, pA_y, pA_z, etc.,

control_points = np.array([
    [[pA_x, pA_y, pA_z], [pB_x, pB_y, pB_z]],
    [[pC_x, pC_y, pC_z], [pD_x, pD_y, pD_z]],
    [[pE_x, pE_y, pE_z], [pF_x, pF_y, pF_z]],
])

surf = BezierSurface(control_points)
Parameters:
  • points (List[List[Point3D]] or numpy.ndarray) – Control points for the Bézier surface, either as a nested list of Point3D objects or an ndarray of size \((n+1) \times (m+1) \times 3\), where \(n\) is the surface degree in the \(u\)-parametric direction and \(m\) is the surface degree in the \(v\)-parametric direction

  • name (str) – Name of the geometric object. May be re-assigned a unique name when added to a GeometryContainer. Default: ‘BezierSurface’

  • construction (bool) – Whether this is a geometry used only for construction of other geometries. If True, this geometry will not be exported or plotted. Default: False

Methods

d2Sdu2(u, v)

Evaluates the second derivative with respect to \(u\) at a single \((u,v)\) pair

d2Sdu2_grid(Nu, Nv)

Evaluates the second derivative with respect to \(u\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

d2Sdu2_uvvecs(u, v)

Evaluates the second derivative of the surface with respect to \(u\) at arbitrary vectors of \(u\) and \(v\)-values.

d2Sdv2(u, v)

Evaluates the second derivative with respect to \(v\) at a single \((u,v)\) pair

d2Sdv2_grid(Nu, Nv)

Evaluates the second derivative with respect to \(v\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

d2Sdv2_uvvecs(u, v)

Evaluates the second derivative of the surface with respect to \(v\) at arbitrary vectors of \(u\) and \(v\)-values.

dSdu(u, v)

Evaluates the first derivative with respect to \(u\) at a single \((u,v)\) pair

dSdu_grid(Nu, Nv)

Evaluates the first derivative with respect to \(u\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

dSdu_uvvecs(u, v)

Evaluates the first derivative of the surface with respect to \(u\) at arbitrary vectors of \(u\) and \(v\)-values.

dSdv(u, v)

Evaluates the first derivative with respect to \(v\) at a single \((u,v)\) pair

dSdv_grid(Nu, Nv)

Evaluates the first derivative with respect to \(v\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

dSdv_uvvecs(u, v)

Evaluates the first derivative of the surface with respect to \(v\) at arbitrary vectors of \(u\) and \(v\)-values.

elevate_degree_u()

Elevates the degree of the Bézier surface in the \(u\)-parametric direction.

elevate_degree_v()

Elevates the degree of the Bézier surface in the \(v\)-parametric direction.

enforce_c0(other, surface_edge, ...)

For zeroth-degree continuity, there is no difference between geometric (\(G^0\)) and parametric (\(C^0\)) continuity.

enforce_c0c1(other, surface_edge, ...)

Equivalent to calling enforce_g0g1 with f=1.0.

enforce_c0c1c2(other, surface_edge, ...)

Equivalent to calling enforce_g0g1g2 with f=1.0.

enforce_g0(other, surface_edge, ...)

Enforces \(G^0\) continuity along the input surface_edge by equating the control points along this edge to the control points along the other_surface_edge of the Bézier surface given by other.

enforce_g0g1(other, f, surface_edge, ...)

First enforces \(G^0\) continuity, then tangent (\(G^1\)) continuity is enforced according to the following equation:

enforce_g0g1_multiface([adjacent_surf_u0, ...])

enforce_g0g1g2(other, f, surface_edge, ...)

First enforces \(G^0\) and \(G^1\) continuity, then curvature (\(G^2\)) continuity is enforced according to the following equation:

enforce_g0g1g2_multiface([adjacent_surf_u0, ...])

evaluate(u, v)

Evaluates the surface at a given \((u,v)\) parameter pair.

evaluate_grid(Nu, Nv)

Evaluates the Bézier surface on a uniform \(N_u \times N_v\) grid of parameter values.

evaluate_point3d(u, v)

Evaluates the Bézier surface at a single \((u,v)\) parameter pair and returns a point object.

evaluate_uvvecs(u, v)

Evaluates the Bézier surface at arbitrary vectors of \(u\) and \(v\)-values.

extract_edge_curve(surface_edge)

Extracts the control points from one of the four edges of the Bézier surface and outputs a Bézier curve with these control points

extract_isoparametric_curve_u(u, Nv)

Extracts a curve along the \(v\)-direction at a fixed value of \(u\)

extract_isoparametric_curve_v(Nu, v)

Extracts a curve along the \(u\)-direction at a fixed value of \(v\)

from_curve_extrude(curve, distance[, ...])

Creates a Bézier surface by extruding a Bézier curve along an axis.

generate_control_point_net()

Generates a list of Point3D and Line3D objects representing the Bézier surface's control points and connections between them

get_control_point_array()

Converts the nested list of control points to a 3-D ndarray.

get_edge(edge[, n_points])

Evaluates the surface at n_points parameter locations along a given edge.

get_first_deriv_cp_sens_along_edge(edge, i, j)

Gets the sensitivity of the first \(u\)- or \(v\)-derivative along an edge with respect to control point \(\mathbf{P}_{i,j}\)

get_first_derivs_along_edge(edge[, ...])

Evaluates the parallel or perpendicular derivative along a surface edge at n_points parameter locations.

get_parallel_degree(surface_edge)

Gets the degree of the curve corresponding to the input surface edge.

get_parallel_n_points(surface_edge)

Gets the number of control points in the parametric direction parallel to the input surface edge.

get_perpendicular_degree(surface_edge)

Gets the degree of the curve in the parametric direction perpendicular to the input surface edge.

get_perpendicular_n_points(surface_edge)

Gets the number of control points in the parametric direction perpendicular to the input surface edge.

get_point(row_index, continuity_index, ...)

Gets the point corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied.

get_point_ij(row_index, continuity_index, ...)

Gets the point indices corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied.

get_second_deriv_cp_sens_along_edge(edge, i, j)

Gets the sensitivity of the second \(u\)- or \(v\)-derivative along an edge with respect to control point \(\mathbf{P}_{i,j}\)

get_second_derivs_along_edge(edge[, ...])

Evaluates the parallel or perpendicular second derivative along a surface edge at n_points parameter locations.

get_u_or_v_given_uvxyz([u, v, uv_guess, x, y, z])

Computes one parametric value given the other and a specified \(x\)-, \(y\)-, or \(z\)-location.

plot_control_point_mesh_lines(plot, ...)

Plots the network of lines connecting the Bézier surface control points using the pyvista library

plot_control_points(plot, **point_kwargs)

plot_surface(plot[, Nu, Nv])

set_point(point, row_index, ...)

Sets the point corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied.

split_at_u(u0)

Splits the Bézier surface at \(u=u_0\) along the \(v\)-parametric direction.

split_at_v(v0)

Splits the Bézier surface at \(v=v_0\) along the \(u\)-parametric direction.

to_iges(*args, **kwargs)

Converts the Bézier surface to an IGES entity.

to_rational_bezier_surface()

Converts the current non-rational Bézier surface to a rational Bézier surface by setting all weights to unity.

transform(**transformation_kwargs)

Creates a transformed copy of the surface by transforming each of the control points

verify_g0(other, surface_edge, ...[, n_points])

Verifies that two Bézier surfaces are \(G^0\)-continuous along their shared edge

verify_g1(other, surface_edge, ...[, n_points])

Verifies that two Bézier surfaces are \(G^1\)-continuous along their shared edge

verify_g2(other, surface_edge, ...[, n_points])

Verifies that two Bézier surfaces are \(G^2\)-continuous along their shared edge

Attributes

degree_u

Surface degree in the \(u\)-parametric direction

degree_v

Surface degree in the \(v\)-parametric direction

m

Shorthand for degree_v

n

Shorthand for degree_u

n_points_u

Number of control points in the \(u\)-parametric direction

n_points_v

Number of control points in the \(v\)-parametric direction

d2Sdu2(u: float, v: float) ndarray[source]#

Evaluates the second derivative with respect to \(u\) at a single \((u,v)\) pair

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

1-D array containing the \(x\)-, \(y\)-, and \(z\)-components of the second derivative

Return type:

np.ndarray

d2Sdu2_grid(Nu: int, Nv: int) ndarray[source]#

Evaluates the second derivative with respect to \(u\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

Parameters:
  • Nu (int) – Number of evenly spaced \(u\) values

  • Nv (int) – Number of evenly spaced \(v\) values

Returns:

Array of size \(N_u \times N_v \times 3\)

Return type:

np.ndarray

d2Sdu2_uvvecs(u: ndarray, v: ndarray)[source]#

Evaluates the second derivative of the surface with respect to \(u\) at arbitrary vectors of \(u\) and \(v\)-values.

Parameters:
  • u (np.ndarray) – 1-D array of \(u\)-parameter values

  • v (np.ndarray) – 1-D array of \(v\)-parameter values

Returns:

Array of size \(\text{len}(u) \times \text{len}(v) \times 3\)

Return type:

np.ndarray

d2Sdv2(u: float, v: float)[source]#

Evaluates the second derivative with respect to \(v\) at a single \((u,v)\) pair

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

1-D array containing the \(x\)-, \(y\)-, and \(z\)-components of the second derivative

Return type:

np.ndarray

d2Sdv2_grid(Nu: int, Nv: int) ndarray[source]#

Evaluates the second derivative with respect to \(v\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

Parameters:
  • Nu (int) – Number of evenly spaced \(u\) values

  • Nv (int) – Number of evenly spaced \(v\) values

Returns:

Array of size \(N_u \times N_v \times 3\)

Return type:

np.ndarray

d2Sdv2_uvvecs(u: ndarray, v: ndarray)[source]#

Evaluates the second derivative of the surface with respect to \(v\) at arbitrary vectors of \(u\) and \(v\)-values.

Parameters:
  • u (np.ndarray) – 1-D array of \(u\)-parameter values

  • v (np.ndarray) – 1-D array of \(v\)-parameter values

Returns:

Array of size \(\text{len}(u) \times \text{len}(v) \times 3\)

Return type:

np.ndarray

dSdu(u: float, v: float) ndarray[source]#

Evaluates the first derivative with respect to \(u\) at a single \((u,v)\) pair

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

1-D array containing the \(x\)-, \(y\)-, and \(z\)-components of the second derivative

Return type:

np.ndarray

dSdu_grid(Nu: int, Nv: int) ndarray[source]#

Evaluates the first derivative with respect to \(u\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

Parameters:
  • Nu (int) – Number of evenly spaced \(u\) values

  • Nv (int) – Number of evenly spaced \(v\) values

Returns:

Array of size \(N_u \times N_v \times 3\)

Return type:

np.ndarray

dSdu_uvvecs(u: ndarray, v: ndarray)[source]#

Evaluates the first derivative of the surface with respect to \(u\) at arbitrary vectors of \(u\) and \(v\)-values.

Parameters:
  • u (np.ndarray) – 1-D array of \(u\)-parameter values

  • v (np.ndarray) – 1-D array of \(v\)-parameter values

Returns:

Array of size \(\text{len}(u) \times \text{len}(v) \times 3\)

Return type:

np.ndarray

dSdv(u: float, v: float)[source]#

Evaluates the first derivative with respect to \(v\) at a single \((u,v)\) pair

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

1-D array containing the \(x\)-, \(y\)-, and \(z\)-components of the second derivative

Return type:

np.ndarray

dSdv_grid(Nu: int, Nv: int) ndarray[source]#

Evaluates the first derivative with respect to \(v\) on a linearly-spaced grid of \(u\)- and \(v\)-values.

Parameters:
  • Nu (int) – Number of evenly spaced \(u\) values

  • Nv (int) – Number of evenly spaced \(v\) values

Returns:

Array of size \(N_u \times N_v \times 3\)

Return type:

np.ndarray

dSdv_uvvecs(u: ndarray, v: ndarray)[source]#

Evaluates the first derivative of the surface with respect to \(v\) at arbitrary vectors of \(u\) and \(v\)-values.

Parameters:
  • u (np.ndarray) – 1-D array of \(u\)-parameter values

  • v (np.ndarray) – 1-D array of \(v\)-parameter values

Returns:

Array of size \(\text{len}(u) \times \text{len}(v) \times 3\)

Return type:

np.ndarray

property degree_u: int#

Surface degree in the \(u\)-parametric direction

property degree_v: int#

Surface degree in the \(v\)-parametric direction

elevate_degree_u() BezierSurface[source]#

Elevates the degree of the Bézier surface in the \(u\)-parametric direction.

../_images/bezier_surface_2x3_u_elevation.gif

\(u\) degree (\(n\)) elevation#

Returns:

A new Bézier surface with identical shape to the current one but with one additional row of control points in the \(u\)-parametric direction

Return type:

BezierSurface

elevate_degree_v() BezierSurface[source]#

Elevates the degree of the Bézier surface in the \(v\)-parametric direction.

../_images/bezier_surface_2x3_v_elevation.gif

\(v\) degree (\(m\)) elevation#

Returns:

A new Bézier surface with identical shape to the current one but with one additional row of control points in the \(v\)-parametric direction

Return type:

BezierSurface

enforce_c0(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

For zeroth-degree continuity, there is no difference between geometric (\(G^0\)) and parametric (\(C^0\)) continuity. Because this method is simply a convenience method that calls enforce_g0, see the documentation for that method for more detailed documentation.

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_c0c1(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

Equivalent to calling enforce_g0g1 with f=1.0. See that method for more detailed documentation.

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_c0c1c2(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

Equivalent to calling enforce_g0g1g2 with f=1.0. See that method for more detailed documentation.

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_g0(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

Enforces \(G^0\) continuity along the input surface_edge by equating the control points along this edge to the control points along the other_surface_edge of the Bézier surface given by other. The control points of the surface from which this method is called are modified in-place, and the control points of other are left unchanged.

Important

The parallel degree of the current surface along surface_edge must be equal to the parallel degree of the other surface along other_surface_edge, otherwise an AssertionError will be raised. If these degrees are not equal, first elevate the degree of the surface with the lower parallel degree until the degrees match using either elevate_degree_u or elevate_degree_v, whichever is appropriate.

See also

enforce_c0

Parametric continuity equivalent (\(C^0\))

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_g0g1(other: BezierSurface, f: float, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

First enforces \(G^0\) continuity, then tangent (\(G^1\)) continuity is enforced according to the following equation:

\[\mathcal{P}^{b,\mathcal{E}_b}_{k,1} = \mathcal{P}^{b,\mathcal{E}_b}_{k,0} + f \frac{p_{\perp}^{a,\mathcal{E}_a}}{p_{\perp}^{b,\mathcal{E}_b}} \left[\mathcal{P}^{a,\mathcal{E}_a}_{k,0} - \mathcal{P}^{a,\mathcal{E}_a}_{k,1} \right] \text{ for }k=0,1,\ldots,p_{\parallel}^{b,\mathcal{E}_b}\]

Here, \(b\) corresponds to the current surface, and \(a\) corresponds to the other surface. The control points of the surface from which this method is called are modified in-place, and the control points of other are left unchanged.

See also

enforce_g0

Geometric point continuity enforcement (\(G^0\))

enforce_c0c1

Parametric continuity equivalent (\(C^1\))

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • f (float) – Tangent proportionality factor

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_g0g1_multiface(adjacent_surf_u0: BezierSurface = None, adjacent_surf_u1: BezierSurface = None, adjacent_surf_v0: BezierSurface = None, adjacent_surf_v1: BezierSurface = None, other_edge_u0: SurfaceEdge = None, other_edge_u1: SurfaceEdge = None, other_edge_v0: SurfaceEdge = None, other_edge_v1: SurfaceEdge = None, f_u0_initial: float = 1.0, f_u1_initial: float = 1.0, f_v0_initial: float = 1.0, f_v1_initial: float = 1.0, n_deriv_points: int = 10) OptimizeResult[source]#

Warning

This is an experimental feature and should not be used in production geometries

Enforces \(G^0\) and \(G^1\) continuity across multiple adjacent boundaries of a surface, up to all four boundaries. This is done by first enforcing \(G^0\) continuity at all required boundaries and then optimizing the locations of the second rows of control points to minimize \(G^1\) error at n_deriv_points locations along each of the boundary curves. The following is the cost function that is minimized:

\[J(x_k) = \sum\limits_{i=0}^{n_p n_{\mathcal{E}}} \left( \left. \frac{\partial \mathbf{S}_i^a(u,v)}{\partial \mu} \right|_{u=u_i,v=v_i} - \frac{f_{\text{sgn},i}}{f_i(x_k)} \left. \frac{\partial \mathbf{S}^b(u,v,x_k)}{\partial \mu} \right|_{u=u_i,v=v_i} \right)^2\]

where

  • \(x_k\) is the set of design variables to be optimized including the internal control point locations and tangent proportionality factors across each boundary

  • \(n_p\) is the number of discrete first derivative calculations on each boundary (specified by n_deriv_points)

  • \(n_\mathcal{E}\) is the number of edges across which continuity is being enforced

  • \(\mathbf{S}_i^a(u,v)\) is a surface specified by adjacent_surf_u0, etc.

  • \(\mu\) is equal to either \(u\) or \(v\), determined by the parametric direction perpendicular to the edge

  • \((u_i,v_i)\) is the point along an edge where the derivative is being evaluated

  • \(f_{\text{sgn},i}\) is the sign of the proportionality factor, \(-1\) if both the target edge and other edge specified by \(i\) end in \(0\) or both end in \(1\), \(1\) otherwise

  • \(f_i(x_k)\) is the tangent proportionality factor

  • \(\mathbf{S}^b(u,v,x_k)\) is the target surface (self)

For maximum performance of the optimizer, the exact Jacobian is calculated:

\[\frac{\partial J(x_k)}{\partial x_k} = 2 \sum\limits_{i=0}^{n_p n_{\mathcal{E}}} \left( \left. \frac{\partial \mathbf{S}_i^a(u,v)}{\partial \mu} \right|_{u=u_i,v=v_i} - \frac{f_{\text{sgn},i}}{f_i(x_k)} \left. \frac{\partial \mathbf{S}^b(u,v,x_k)}{\partial \mu} \right|_{u=u_i,v=v_i} \right) \left[ -f_{\text{sgn},i} \frac{\partial}{\partial x_k} \left( \frac{1}{f_i} \right) \left( \left. \frac{\partial \mathbf{S}^b(u,v,x_k)}{\partial \mu} \right|_{u=u_i,v=v_i} \right) -\frac{f_{\text{sgn},i}}{f_i} \frac{\partial}{\partial x_k} \left( \left. \frac{\partial \mathbf{S}^b(u,v,x_k)}{\partial \mu} \right|_{u=u_i,v=v_i} \right) \right]\]

Note

This method is reserved for the complex case where continuity is required across boundaries that share a surface corner. In the case of continuity with a single surface or a pair of surfaces with common boundaries on opposite sides of the surface (such as the \(v_0\) and \(v_1\) boundaries), the much simpler enforce_g0g1 should be used.

../_images/bezier_enforce_g0g1_multiface.png

Multi-face \(G^0\) and \(G^1\) continuity enforcement#

Parameters:
  • adjacent_surf_u0 (BezierSurface) – Surface sharing the \(u_0\) boundary of target_surf. Default: None

  • adjacent_surf_u1 (BezierSurface) – Surface sharing the \(u_1\) boundary of target_surf. Default: None

  • adjacent_surf_v0 (BezierSurface) – Surface sharing the \(v_0\) boundary of target_surf. Default: None

  • adjacent_surf_v1 (BezierSurface) – Surface sharing the \(v_1\) boundary of target_surf. Default: None

  • other_edge_u0 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_u1 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_v0 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_v1 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • f_u0_initial (float) – Initial value of the tangent proportionality factor across boundary \(u_0\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_u1_initial (float) – Initial value of the tangent proportionality factor across boundary \(u_1\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_v0_initial (float) – Initial value of the tangent proportionality factor across boundary \(v_0\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_v1_initial (float) – Initial value of the tangent proportionality factor across boundary \(v_1\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • n_deriv_points (int) – Number of discrete locations where the continuity error will be evaluated. Default: 10

Returns:

Result from the \(G^1\) continuity error minimization problem solution

Return type:

OptimizeResult

enforce_g0g1g2(other: BezierSurface, f: float, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge)[source]#

First enforces \(G^0\) and \(G^1\) continuity, then curvature (\(G^2\)) continuity is enforced according to the following equation:

\[\mathcal{P}^{b,\mathcal{E}_b}_{k,2} = 2 \mathcal{P}^{b,\mathcal{E}_b}_{k,1} - \mathcal{P}^{b,\mathcal{E}_b}_{k,0} + f^2 \frac{p_{\perp}^{a,\mathcal{E}_a}(p_{\perp}^{a,\mathcal{E}_a}-1)}{p_{\perp}^{b,\mathcal{E}_b}(p_{\perp}^{b,\mathcal{E}_b}-1)} \left[ \mathcal{P}^{a,\mathcal{E}_a}_{k,0} - 2 \mathcal{P}^{a,\mathcal{E}_a}_{k,1} + \mathcal{P}^{a,\mathcal{E}_a}_{k,2} \right] \text{ for }k=0,1,\ldots,p_{\parallel}^{b,\mathcal{E}_b}\]

Here, \(b\) corresponds to the current surface, and \(a\) corresponds to the other surface. The control points of the surface from which this method is called are modified in-place, and the control points of other are left unchanged.

See also

enforce_g0

Geometric point continuity enforcement (\(G^0\))

enforce_g0g1

Geometric tangent continuity enforcement (\(G^1\))

enforce_c0c1c2

Parametric continuity equivalent (\(C^2\))

Parameters:
  • other (BezierSurface) – Another Bézier surface along which an edge will be used for stitching

  • f (float) – Tangent proportionality factor

  • surface_edge (SurfaceEdge) – The edge of the current surface to modify

  • other_surface_edge (SurfaceEdge) – Tool edge of surface other which determines the positions of control points along surface_edge of the current surface

enforce_g0g1g2_multiface(adjacent_surf_u0: BezierSurface = None, adjacent_surf_u1: BezierSurface = None, adjacent_surf_v0: BezierSurface = None, adjacent_surf_v1: BezierSurface = None, other_edge_u0: SurfaceEdge = None, other_edge_u1: SurfaceEdge = None, other_edge_v0: SurfaceEdge = None, other_edge_v1: SurfaceEdge = None, f_u0_initial: float = 1.0, f_u1_initial: float = 1.0, f_v0_initial: float = 1.0, f_v1_initial: float = 1.0, n_deriv_points: int = 10) OptimizeResult[source]#

Warning

This is an experimental feature and should not be used in production geometries

Enforces \(G^0\), \(G^1\), and \(G^2\) continuity across multiple adjacent boundaries of a surface, up to all four boundaries. This is done by first enforcing \(G^0\) continuity at all required boundaries and then optimizing the locations of the second and third rows of control points to minimize \(G^1\) and \(G^2\) error at n_deriv_points locations along each of the boundary curves. The following is the cost function that is minimized:

\[J(x_k) = \sum\limits_{l=1}^2 \sum\limits_{i=0}^{n_p n_{\mathcal{E}}} \left( \left. \frac{\partial^l \mathbf{S}_i^a(u,v)}{\partial \mu^l} \right|_{u=u_i,v=v_i} - \frac{f_{\text{sgn},i}}{f^l_i(x_k)} \left. \frac{\partial^l \mathbf{S}^b(u,v,x_k)}{\partial \mu^l} \right|_{u=u_i,v=v_i} \right)^2\]

where

  • \(x_k\) is the set of design variables to be optimized including the internal control point locations and tangent proportionality factors across each boundary

  • \(n_p\) is the number of discrete derivative calculations on each boundary (specified by n_deriv_points)

  • \(n_\mathcal{E}\) is the number of edges across which continuity is being enforced

  • \(\mathbf{S}_i^a(u,v)\) is a surface specified by adjacent_surf_u0, etc.

  • \(\mu\) is equal to either \(u\) or \(v\), determined by the parametric direction perpendicular to the edge

  • \((u_i,v_i)\) is the point along an edge where the derivative is being evaluated

  • \(f_{\text{sgn},i}\) is the sign of the proportionality factor, \(-1\) if both the target edge and other edge specified by \(i\) end in \(0\) or both end in \(1\), \(1\) otherwise

  • \(f_i(x_k)\) is the tangent proportionality factor

  • \(\mathbf{S}^b(u,v,x_k)\) is the target surface (self)

  • \(l\) is the derivative order

For maximum performance of the optimizer, the exact Jacobian is calculated:

\[\frac{\partial J(x_k)}{\partial x_k} = 2 \sum\limits_{l=1}^2 \sum\limits_{i=0}^{n_p n_{\mathcal{E}}} \left( \left. \frac{\partial^l \mathbf{S}_i^a(u,v)}{\partial \mu^l} \right|_{u=u_i,v=v_i} - \frac{f_{\text{sgn},i}}{f^l_i(x_k)} \left. \frac{\partial^l \mathbf{S}^b(u,v,x_k)}{\partial \mu^l} \right|_{u=u_i,v=v_i} \right) \left[ -f_{\text{sgn},i} \frac{\partial}{\partial x_k} \left( \frac{1}{f^l_i} \right) \left( \left. \frac{\partial^l \mathbf{S}^b(u,v,x_k)}{\partial \mu^l} \right|_{u=u_i,v=v_i} \right) -\frac{f_{\text{sgn},i}}{f_i^l} \frac{\partial}{\partial x_k} \left( \left. \frac{\partial^l \mathbf{S}^b(u,v,x_k)}{\partial \mu^l} \right|_{u=u_i,v=v_i} \right) \right]\]

Note

This method is reserved for the complex case where continuity is required across boundaries that share a surface corner. In the case of continuity with a single surface or a pair of surfaces with common boundaries on opposite sides of the surface (such as the \(v_0\) and \(v_1\) boundaries), the much simpler enforce_g0g1g2 should be used.

Parameters:
  • adjacent_surf_u0 (BezierSurface) – Surface sharing the \(u_0\) boundary of target_surf. Default: None

  • adjacent_surf_u1 (BezierSurface) – Surface sharing the \(u_1\) boundary of target_surf. Default: None

  • adjacent_surf_v0 (BezierSurface) – Surface sharing the \(v_0\) boundary of target_surf. Default: None

  • adjacent_surf_v1 (BezierSurface) – Surface sharing the \(v_1\) boundary of target_surf. Default: None

  • other_edge_u0 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_u1 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_v0 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • other_edge_v1 (SurfaceEdge) – Edge of surface adjacent_surf_u0 that will be stitched. Default: None

  • f_u0_initial (float) – Initial value of the tangent proportionality factor across boundary \(u_0\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_u1_initial (float) – Initial value of the tangent proportionality factor across boundary \(u_1\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_v0_initial (float) – Initial value of the tangent proportionality factor across boundary \(v_0\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • f_v1_initial (float) – Initial value of the tangent proportionality factor across boundary \(v_1\). The final value selected by the optimizer will be different from this value. Default: 1.0

  • n_deriv_points (int) – Number of discrete locations where the continuity error will be evaluated. Default: 10

Returns:

Result from the \(G^1\)- and \(G^2\)-continuity error minimization problem solution

Return type:

OptimizeResult

evaluate(u: float, v: float)[source]#

Evaluates the surface at a given \((u,v)\) parameter pair.

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

1-D array of the form array([x, y, z]) representing the evaluated point on the surface

Return type:

numpy.ndarray

evaluate_grid(Nu: int, Nv: int) ndarray[source]#

Evaluates the Bézier surface on a uniform \(N_u \times N_v\) grid of parameter values.

Parameters:
  • Nu (int) – Number of uniformly spaced parameter values in the \(u\)-direction

  • Nv (int) – Number of uniformly spaced parameter values in the \(v\)-direction

Returns:

Array of size \(N_u \times N_v \times 3\)

Return type:

numpy.ndarray

evaluate_point3d(u: float, v: float) Point3D[source]#

Evaluates the Bézier surface at a single \((u,v)\) parameter pair and returns a point object.

Parameters:
  • u (float) – Position along \(u\) in parametric space. Normally in the range \([0,1]\)

  • v (float) – Position along \(v\) in parametric space. Normally in the range \([0,1]\)

Returns:

Point object corresponding to the \((u,v)\) pair

Return type:

Point3D

evaluate_uvvecs(u: ndarray, v: ndarray) ndarray[source]#

Evaluates the Bézier surface at arbitrary vectors of \(u\) and \(v\)-values.

Parameters:
  • u (np.ndarray) – 1-D array of \(u\)-parameter values

  • v (np.ndarray) – 1-D array of \(v\)-parameter values

Returns:

Array of size \(\text{len}(u) \times \text{len}(v) \times 3\)

Return type:

np.ndarray

extract_edge_curve(surface_edge: SurfaceEdge) BezierCurve3D[source]#

Extracts the control points from one of the four edges of the Bézier surface and outputs a Bézier curve with these control points

Parameters:

surface_edge (SurfaceEdge) – Edge along which to extract the curve

Returns:

Bézier curve with control points corresponding to the control points along the edge of the surface

Return type:

BezierCurve3D

extract_isoparametric_curve_u(u: float, Nv: int) ndarray[source]#

Extracts a curve along the \(v\)-direction at a fixed value of \(u\)

Parameters:
  • u (float) – Constant value of \(u\)

  • Nv (int) – Number of points to evaluate, linearly spaced in \(v\)

Returns:

Array of size \(N_v \times 3\) representing the \(x\)-, \(y\)-, and \(z\)-coordinates of the points evaluated along the isoparametric curve

Return type:

numpy.ndarray

extract_isoparametric_curve_v(Nu: int, v: float) ndarray[source]#

Extracts a curve along the \(u\)-direction at a fixed value of \(v\)

Parameters:
  • Nu (int) – Number of points to evaluate, linearly spaced in \(u\)

  • v (float) – Constant value of \(v\)

Returns:

Array of size \(N_u \times 3\) representing the \(x\)-, \(y\)-, and \(z\)-coordinates of the points evaluated along the isoparametric curve

Return type:

numpy.ndarray

classmethod from_curve_extrude(curve: BezierCurve3D, distance: Length, extrude_axis: Vector3D = None, symmetric: bool = False, reverse: bool = False)[source]#

Creates a Bézier surface by extruding a Bézier curve along an axis.

Important

If the input curve is linear, the extrude_axis argument must be specified.

Parameters:
  • curve (BezierCurve3D) – Curve to extrude. The most common use case is a planar curve, but this is not required.

  • distance (Length) – Distance along the axis to extrude

  • extrude_axis (Vector3D) – Optional direct specification of the extrusion axis. If not specified, a vector normal to the plane containing the first, second, and last control points of the curve is used. Default: None

  • symmetric (bool) – Whether to extrude in both directions. Default: False

  • reverse (bool) – Whether to flip the extrusion vector. Default: False

Returns:

Extruded surface

Return type:

BezierSurface

generate_control_point_net()[source]#

Generates a list of Point3D and Line3D objects representing the Bézier surface’s control points and connections between them

Returns:

Control points and lines between adjacent control points in flattened lists

Return type:

List[Point3D], List[Line3D]

get_control_point_array() ndarray[source]#

Converts the nested list of control points to a 3-D ndarray.

Returns:

3-D array

Return type:

numpy.ndarray

get_edge(edge: SurfaceEdge, n_points: int = 10) ndarray[source]#

Evaluates the surface at n_points parameter locations along a given edge.

Parameters:
  • edge (SurfaceEdge) – Edge along which to evaluate

  • n_points (int) – Number of evenly-spaced parameter locations at which to evaluate the edge curve. Default: 10

Returns:

2-D array of size \(n_\text{points} \times 3\)

Return type:

numpy.ndarray

get_first_deriv_cp_sens_along_edge(edge: SurfaceEdge, i: int, j: int, n_points: int = 10, perp: bool = True) ndarray[source]#

Gets the sensitivity of the first \(u\)- or \(v\)-derivative along an edge with respect to control point \(\mathbf{P}_{i,j}\)

Parameters:
  • edge (SurfaceEdge) – Edge along which to evaluate

  • i (int) – \(i\)-index of the control point

  • j (int) – \(j\)-index of the control point

  • n_points (int) – Number of evenly-spaced parameter locations at which to evaluate the derivative. Default: 10

  • perp (bool) – Whether to evaluate the cross-derivative. If False, the derivative along the parameter direction parallel to the edge will be evaluated instead. Default: True

Returns:

2-D array of size \(n_\text{points} \times 3\)

Return type:

numpy.ndarray

get_first_derivs_along_edge(edge: SurfaceEdge, n_points: int = 10, perp: bool = True) ndarray[source]#

Evaluates the parallel or perpendicular derivative along a surface edge at n_points parameter locations. The derivative represents either \(\frac{\partial \mathbf{S}(u,v)}{\partial u}\) or \(\frac{\partial \mathbf{S}(u,v)}{\partial v}\) depending on which edge is selected and which value is assigned to perp.

Parameters:
  • edge (SurfaceEdge) – Edge along which to evaluate

  • n_points (int) – Number of evenly-spaced parameter locations at which to evaluate the derivative. Default: 10

  • perp (bool) – Whether to evaluate the cross-derivative. If False, the derivative along the parameter direction parallel to the edge will be evaluated instead. Default: True

Returns:

2-D array of size \(n_\text{points} \times 3\)

Return type:

numpy.ndarray

get_parallel_degree(surface_edge: SurfaceEdge) int[source]#

Gets the degree of the curve corresponding to the input surface edge.

Parameters:

surface_edge (SurfaceEdge) – Edge along which the parallel degree is evaluated

Returns:

Degree parallel to the edge

Return type:

int

get_parallel_n_points(surface_edge: SurfaceEdge) int[source]#

Gets the number of control points in the parametric direction parallel to the input surface edge.

Parameters:

surface_edge (SurfaceEdge) – Edge along which the parallel number of control points is evaluated

Returns:

Number of control points parallel to the edge

Return type:

int

get_perpendicular_degree(surface_edge: SurfaceEdge) int[source]#

Gets the degree of the curve in the parametric direction perpendicular to the input surface edge.

Parameters:

surface_edge (SurfaceEdge) – Edge along which the perpendicular degree is evaluated

Returns:

Degree perpendicular to the edge

Return type:

int

get_perpendicular_n_points(surface_edge: SurfaceEdge) int[source]#

Gets the number of control points in the parametric direction perpendicular to the input surface edge.

Parameters:

surface_edge (SurfaceEdge) – Edge along which the perpendicular number of control points is evaluated

Returns:

Number of control points perpendicular to the edge

Return type:

int

get_point(row_index: int, continuity_index: int, surface_edge: SurfaceEdge) Point3D[source]#

Gets the point corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied. For example, for a \(6 \times 5\) Bézier surface, the following code

p = surf.get_point(2, 1, ac.SurfaceEdge.v0)

returns the point \(\mathbf{P}_{2,1}\) and

p = surf.get_point(2, 1, ac.SurfaceEdge.u1)

returns the point \(\mathbf{P}_{6-1,2} = \mathbf{P}_{5,2}\).

See also

set_point

Setter equivalent of this method

Parameters:
  • row_index (int) – Index along the surface edge control points

  • continuity_index (int) – Index in the parametric direction perpendicular to the surface edge. Normally either 0, 1, or 2

  • surface_edge (SurfaceEdge) – Edge of the surface along which to retrieve the control point

Returns:

Point used to enforce \(G^x\) continuity, where \(x\) is the value of continuity_index

Return type:

Point3D

get_point_ij(row_index: int, continuity_index: int, surface_edge: ~aerocaps.geom.surfaces.SurfaceEdge) -> (<class 'int'>, <class 'int'>)[source]#

Gets the point indices corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied.

Parameters:
  • row_index (int) – Index along the surface edge control points

  • continuity_index (int) – Index in the parametric direction perpendicular to the surface edge. Normally either 0, 1, or 2

  • surface_edge (SurfaceEdge) – Edge of the surface along which to retrieve the control point

Returns:

Point indices used to enforce \(G^x\) continuity, where \(x\) is the value of continuity_index

Return type:

int, int

get_second_deriv_cp_sens_along_edge(edge: SurfaceEdge, i: int, j: int, n_points: int = 10, perp: bool = True) ndarray[source]#

Gets the sensitivity of the second \(u\)- or \(v\)-derivative along an edge with respect to control point \(\mathbf{P}_{i,j}\)

Parameters:
  • edge (SurfaceEdge) – Edge along which to evaluate

  • i (int) – \(i\)-index of the control point

  • j (int) – \(j\)-index of the control point

  • n_points (int) – Number of evenly-spaced parameter locations at which to evaluate the derivative. Default: 10

  • perp (bool) – Whether to evaluate the cross-derivative. If False, the derivative along the parameter direction parallel to the edge will be evaluated instead. Default: True

Returns:

2-D array of size \(n_\text{points} \times 3\)

Return type:

numpy.ndarray

get_second_derivs_along_edge(edge: SurfaceEdge, n_points: int = 10, perp: bool = True) ndarray[source]#

Evaluates the parallel or perpendicular second derivative along a surface edge at n_points parameter locations. The derivative represents either \(\frac{\partial^2 \mathbf{S}(u,v)}{\partial u^2}\) or \(\frac{\partial^2 \mathbf{S}(u,v)}{\partial v^2}\) depending on which edge is selected and which value is assigned to perp.

Parameters:
  • edge (SurfaceEdge) – Edge along which to evaluate

  • n_points (int) – Number of evenly-spaced parameter locations at which to evaluate the second derivative. Default: 10

  • perp (bool) – Whether to evaluate the cross-derivative. If False, the second derivative along the parameter direction parallel to the edge will be evaluated instead. Default: True

Returns:

2-D array of size \(n_\text{points} \times 3\)

Return type:

numpy.ndarray

get_u_or_v_given_uvxyz(u: float = None, v: float = None, uv_guess: float = 0.5, x: Length = None, y: Length = None, z: Length = None) float[source]#

Computes one parametric value given the other and a specified \(x\)-, \(y\)-, or \(z\)-location. As an example, given a BezierSurface object assigned to the variable surf, the \(u\)-parameter corresponding to \(y=1.4\) along the \(v=0.8\) isoparametric curve can be computed using

u = surf.get_u_or_v_given_uvxyz(v=0.8, y=1.4)

Note that the inputs are keyword arguments to avoid having to specify None for each of the arguments not used.

Parameters:
  • u (float or None) – Value of \(u\) to solve for or specify. If left as None, this parameter will be solved for. If None, \(v\) must be specified. Default: None

  • v (float or None) – Value of \(v\) to solve for or specify. If left as None, this parameter will be solved for. If None, \(u\) must be specified. Default: None

  • uv_guess (float) – Starting guess for the unsolved \(u\) or \(v\) parameter. Default: 0.5

  • x (Length or None) – \(x\)-location corresponding to the \(u\) or \(v\) parameter to be solved. If this value is outside the surface geometry, the root-finder will fail and an error will be raised. If unspecified, either \(y\) or \(z\) must be specified. Default: None

  • y (Length or None) – \(y\)-location corresponding to the \(u\) or \(v\) parameter to be solved. If this value is outside the surface geometry, the root-finder will fail and an error will be raised. If unspecified, either \(x\) or \(z\) must be specified. Default: None

  • z (Length or None) – \(z\)-location corresponding to the \(u\) or \(v\) parameter to be solved. If this value is outside the surface geometry, the root-finder will fail and an error will be raised. If unspecified, either \(x\) or \(y\) must be specified. Default: None

Returns:

The value of \(u\) if \(v\) is specified or \(v\) if \(u\) is specified

Return type:

float

property m: int#

Shorthand for degree_v

Returns:

Surface degree in the \(v\)-parametric direction

Return type:

int

property n: int#

Shorthand for degree_u

Returns:

Surface degree in the \(u\)-parametric direction

Return type:

int

property n_points_u: int#

Number of control points in the \(u\)-parametric direction

property n_points_v: int#

Number of control points in the \(v\)-parametric direction

plot_control_point_mesh_lines(plot: Plotter, **line_kwargs) Actor[source]#

Plots the network of lines connecting the Bézier surface control points using the pyvista library

Parameters:
Returns:

The lines actor

Return type:

pv.Actor

plot_control_points(plot: Plotter, **point_kwargs) Actor[source]#

Plots the Bézier surface control points using the pyvista library

Parameters:
Returns:

The points actor

Return type:

pv.Actor

plot_surface(plot: Plotter, Nu: int = 50, Nv: int = 50, **mesh_kwargs) StructuredGrid[source]#

Plots the Bézier surface using the pyvista library

Parameters:
  • plotpyvista.Plotter instance

  • Nu (int) – Number of points to evaluate in the \(u\)-parametric direction. Default: 50

  • Nv (int) – Number of points to evaluate in the \(v\)-parametric direction. Default: 50

  • mesh_kwargs – Keyword arguments to pass to pyvista.Plotter.add_mesh

Returns:

The evaluated Bézier surface

Return type:

pyvista.core.pointset.StructuredGrid

set_point(point: Point3D, row_index: int, continuity_index: int, surface_edge: SurfaceEdge)[source]#

Sets the point corresponding to a particular index along the edge curve with perpendicular index corresponding to the level of continuity being applied. For example, for a \(6 \times 5\) Bézier surface, the following code

p = ac.Point3D.from_array(np.array([3.0, 4.0, 5.0]))
surf.set_point(p, 2, 1, ac.SurfaceEdge.v0)

sets the value of point \(\mathbf{P}_{2,1}\) to \([3,4,5]^T\) and

p = ac.Point3D.from_array(np.array([3.0, 4.0, 5.0]))
surf.set_point(p, 2, 1, ac.SurfaceEdge.u1)

sets the value of point \(\mathbf{P}_{6-1,2} = \mathbf{P}_{5,2}\) to \([3,4,5]^T\).

See also

get_point

Getter equivalent of this method

Parameters:
  • point (Point3D) – Point object to apply at the specified indices

  • row_index (int) – Index along the surface edge control points

  • continuity_index (int) – Index in the parametric direction perpendicular to the surface edge. Normally either 0, 1, or 2

  • surface_edge (SurfaceEdge) – Edge of the surface along which to retrieve the control point

split_at_u(u0: float)[source]#

Splits the Bézier surface at \(u=u_0\) along the \(v\)-parametric direction.

split_at_v(v0: float)[source]#

Splits the Bézier surface at \(v=v_0\) along the \(u\)-parametric direction.

to_iges(*args, **kwargs) IGESEntity[source]#

Converts the Bézier surface to an IGES entity. To add this IGES entity to an .igs file, use an IGESGenerator.

to_rational_bezier_surface() RationalBezierSurface[source]#

Converts the current non-rational Bézier surface to a rational Bézier surface by setting all weights to unity.

Returns:

Converted surface

Return type:

RationalBezierSurface

transform(**transformation_kwargs) BezierSurface[source]#

Creates a transformed copy of the surface by transforming each of the control points

Parameters:

transformation_kwargs – Keyword arguments passed to Transformation3D

Returns:

Transformed surface

Return type:

BezierSurface

verify_g0(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge, n_points: int = 10)[source]#

Verifies that two Bézier surfaces are \(G^0\)-continuous along their shared edge

verify_g1(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge, n_points: int = 10)[source]#

Verifies that two Bézier surfaces are \(G^1\)-continuous along their shared edge

verify_g2(other: BezierSurface, surface_edge: SurfaceEdge, other_surface_edge: SurfaceEdge, n_points: int = 10)[source]#

Verifies that two Bézier surfaces are \(G^2\)-continuous along their shared edge