# sfepy.mesh.splinebox module

class sfepy.mesh.splinebox.SplineBox(bbox, coors, nsg=None, field=None)

  B-spline geometry parametrization. The geometry can be modified by moving spline control points.

  static create_spb(bbox, coors, degree=3, nsg=None)
  evaluate(cp_values=None, outside=True)

    Evaluate the new position of the mesh coordinates.

    Parameters:
      cp_values array

        The actual control point values. If None, use self.control_values.

      outside bool

        If True, return also the coordinates outside the spline box.

    Returns:
      new_coors array

        The new position of the mesh coordinates.

  evaluate_derivative(cpoint, dirvec)

    Evaluate derivative of the spline in a given control point and direction.

    Parameters:
      cpoint int, list

        The position (index or grid indicies) of the spline control point.

      dirvec array

        The directional vector.

    Returns:
      diff array

        The derivative field.

  static gen_cp_idxs(ncp)
  get_box_matrix()
    Returns:
      mtx2D array

        The matrix containing the coefficients of b-spline basis functions.

  get_control_points(init=False)

    Get the spline control points coordinates.

    Returns:
      cpt_coors array

        The coordinates of the spline control points.

      init bool

        If True, return the initial state.

  get_coors_shape()

    Get the shape of the coordinates.

  move_control_point(cpoint, val)

    Change shape of spline parametrization.

    Parameters:
      cpoint int, list

        The position (index or grid indicies) of the spline control point.

      val array

        Displacement.

  set_control_points(cpt_coors, add=False)

    Set the spline control points position.

    Parameters:
      cpt_coors array

        The coordinates of the spline control points.

      add bool

        If True, coors += cpt_coors

  write_control_net(filename, deform_by_values=True)

    Write the SplineBox shape to the VTK file.

    Parameters:
      filename str

        The VTK file name.

class sfepy.mesh.splinebox.SplineRegion2D(spl_bnd, coors, rho=1000.0)

  B-spline geometry parametrization. The boundary of the SplineRegion2D is defined by BSpline curves.

  static create_spb(spl_bnd, coors, rho=10)

    Initialize SplineBox knots, control points, base functions, …

  static define_control_points(cp_bnd_coors, ncp)

    Find positions of “inner” control points depending on boundary splines.

  find_ts(coors)

    Function finds parameters (t, s) corresponding to given points (coors).

  static points_in_poly(points, poly, tol=1e-06)

    Find which points are located inside the polygon.