mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-20 23:52:23 +00:00
de28406287
* STEP import: a spline's control points that step back within the tolerance are moved onto their neighbours
A spline surface whose control net, or an edge curve whose control polygon, steps back on
itself by a fraction of the file's tolerance (an exporter's refinement leaves such wiggles)
failed the kernel's check ("Bad NonMonotonic CPts" on the surface, "Bad CurveCusp" on the
pcurve made from the curve), and every operation on the part was refused. The reader now
moves such a step's inner point onto its neighbour when it adds the face or edge: a step
that turns back more than the check's 170 degrees on the step before it, is shorter than
that step and no longer than the tolerance. With positive weights the shape moves by at
most that step. A curve's and a surface's end points never move; steps within the rounding
of their points, and a polygon that really runs back, are left as they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* STEP import: an unfolded spline point stays within the tolerance of where the file had it, and a run back to a polygon's end is moved onto it
Review of the first version: a point a surface row and its column both moved could end
farther than the tolerance from its original place, and a run of steps back to a polygon's
last point was moved one point at a time, which left a step back behind. Every move is now
bounded against the line as the file wrote it, and a run back to the end is moved onto the
end point together. Tests from the review's two examples.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: bherbruck <brennen.herbruck@gmail.com>
STEP regressions
STEP files that once broke an import, kept so the import stays fixed. Each is written by SolidCraft from public commands, or entity by entity from formulas; none comes from another program.
| File | Made by | What it holds |
|---|---|---|
rod_doubled_edge.step |
SolidCraft main (edf57cec), the commands of #4598: a Ø40 × 60 rod, a Ø8 cross bore cut 15 deep, the rod moved 100 mm, exported |
The bore's rim exported as a B-spline of 1 399 control points running back and forth across the bore: before #4598 a moved edge's tolerance grew with the move. The triangulator's assertion lost the body on import (#4031, #4598). |
tiny_rounds_coarse_tolerance.step |
Written entity by entity from formulas | Three faces of radius 0.05 mm (a pin's quarter round, a corner ball, a quarter torus round a rim) in a file of 0.1 mm uncertainty, as an exporter writing a coarse tolerance gives them. A collapse test that took a surface thinner than the tolerance for a pole refused all three, and an enclosure lost 887 faces of its connectors. |
cylinder_spline_rims.step |
Written entity by entity from formulas | A cylinder of radius 10 and height 5 whose rims are closed rational cubic B-splines of two pieces, each an exact half circle, and no seam edge. A piece reaching half a turn about the axis was taken to reach every angle, so the wall had no angle left for its seam and was left out of the part. |
cylinder_rim_off_its_wall.step |
Written entity by entity from formulas | A cylinder of radius 10 and height 5 whose upper rim is a circle of radius 10.0002, 0.2 µm outside the wall, in a file stating 0.01 µm, the rims' vertices half a turn apart and no seam edge. The seam added from one rim to the other ends 0.2 µm off the cylinder; held to the file's uncertainty it was refused, and the wall was left out of the part. |
thread_crest_band.step |
Written entity by entity from formulas | One cylinder face of radius 3 from a circle at z = 3 down to a helical groove a quarter turn wide that winds two turns up from z = 0, its helices cubic B-splines (a thread's crest as a cap screw's major-diameter cylinder is written). The face's loop round the groove reaches every angle more than once, so no angle was clear for the seam joining it to the circle, and the face was left out (#16930). |
block_edge_off_its_face.step |
Written entity by entity from formulas (lifted_bezier_block(2e-3) in crates/kernel/src/step_in/tests.rs, which checks the file is its output) |
A 20 × 30 × 10 mm block whose 12 edges are straight cubic Béziers, one of them split 1 µm from its start, with that edge's curve lifted 2 µm off the bottom face. The reader gives the two edges on it the gap as their tolerance; SMLib takes the part, but its check refuses those tolerances. The import said nothing, and every boolean on the part was refused later (#17689). |
torus_patch_and_rest.step |
SolidCraft 0.30.1, solid.torus (R 12, r 2), exported |
The torus as two faces on their own TOROIDAL_SURFACEs sharing one loop: a patch a third of the way round and half way round the tube, and the rest of the torus round it, whose loop runs clockwise. The rest was read as the patch turned over: the solid came in closed with no volume (#17930). |
torus_patch_and_rest_revolved.step |
SolidCraft 0.30.1, torus_patch_and_rest.step inserted and exported again |
The same torus with both faces on SURFACE_OF_REVOLUTIONs of a 9-point rational circle. The rest face got no pcurves ("flat arrays") and the torus came in open (#17929). |
hole_round_revolved.step |
SolidCraft 0.30.1, a 30 × 30 × 10 box less a Ø14 cylinder, its top hole edge rounded at 1 mm, exported, inserted and exported again | The round on a SURFACE_OF_REVOLUTION of a rational circle. Its face got no pcurves and the block came in open (#17929). |
net_steps_back_within_tolerance.step |
Written entity by entity from formulas (a tetrahedron) | A tetrahedron A(0,0,0) B(10,0,0) C(0,10,0) D(0,0,10), uncertainty 1e-3 mm, whose face A B D is a flat spline of degree 1 by 3 whose two control columns each step back 0.5 µm along their side (as an exporter's refinement leaves them). SMLib's check failed it on "Bad NonMonotonic CPts" and refused every operation on it. |