Repository navigation
Nurbforge 0.6.0
Fixed (found by the new Boolean stress test, benchmarks/stress.cpp)
split(face arrangement) dropped regions thinner than 1e-4 of the parameter domain (its
region probe was nudged by a fixed 1e-4): a box face overlapping a cylinder by 1e-5 gave open
Boolean results. The probe is now the midpoint of an inward ray to the first crossing of the
cycle. Touching runs of intersection curves along a face boundary are recognised within the
tolerance instead of 10 tolerances (a 1e-5 circle segment was taken for a touching run).- Curve/surface intersection of a curve running just off a surface (a line next to a tilted
plane, the patch boundary next to a line of contact between a cylinder and a rotated box
face) subdivided down to the size limit along the whole curve and took minutes; the signed
distance is now scanned and its sign changes refined by bisection. - Intersection curves touching a domain edge: the two ends at the touching point may overlap
slightly (their position along the tangent is only determined to ~sqrt(2 r tol)) and are now
joined as well (cylinder inside a rotated box touching two sides). TrimmedSurface::containsdecided near curved trim loops by the loop's polygon (a trim circle
deviates from its 64-gon by 6e-4): intersection curves ending on a trim circle were clipped
short, their cuts did not reach the loop and the face was not split (e.g. a box cutting a
cylinder lid). Within the chord-deviation band the side is now decided on the exact curve.closest_pointon surfaces split degenerate patches at poles below the parametric resolution
and threw ("split: parameter … is not inside"); a direction that is too narrow is no longer
split (also for curves).- Surface/surface intersection: the pole-jump detection (0.5.x) also fired for ordinary long
steps on small faces and cut straight intersection lines short; a jump must now exceed the
predicted parameter change.
Added
- Slicing of B-rep shells (
analysis/shell_section.hpp, Pythonsection,critical_heights,
is_extrusion_band):section(shell, plane)returns closed loops of section pieces (one per face
crossing, clipped to the trimmed region, chained within the join tolerance), oriented with the
solid on the left (outer loops counter-clockwise, voids clockwise), with the signed area, the
source face, its p-curve and the outward normal at every point. Faces whose height along the
normal depends on one parameter (extrusions, revolutions about the normal, planes) give exact
isoparametric curves; others are traced to 1e-9 of the model size.critical_heightsfinds
vertices, planar faces normal to the direction and the height extrema on faces (Newton) and
edges;is_extrusion_bandchecks a band for walls parallel to the direction. Tests: box, cylinder,
sphere, frustum, torus (both axis directions), box with a spherical cavity, tilted traced section,
concurrent queries (ThreadSanitizer CI job). - STEP: length unit micrometre (
StepLengthUnit::Micrometre,SI_UNIT(.MICRO.,.METRE.), Python
unit="um") for writing and reading; shell names (StepOptions::shell_names, Pythonnames=)
written as solid names and read back byread_step_named/from_step_named(Python: lists of
(name, Shell); fallback: the product name);StepReadOptions::file_unit_metresreports the
length unit declared in the file. - Booleans with tangential contacts: spheres touching at a point (outside, inside, on the seam,
at a pole), spheres and cylinders touching box faces along a point or a line, a cylinder
inside a box touching two of its sides and two cylinders side by side give closed results
with exact volumes (tests[tangent]). The surface/surface intersection reports touching
contacts as points (micrometre curves around a contact on a seam, fragments along a line of
contact between curved surfaces) and joins curves that touch a domain edge; the Boolean
classifies touching faces at an interior point clear of the contact and ignores intersection
curves that only touch a face boundary. - Booleans: overlaps thinner than the tolerance count as contacts (the face pair is not cut when
its intersection curves bound a lens thinner than the tolerance), e.g. two spheres
overlapping by 1e-7 give two touching lumps and an empty intersection. - Boolean stress test: six families with exact tangential contact (
nf_stress 20 touch). - Native STEP reader:
read_step(path)/from_step(text)(C++io/step.hpp, Python
nf.read_step(path, unit=...), LLM toolimport_step) return oneShellper
MANIFOLD_SOLID_BREP/BREP_WITH_VOIDS/ surface-model shell. Part 21 parser (complex
instances, typed parameters, comments); B-spline curves and surfaces (also rational, Bézier,
(quasi-)uniform);PLANE,CYLINDRICAL_SURFACE,CONICAL_SURFACE,SPHERICAL_SURFACE,
TOROIDAL_SURFACEas exact NURBS patches covering the face;LINE,CIRCLE,ELLIPSE,
HYPERBOLA,PARABOLA,POLYLINEedges (also viaSURFACE_CURVE/SEAM_CURVE/
TRIMMED_CURVE). Trim loops are rebuilt in each face's parameter space (exact for planes,
otherwise projection + interpolation verified to tolerance / 10, with seams, poles and loops
around closed surfaces). Length units (SI prefixes, inch) are converted to the requested unit.
Round trips of the writer's output reproduce volumes to < 1e-6; OCC-written boxes, cylinders,
cones, spheres, tori, drilled and filleted boxes match the exact volumes. Shell::sewrejects curve pairs by control-point bounding boxes before projecting (sewing the
26 faces of a filleted box: 7.7 s → 0.4 s).- Boolean stress test
nf_stress(seven surface families, volume-identity oracle; ctest
stress_smoke). - Surface/surface intersection: the boundary seeds of the leaf patch pairs (90 % of the time)
are computed on all hardware threads and merged in sequential order (identical results);
two spheres 174 → 77 ms, two-sphere Boolean 351 → 240 ms. The core library links
Threads::Threads. - LLM constraint solving: tool
solve– a recipe of tool calls with unknowns ("$r",
"${2*r}", whitelist expression interpreter), bounds and targets on measured properties; a
bounded Levenberg–Marquardt iteration re-runs the recipe in a scratch workspace and executes
it for real once the targets are met (nurbforge.llm.constraints). The system prompt tells
the model to use it for indirectly given dimensions. - Bodies with several shells:
Shell::components()(PythonShell.components());oriented()
orients closed components by nesting depth, so voids keep inward normals (hollow solids have
the correct volume and work as Boolean inputs; lumps of a Boolean result are separate
components).
Fixed
oriented()of a shell with several components only checked the sign of the total volume,
so the relative orientation of the components (e.g. solid and void) was arbitrary.- Surface/surface intersection through the poles of a surface of revolution (e.g. a plane through
a sphere's axis): boundary points at a pole took an arbitrary parameter, which generated
spurious knot-line points and made the fitted curve run back and forth (wrong Booleans); pole
end points now continue the neighbouring parameter and lie exactly on the boundary; marching
steps against the direction of travel are rejected and a collapsing step next to a pole ends
on it; corrected midpoints must lie between their neighbours. - Trim curves running along a knot line of the surface (e.g. such meridians) no longer produce a
crossing at every rounding-level sign change (zero-length pieces inboundary_curves). - Face splitting: curve ends merged into one vertex are moved onto it, so curves meeting within
the merge distance (e.g. at a pole) form exactly closed loops.
Install
Binary wheels for Linux (manylinux_2_28 x86_64) and Windows (win_amd64), CPython 3.10-3.13, and the sdist are attached, e.g.
pip install nurbforge-0.6.0-cp312-cp312-win_amd64.whl