nurbspy.jax.prepared_projection module#
Explicit fixed-geometry spatial sampling for repeated surface projection.
- class nurbspy.jax.prepared_projection.PreparedSurfaceProjection(surface: NurbsSurface, sample_parameters: Array, sampled_points: Array, samples_per_span: int = 8)[source]#
Bases:
ModuleImmutable geometry/grid snapshot, with one local solve per query.
Rebuild after changing P/W, knots, degrees or sampling density. Replacing geometry leaves alone makes cached positions stale. Query derivatives use the same exact implicit minimum equations as general surface projection. Build inside AD for geometry sensitivities; uniqueness, regularity and a stable active set are required. There is no global cache or hidden retry.
Methods
project_point(point[, maxiter, ftol, gtol, xtol])Return a parameter pair shaped (2,) for one query.
project_points(points[, maxiter, ftol, ...])Project (ndim,N) queries with the general single-start solver.
- project_point(point, maxiter=200, ftol=1e-06, gtol=1e-06, *, xtol=1e-12)[source]#
Return a parameter pair shaped (2,) for one query.
- project_points(points, maxiter=200, ftol=1e-06, gtol=1e-06, *, xtol=1e-12)[source]#
Project (ndim,N) queries with the general single-start solver.
- sample_parameters: Array#
- sampled_points: Array#
- samples_per_span: int = 8#
- surface: NurbsSurface#
- nurbspy.jax.prepared_projection.prepare_surface_projection(surface, *, samples_per_span=8)[source]#
Sample one fixed surface once for repeated query batches.
The default interior budget is eight samples per knot span/axis, with all knot boundaries included. Strong positive weight ratios inform endpoint coverage. Preparation and general projection use the identical grid and one-start solver. This does not certify global closest points on folded or poorly resolved geometry. Include preparation when assessing first-use cost.