Skip to content

Five knot-splitting spellings duplicate two canonical entry points, and only the canonical ones are usable #562

Description

@gsdali

Does not gate the next release. Found in the #480 census, deliberately left out of PR #561 to keep
that fix to the continuity vocabulary.

What

GeomConvert_BSplineSurfaceKnotSplitting and Geom2dConvert_BSplineCurveKnotSplitting are each
wrapped twice, by two families added three releases apart, which nothing has ever reconciled:

OCCT class canonical duplicate (v0.105.0)
GeomConvert_BSplineSurfaceKnotSplitting Surface.knotSplitting(uContinuity:vContinuity:) (counts + parameters, #403) Surface.bsplineKnotSplitsU(continuity:), bsplineKnotSplitsV(continuity:), bsplineKnotSplitValues(continuity:)
Geom2dConvert_BSplineCurveKnotSplitting Curve2D.splitIndicesAtDiscontinuities(continuity:) Curve2D.bsplineKnotSplits(continuity:), bsplineKnotSplitValues(continuity:)

Five Swift methods over five bridge functions (OCCTBSplineSurfaceKnotSplitsU/...V/
OCCTBSplineSurfaceKnotSplitValues, OCCTBSplineCurve2dKnotSplits,
OCCTBSplineCurve2dKnotSplitValues), all reaching the same two analyzers as the canonical pair.

The duplicates are strictly weaker, not differently useful:

  • The two bsplineKnotSplits* count methods return exactly uSplitCount/vSplitCount and the
    canonical array's .count.
  • Curve2D.bsplineKnotSplitValues returns the identical indices splitIndicesAtDiscontinuities
    returns, as [Int32] and empty rather than nil. PR fix(#480): one continuity vocabulary for the whole knot-splitting family, and the order it could not spell #561 added a test asserting they agree at
    every continuity, so this one is measured, not assumed.
  • Surface.bsplineKnotSplitValues is the only one carrying anything the canonical call does not:
    knot-table indices rather than parameters. Those resolve through bsplineUKnot(index:) /
    bsplineVKnot(index:), so nothing is unreachable without it, and the global function they exist
    to feed (GeomConvert::SplitBSplineSurface) is not wrapped.
  • Surface.bsplineKnotSplitValues also constructs the analyzer three times per call (once per
    count method, once for the values), where the canonical call constructs it once.

Both duplicates take one continuity for both parametric directions where the canonical surface call
takes one per direction, so they cannot express a question the canonical one can.

Fix

Refs #480, #403, #377.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiphase:1bPass 1b — C++ bridge header duplication audit (#381)priority:P2NormalrefactorPart of the #377 codebase/docs duplication-audit efforttype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions