Skip to content

Nurbforge 0.12.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 09:07
· 23 commits to main since this release
4dc1ae6

Solids for simulation (split by a plane with labelled cut faces, cap, thicken, hollow, pipes,
defeaturing), parallel parameter studies from Python (expensive operations release the GIL,
all geometry types picklable), 2D profiles (planar region Booleans, blend curves, projection
onto surfaces), a user manual (PDF) with a generated command reference, a compact API
reference for language models and coding agents shipped in the wheel, and fixes for
Booleans through poles and seams, split with crossing cuts, closest_point at kinks,
curvature at sphere poles and the installed CMake package. The API is not yet stable (0.x).

Added

  • Compact API reference for language models and coding agents (REFERENCE.md, ~20k tokens:
    conventions, a worked example, every public function, class and LLM tool with signature and
    description), shipped in the wheel: python -m nurbforge prints it, nurbforge.reference()
    returns it; attached to the GitHub release as nurbforge-reference.md, indexed by llms.txt.
    Generated by docs/manual/gen_agent_reference.py (--check in CI and the tests).
  • 2D profiles: region_boolean(a, b, op) (union / intersection / difference of planar regions
    with exact curves; regions are loops of curves, nested loops are holes, PlanarSections are
    accepted) and region_area; blend_curves(a, end0, b, end1, continuity, tension) (G1 cubic or
    G2 quintic transition); project_curve(curve, surface, direction, tolerance) returning the 3D
    curve and its p-curve. LLM tools blend and project.
  • Parallel parameter studies in Python: the expensive operations (Booleans, plane splits, all
    solid operations, intersections, closest points, sections, offsets, sweeps, lofts, Coons and
    Gordon patches, optical surface fits, lengths, areas, volumes, mass properties, sewing) release
    the GIL, so they run in parallel threads; all geometry types (points, transforms, curves,
    surfaces, trim loops, trimmed faces, shells, planes, tolerances, options, optical sags) can be
    pickled for process pools and copy.deepcopy. Shell.tolerance() (C++) gives the sewing
    tolerance. A ThreadSanitizer test runs constructive operations concurrently.
  • split(shell, plane, tolerance=1e-6, cut_label="cut") (C++ and Python): splits a closed solid
    by a plane into the closed parts below and above; the new faces in the plane are labelled
    (e.g. for symmetry boundary conditions).
  • cap(shell, tolerance=1e-6, label="cap"): closes the planar openings of a shell with planar
    faces trimmed exactly by the opening's edges (nested openings become holes).
  • thicken(shell, thickness, symmetric=False, tolerance=1e-6, wall_label="wall"): gives an
    open, smooth shell a wall thickness (faces offset with their trim loops, ruled side walls).
  • make_pipe(path, radius, end_radius=-1) / make_pipe(path, radius_function): solid pipe
    along a path (rotation-minimising frame, constant, tapered or function radius), faces labelled
    wall, inlet, outlet; pipe_surface(path, radius_function, options) for the wall alone.
  • remove_holes(shell, max_size): defeaturing - fills through and blind holes smaller than
    max_size and deletes the faces of the removed features.
  • hollow(shell, thickness, open_labels=[]): hollows a smooth solid to a wall (inner void, or
    open at the faces with the given labels).
  • merge_faces(shell): defeaturing - merges adjacent faces with the same label on the same
    surface (pieces of a split face, coplanar planar faces) into one exactly trimmed face.
  • LLM tools for the solid operations: split_solid, cap, thicken, hollow, pipe,
    remove_holes, merge_faces.
  • User manual (LaTeX/PDF, docs/manual): installation, concepts and every part of the API in
    18 chapters with 40 tested example scripts, plus a command reference generated from the
    installed package (every class, method, property, enumeration and function of nurbforge,
    nurbforge.mesh and nurbforge.llm, and all LLM tools). python docs/manual/build.py builds
    it; CI builds it for documentation changes and attaches nurbforge-manual.pdf to every
    release. A test runs all examples and fails if a public API entry has no description.
  • TrimmedSurface.transformed(t) (loops and label kept, reflections keep the normal) and
    transform * obj for curves, surfaces and trimmed faces in Python (was shells only).
  • Python: split(face, cuts) for trimmed faces (general planar arrangement: cuts clipped to the
    face, may end on trim loops or other cuts and may cross).

Fixed

  • surface_curvature (and therefore offset_surface, thicken) threw "cannot normalize a
    zero-length vector" near the poles of (flipped) spheres: the principal-direction vector of a
    nearly umbilic point is tiny but valid there; directions are now scaled by their own length.
  • Installed CMake package: NurbforgeConfig.cmake now finds its Threads dependency
    (find_dependency), so find_package(Nurbforge) works without a preceding
    find_package(Threads), and a version file allows find_package(Nurbforge 0.9) (#67). CI
    builds a consumer project (tests/install) against the installed package on all platforms.
  • Tutorial: NumPy arrays of three numbers (e.g. rows of an (n, 3) array) are accepted as
    points; the tutorial said they were not (#70).
  • closest_point on curves and surfaces with kinks (C0 knots, e.g. polylines, rectangle
    outlines and their extrusions) could return a point on the wrong side of a corner: Newton ran
    on the whole curve and took the one-sided derivative of the next span at the segment end. It
    now runs on the Bézier segment / patch itself. This also fixes hatch(contours=...) for
    loops made of single kinked curves, which failed with "contour ... does not close" (#69).
  • split(surface, pcurves) with curves that cross or touch each other (e.g. a cross, or
    chords meeting at a corner) returned the unsplit surface; such cuts now go through the general
    planar arrangement (#68).
  • Booleans with cut planes through the poles or along the seam of a closed surface (a sphere
    minus a box with its corner at the centre; a cylinder cut along its seam line) were open with
    GCC and MSVC and closed with Apple Clang (#63). An intersection curve along a seam has its
    p-curve on the domain boundary, where the in/out test depended on the sign of rounding errors
    (FMA contraction); points on a seam now count as inside if the face covers either side of it,
    and intersection curves that repeat another one in 3D (one per side of the seam) are used once.
    A test covers all three operations; the whole C++ suite also passes with -ffp-contract=off.

Changed

  • All C++ sources are formatted with clang-format 23.1.5; CI now enforces the format (it was
    report-only).

Install

pip install nurbforge          # from PyPI; nurbforge[mesh] adds gmsh

Binary wheels for Linux (manylinux_2_28 x86_64), Windows (win_amd64) and macOS 14+ (arm64, x86_64), CPython 3.10-3.14, and the sdist are also attached below.

Documentation

nurbforge-manual.pdf: the user manual with the complete command reference of this version.
nurbforge-reference.md: the compact API reference for language models and coding agents (also python -m nurbforge).