Breaking Changes
- Operations that leave nothing now return an empty shape of the right class instead of
None, a bareCompoundor an error.BuildPart().part,BuildSketch().sketchandBuildLine().lineare neverNone(testif not builder.part, notis None),intersect()returns an emptyShapeListwhere it returnedNone, and a boolean that leaves nothing returns an emptyPart,SketchorCurve.Face.wire()on a face with holes raises instead of returning the outer wire, and exporting an empty shape raisesValueErrorby @gumyr in #1495. Plane.rotatednow takes its angles about the plane's own x, y and z directions, as its docstring said, instead of about the world axes. Planes aligned with the world axes rotate as before; for any other plane, negate the affected angles to get the old result by @gumyr in #1494.Solid(shell)raisesValueErrorfor a shell that is not closed, where it returned an invalid solid by @gumyr in a1ad7263.Face.wrapandFace.wrap_facesare rebuilt onUVFrame: theextension_factorparameter is removed, andtoleranceis now the largest 3D error of an interpolated curve by @gumyr in #1465.
Compatibility Notes
These are compatibility-related changes that users should review. They are not necessarily all breaking changes.
- Upcoming release v0.15.0 will change the kernel binding. The next release replaces the
OCPbinding withnanocct. Code that only uses the build123d API is not affected; code that callsOCPdirectly through.wrappedwill need to change, mainly where a kernel call has output parameters or writes to a stream. projectis deprecated in favor ofproject_to_planeandproject_to_shape,project_workplanein favor of thePlaneconstructor,Shape.project_to_viewportin favor ofdrawing_view, andMixin1D.projectin favor ofproject_to_shape. All keep working with aDeprecationWarningby @gumyr in #1531.SortByis deprecated: pass the shape property (Edge.length,Face.area,Solid.volume) tosort_byandgroup_by, or usesort_by_distanceby @gumyr in 6beaa619.- Renamed, with the old names kept as deprecated aliases:
DrafttoDrafting,SlotArctoSlotCurve,Solid.make_loftandShell.make_lofttoloft, andJoint.connect_totoattach(with the former now deprecated) by @gumyr in fe78a14c, dcb6c894, af82dd17 and b11fdb29. IntersectingLineis deprecated in favor ofPolarLine(start, other, direction=direction),make_brake_formedin favor ofBuildSheet,BuildPart.locationbecause a builder has no single location, andShape.is_nullin favor ofis_emptyby @gumyr in eac695eb, 624c709a, 8258bc73 and #1495.ExportDXFacceptsColorLikevalues for document and layer colors;ColorIndexvalues are deprecated by @kforris in #1440.- Tapered extrusions are now a straight extrusion followed by a draft: sharp concave corners stay sharp, sides are planes and cones where they were B-splines, and a taper that collapses the profile raises
RuntimeError.Wire.offset_2dreturns B-spline edges instead of deferred offset curves by @gumyr in #1488. extrude(until=..., taper=...)now applies the taper, which it silently dropped by @gumyr in 02a2a28d.ShapeList.filter_by(Axis)now also matches faces with an axis of rotation parallel to the axis: cylinders, cones, spheres, tori and surfaces of revolution, so a mixed list returns its holes and fillets too by @gumyr in c0fb3a89.Edge.param_at,Edge.param_at_pointandWire.param_at_pointnow measure a reversed edge or wire from the same end asposition_atby @gumyr in 12b4fbe5 and 04ca2f61.Colorcompares by value and stays hashable, andColor(0x000000)is black instead of white by @gumyr in c9dd8ea6 and @Amadeus415 in #1599.- Constrained arcs now run from the first tangency to the second by @Zedas030 in #1588 and @gumyr in 70113186.
-now returns the kind of shape it was cut from:Line - RectangleandLine - Boxare aCurve, where they were aSketchorPartholding only edges by @gumyr in d160021b.+on curves merges a curve that lies on another, where it kept both as a wire that doubled back by @gumyr in ae32652d.- Splitting a
Shellreturns aShell, or aCompoundof shells, instead of aSketch, andKeep.TOPandKeep.BOTTOMare now honoured for aShellorWireby @gumyr in 9fce9fd1 and 37fe6301. Compound.compounds()returns compounds at every depth, sovolume,massandget_typeno longer miss nested assemblies;thickenof several faces andmirrorof a part return aPartwithout an extra wrapper by @gumyr in 5a802339.import_stepreturns a shape that was exported with a location as the shape itself, not wrapped in aCompound, and keeps the punctuation of labels except for/by @gumyr in 71e5466c and 0b47f0c9 and @1915rising in #1593.drawing_viewreturns linear, circular and elliptical edges as lines, circles and ellipses where hidden-line removal gave splines, and no longer returns edges lying on one another by @gumyr in 2694ce4b and @lakshikaaswal in #1572.Shape.is_manifoldskips degenerate edges and requires consistent orientation, so a sphere, a cone and a filleted box now reportTrueandShell.volumeof a sphere's shell is no longer 0 by @gumyr in 098ada80.- Joint constructors given neither a part nor a builder return a free joint instead of raising, and joints now follow their part through
mirror,scaleand booleans by @gumyr in #1517. make_textwith a stroke width always returns aCompound; the"singleline"font is now Relief SingleLine Clean and the old font is no longer distributed; fonts of large families are registered as family plus weight by @gumyr in 7d5d514b, #1496 and 862ca94e.Shape.project_facestakes the surface normal from the faces the path lies on, so faces on a path round a bore land on the bore, and a face on a sharp edge folds over it by @gumyr in 6a290d21.scikit-learnandsympyare no longer dependencies, which roughly halves the time ofimport build123dby @gumyr in d3b12235 and 89fbd7a1.
Notable Changes
- Added sheet metal modelling: the
BuildSheetbuilder (and Algebra mode) models a constant-thickness part as a referenceShell, with theflange,hem,bend,jog,miter,bend_reliefandcorner_reliefoperations,SheetMetalParametersfor thickness, bend radius and k-factor,thickento make the solid andunfoldto develop the flat pattern, holes on bends included. Based on the proof of concept by @GabrielJMS in #1381, by @gumyr in #1434 and related commits, and @GabrielJMS in #1584. - Reworked projection:
project_to_planeandproject_to_shapereplaceproject, aHitenum (ALL,NEAREST,FARTHEST,VISIBLE) selects which surfaces a projection keeps, sketches get the true silhouette of a solid,drawing_viewreplacesproject_to_viewportand returns aDrawingViewOutputofvisibleandhiddenedges, andFace.silhouette_edgesis new by @gumyr in #1531. - Added
UVFrame, a flat coordinate system laid onto a face, withFace.uv_frame,write_edge,write_wire,write_faceandpunch: a shape drawn onPlane.XYis written into the face's parameter space and lies on the surface by construction, exactly on planes, cylinders and cones.Face.wrapandFace.wrap_facesnow work on every surface type and across seams by @gumyr in #1465. - Added
Face.offset_2d, andoffset()of a non-planar face: a face on a cylinder, cone, sphere, torus or spline surface can be grown or shrunk within its surface by @gumyr in #1595; a planar offset whose holes split the face returns every piece by @BiNeurale in #1596. - Joints are now algebra objects: a joint can be made free and placed with
*, bound by assigning intopart.joints(aJointDict) or added with+, made once per location in aLocationscontext, and it follows its part through transforms, copies and booleans by @gumyr in #1517, @Sean-yh in #1556 and @vladyr in #1490. - Every shape class now has an empty value (
Solid(),Face(),Part(),Sketch(),Curve(),Vertex()) that operations return for "nothing", withis_emptyto test for it by @gumyr in #1495. - Rebuilt
extrude(until=...): the extrusion stops at the nearest surface everywhere across a target of several faces, works from a sketch drawn on the target, and handles a profile that straddles a step by @gumyr in ab8c0198, 55e3c76b and 19f1962e. - Tapered extrusions are now made by extruding the profile and drafting its side faces, which fixes tapers that went the wrong way or returned something that was not a solid by @gumyr in #1488, building on a draft by @jdegenstein.
LocationListis now alist, and location lists compose with*:GridLocations(...) * PolarLocations(...)works as a builder context and as an Algebra placement by @gumyr in 2e637199 and 35155099.- Relocating and copying shapes no longer copies their geometry, and assemblies keep their place and their children's shared geometry when children change or the assembly is copied by @gumyr in 16c63104 and bd9ba44a and @vladyr in #1540, #1518 and #1509.
Hole,CounterBoreHoleandCounterSinkHoletake apoint_anglefor a drill point by @GabrielJMS in #1536.- Added
ShapeList.filter_by_valueto select by a measured value such asEdge.lengthorFace.radiusby @sybeeria in #1524, andGroupBy.firstandGroupBy.lastby @kforris in #1448. splitaccepts several tools at once by @gumyr in 67ff680e.- Builders gained
colorandmaterialattributes that are applied to their output, aslabelis by @gumyr in 5f9bbd91. - Added
FrameMethod.CONTINUOUS, a frame carried along aWirewithout rolling between edges, and adeflectionparameter tolocationsfor many locations on long wires by @gumyr in 6f07399a and de316731. export_brepgainedbinary,versionandtriangulationoptions, andimport_brepreads from streams by @DavidMStraub in #1555.Facecan be built on a curved surface from wires that lie on it with thesurfacekeyword, andShelltakes a sewingtoleranceby @gumyr in 96763050 and 2b1f2610.Matrixcan be built from any affine values and applied to aVectorby @gumyr in #1461.- The documentation is reorganized into Tutorials, How-to Guides, Reference and Explanation, with the tutorials rewritten as a series in both builder and algebra modes, and new pages including sheet metal, projection, geometry and topology, and a spiral ramp tutorial by @gumyr in #1585, 9c06071f and 3c5552fb.
- The open OpenCascade defects are tracked by expected-failure tests that will flag when a kernel release fixes one by @zalo in #1507.
Selected Other Changes
- Fixed
filletandchamferof an outwardoffsetwith openings by @gumyr in #1463. - Fixed
export_stepwhen exporting a child of an assembly by @slobberingant in #1458. - Propagated labels to unlabeled nested shapes in
export_stepby @cycsmail in #1459. - Supported local two-tuples in
Plane.shift_originby @kforris in #1449. - Exposed the resolved label text of
DimensionLineandExtensionLineaslabel_strby @kforris in #1450. - Fixed the
ConstrainedArcsAxisoverload annotation by @kforris in #1418. - Documented the
Part,SketchandCurvegeometry containers by @kforris in #1457. - Fixed
do_children_intersectfor nested assemblies andShape.locatedfor vertices by @vladyr in #1470. - Avoided calling
register_fonton directories fromregister_folderby @snoyer in #1472. - Placed a
Compound's children in global space before intersecting by @sparr in #1473. - Fixed mangled non-ASCII labels in glTF and STEP export by @wstates in #1476.
Wire.edges()now reports every edge of a branching wire by @zalo in #1479.- Kept the holes of a face when chamfering its corners by @zalo in #1482.
- Documented that fillets propagate along tangent edge chains by @zalo in #1483.
- Made the font and glTF material tests safe under xdist by @zalo in #1484.
- Made the order of de-duplicated
ShapeListresults deterministic by @Erfouni in #1489. - Skipped faces without triangulation in
Shape.tessellateby @yeicor in #1519. - A failed 3D fillet now names the faulty edges by @sybeeria in #1525.
- Closed the XCAF document created by each STEP and glTF export by @theluckystrike in #1526.
- Added
normalize=Falsetoparam_at_pointfor native curve parameters by @RanaPriyansh in #1530. - Kept a vertex's location when it is copied by @vladyr in #1538.
- Added GitHub edit links to the documentation by @kforris in #1539.
- Added a regression test for STEP profiles inserted into a sketch by @alteralto in #1546.
- Fixed argument names in docstrings to match signatures by @mmporong in #1553.
- Fixed pytest version constraints and the macOS runner by @jdegenstein in #1557 and #1566.
- Fixed
JernArcstart tangents for negative full turns by @RanaPriyansh in #1558. - Added
Vector.is_parallel,is_normalandis_oppositeby @LiShuochen in #1561. - Fixed
import_dxffor SOLID, TRACE and 3DFACE entities by @fixfon in #1564. make_hullandWire.make_convex_hullaccept vertices by @lucas-santos-f in #1567.- Made
Wirekeep the first of near-coincident end vertices by @usman7384 in #1573. fillet_2dfailures are reported in the original vertex coordinates by @javimixet in #1574.- Fixed fractional inch labels for whole lengths by @fixfon in #1576.
- Gave
Shape's type parameter a default so a bareShapereads asShape[Any]under pyright by @restlessronin in #1577. - Fixed two typos in the docs by @jeis4wpi in #1579.
- Added
interior_edgestoFace.make_surface_patchby @lucas-santos-f in #1580. - Made
Curve.wire()agree withCurve.wires()by @sahilmaniyar888 in #1589. - Added text-to-cad to the external tools documentation by @earthtojake in #1590.
- Transformed a
BoundBoxas a whole when aPlanerelocates it by @Amadeus415 in #1598. - Mentioned the caret operator (
^) across docs and docstrings by @lyn1dev in #1603. - Preserved the SVG circular arc sweep in generated
BuildLinecode by @aevumworks in #1604. sweep,revolveandloftnow clean the shapes they return inside a builder by @gumyr in 8c1ecc64.- A custom object unwraps to a
Part, not to a new object of its own class by @gumyr in e22d34da. - Each font of a collection file, and each named instance of a variable font, is registered as its own face by @gumyr in 1def87ed.
- The mesher reports faces it cannot triangulate instead of crashing, and a null offset result raises instead of segfaulting by @gumyr in dd23d714 and 6b807669.
- Shapes that carry a history record can be pickled by @gumyr in 2aec5679.
- Fixed
project_to_planeof a straight edge tilted to the plane by @gumyr in f2695861. - Fixed
Hit.VISIBLEprojection onto a sphere seen just off its equator by @gumyr in 440f2c0b. - Refused sweep profiles with a degenerate edge, and warned when a sweep creates an invalid solid by @gumyr in 64c95b76 and 1e44a969.
New Contributors
Thanks to the following first-time contributors:
- @GabrielJMS made their first contribution in #1381
- @sparr made their first contribution in #1473
- @wstates made their first contribution in #1476
- @vladyr made their first contribution in #1470
- @deximple made their first contribution in #1499
- @Erfouni made their first contribution in #1489
- @sybeeria made their first contribution in #1524
- @theluckystrike made their first contribution in #1526
- @alteralto made their first contribution in #1546
- @mmporong made their first contribution in #1553
- @RanaPriyansh made their first contribution in #1530
- @Sean-yh made their first contribution in #1556
- @fixfon made their first contribution in #1564
- @LiShuochen made their first contribution in #1561
- @jeis4wpi made their first contribution in #1579
- @Zedas030 made their first contribution in #1588
- @earthtojake made their first contribution in #1590
- @lakshikaaswal made their first contribution in #1572
- @lucas-santos-f made their first contribution in #1567
- @restlessronin made their first contribution in #1577
- @usman7384 made their first contribution in #1573
- @Amadeus415 made their first contribution in #1598
- @1915rising made their first contribution in #1593
- @lyn1dev made their first contribution in #1603
- @sahilmaniyar888 made their first contribution in #1589
- @BiNeurale made their first contribution in #1596
- @aevumworks made their first contribution in #1604
Contributors
Thanks to everyone who contributed to this release:
@1915rising, @aevumworks, @alteralto, @Amadeus415, @BiNeurale, @cycsmail, @DavidMStraub, @deximple, @earthtojake, @Erfouni, @fixfon, @GabrielJMS, @gumyr, @javimixet, @jdegenstein, @jeis4wpi, @kforris, @kmanoochehri1978-dev, @lakshikaaswal, @LiShuochen, @lucas-santos-f, @lyn1dev, @mmporong, @RanaPriyansh, @restlessronin, @sahilmaniyar888, @Sean-yh, @slobberingant, @snoyer, @sparr, @sybeeria, @theluckystrike, @usman7384, @vladyr, @wstates, @yeicor, @zalo, and @Zedas030.
Full Changelog
Full Changelog: v0.13.0...v0.14.0