Skip to content

BSpline3DService

Canonical path: NemAll_Python_Geometry.BSpline3DService

Utilities for BSpline

AddControlPoint

AddControlPoint(pointIdx: int, coords: Point3D)

add control point to B-Spline

Parameters:

  • pointIdx (int) –

    index, where new point will be stored

  • coords (Point3D) –

    coordinates of point

AddControlPointOnSegment

AddControlPointOnSegment(
    ray: Vector3D, coords: Point3D
) -> tuple[eGeometryErrorCode, int]

add control point to B-Spline's segment given by point

Parameters:

Returns:

BSplineToSpline staticmethod

BSplineToSpline(bspline: BSpline3D) -> Spline3D

convert BSpline3D to Spline

Parameters:

Returns:

DiffsToKnots staticmethod

DiffsToKnots(degree: int, startVal: float) -> VecDoubleList

convert knots differences vector to knot vector (size of vector is increased by 1)

Parameters:

  • degree (int) –

    degree of BSpline owning the knots

  • startVal (float) –

    start of parameter interval (returned by knotsToDiffs())

Returns:

  • VecDoubleList

    vector of differences converted to vector of knots

GetControlPointIndex

GetControlPointIndex(param: float) -> int

calculate control point index from parameter on B-Spline

Parameters:

  • param (float) –

    parameter on BSpline

GetPoints staticmethod

GetPoints(
    bSpline: BSpline3D, allInterPoints: bool
) -> tuple[Point3DList, Point3DList]

provide interpolated and control points of BSpline

Parameters:

  • bSpline (BSpline3D) –

    source BSpline

  • allInterPoints (bool) –

    if false, the first and the last interpolated points are excluded, if they match with control points

Returns:

InsertKnot

InsertKnot(param: float, numInsertionsMultiplicity: int)

Insert knot into bspline knot vector (compute new control points, preserve geometry)

Parameters:

  • param (float) –

    param to insert

  • numInsertionsMultiplicity (int) –

    multiplicity of new knot

IsValid

IsValid() -> bool

Check validity of service data

Returns:

  • bool

    bool valid = true

KnotsToDiffs staticmethod

KnotsToDiffs(degree: int, periodic: bool) -> tuple[float, VecDoubleList]

convert knots vector to knot differences vector (size of vector is decreased by 1)

Parameters:

  • degree (int) –

    degree of BSpline owning the knots

  • periodic (bool) –

    true if bspline is periodic (or closed for degree == 1)

Returns:

  • tuple[float, VecDoubleList]

    tuple(BSpline parameter interval start, vector of knots converted to vector of differences)

MergeKnots staticmethod

MergeKnots(
    newknots: VecDoubleList, newknotMultiplicities: VecSizeTList
) -> tuple[VecDoubleList, VecSizeTList]

merge knot values with their multiplicities into input vector

Parameters:

Returns:

MoveStartPeriodic

MoveStartPeriodic(startParam: float)

Move start point in periodic BSpline

Parameters:

  • startParam (float) –

    start value for knot interval

PointModification

PointModification(
    pointsIdx: VecSizeTList,
    moveVector: Vector3D,
    isInterpolated: bool,
    hSet: HealingSettings,
)

move interpolated or control point of B-Spline

Parameters:

  • pointsIdx (VecSizeTList) –

    point indexes

  • moveVector (Vector3D) –

    move vector

  • isInterpolated (bool) –

    true if wanted to handle interpolated points

  • hSet (HealingSettings) –

    healing settings

RefineKnots

RefineKnots(knotvalues: VecDoubleList, knotMultiplicities: VecSizeTList)

Refine knots (insert knots if necessary)

Parameters:

RemoveControlPoint

RemoveControlPoint(pointIdx: int)

remove control point from B-Spline

Parameters:

  • pointIdx (int) –

    point index to remove

ScaleKnots staticmethod

ScaleKnots(newStartParam: float, newEndParam: float) -> VecDoubleList

Scale knot vector to new interval

Parameters:

  • newStartParam (float) –

    new interval start

  • newEndParam (float) –

    new interval end

Returns:

SetControlPoint

SetControlPoint(pointIdx: int, newCoords: Point3D)

set coordinates of control point of B-Spline

Parameters:

  • pointIdx (int) –

    point index

  • newCoords (Point3D) –

    new coordinates of point

SetDegree

SetDegree(degree: int)

set degree of B-Spline

Parameters:

  • degree (int) –

    new degree for B-Spline

SetInterpolatedPoint

SetInterpolatedPoint(pointIdx: int, newCoords: Point3D)

set coordinates of interpolated point of B-Spline

Parameters:

  • pointIdx (int) –

    point index

  • newCoords (Point3D) –

    new coordinates of point

SetPeriodic

SetPeriodic(periodic: bool)

set/unset periodic property of B-Spline

Parameters:

  • periodic (bool) –

    it true, B-Spline will be periodic, otherwise B-Spline will be open

SplineToBSpline staticmethod

SplineToBSpline(spline: Spline3D) -> BSpline3D

convert Spline3D to BSpline

Parameters:

Returns:

__init__ overloaded

__init__(bSpline: BSpline3D)

Constructor

Parameters:

__init__(element: BSpline3DService)

Copy constructor

Parameters:

Placeholder