Skip to content
ForCADDocumentation

infer_knot_shape Interface

public interface infer_knot_shape

Infer directional control counts from flattened tensor-product knot data.


Module Procedures

private pure subroutine infer_knot_shape_2d(knot1, knot2, ncp, degree, nc, ok)

Infer a two-dimensional degree and control-net shape from knot lengths.

Candidates satisfy and . The first candidate uses , where is the exact run length of the first knot. If that candidate is valid, it takes precedence; this is the usual open-clamped inference and no ambiguity search is performed. Otherwise, all degrees are searched and ok is true only for exactly one valid candidate. Ignore degree and nc when ok is false; after an ambiguous search they can retain the first candidate found.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot1(:)

Directional knot vectors.

real(kind=rk), intent(in), contiguous :: knot2(:)

Directional knot vectors.

integer, intent(in) :: ncp

Flattened control-point count.

integer, intent(out) :: degree(2)

Inferred degrees and control counts; meaningful only when ok is true.

integer, intent(out) :: nc(2)

Inferred degrees and control counts; meaningful only when ok is true.

logical, intent(out) :: ok

True for a valid preferred candidate or a unique fallback candidate.

private pure subroutine infer_knot_shape_3d(knot1, knot2, knot3, ncp, degree, nc, ok)

Infer a three-dimensional degree and control-lattice shape from knot lengths.

Candidates satisfy and . The exact first-knot run lengths first define the preferred open-clamped candidate . A valid preferred candidate is returned without an ambiguity search. If it is invalid, exhaustive search succeeds only when exactly one candidate is valid. Ignore degree and nc when ok is false.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot1(:)

Directional knot vectors.

real(kind=rk), intent(in), contiguous :: knot2(:)

Directional knot vectors.

real(kind=rk), intent(in), contiguous :: knot3(:)

Directional knot vectors.

integer, intent(in) :: ncp

Flattened control-point count.

integer, intent(out) :: degree(3)

Inferred degrees and control counts; meaningful only when ok is true.

integer, intent(out) :: nc(3)

Inferred degrees and control counts; meaningful only when ok is true.

logical, intent(out) :: ok

True for a valid preferred candidate or a unique fallback candidate.