github gumyr/build123d v0.12.0

5 hours ago

Breaking Changes

  • APIs deprecated in earlier releases have been removed by @gumyr in a1d4f223.
    • The tangent objects ArcArcTangentArc, ArcArcTangentLine, PointArcTangentArc and PointArcTangentLine are replaced by ConstrainedArcs and ConstrainedLines
    • Face.make_plane() by Face(Plane); Shape.is_planar_face by Face.is_planar; Shape.split_by_perimeter by the Face/Shell method
    • Vector.to_tuple, Vertex.to_tuple, Location.to_tuple, Location.to_axis, Axis.to_plane, Edge.to_axis, Edge.to_wire, Wire.to_wire, Face.to_arcs, Shape.relocate and the LocationEncoder JSON helper are gone; the end_angle and angular_direction parameters of the center arcs are replaced by arc_size; and the is_inkscape_label parameter of import_svg is removed.
  • Unit is now a StrEnum whose values are the unit symbols (Unit.MM == "mm"), as part of the materials work by @bernhard-42 in #1270.

Compatibility Notes

These are compatibility-related changes that users should review. They are not necessarily all breaking changes.

  • Builders are refactored around a unified BuildScope: they construct in a local coordinate system on Plane.XY and publish their result through the enclosing placement, so a builder can now be positioned by an enclosing Locations context, and objects created inside custom Base*Object classes no longer leak into the caller's builder by @gumyr in #1373.
  • Select.LAST and Select.NEW now come from the kernel's own history of the operation rather than a before/after comparison, so a face an operation merely trimmed no longer counts as new, and Select.NEW works for every shape type and on the result of Algebra operations too. Select.LAST and others also now work with all shape types now, and not only edges as before. Builder.new_edges is deprecated in favor of edges(Select.NEW) by @gumyr in 1a7751a1 and 86952b27.
  • The builder operation add() is renamed insert(); add() remains as a deprecated wrapper by @gumyr in 51f251b8.
  • BoundBox.is_inside() is deprecated in favor of BoundBox.within(), BoundBox.find_outside_box_2d() in favor of BoundBox.contains(), and BoundBox.intersects() is back to tolerance-aware contact semantics while overlaps() stays the strict interior test by @gumyr in 0147c20d and 8a825f5d.
  • ExportSVG accepts ColorLike values everywhere and inherits colors from faces, edges and wires; ColorIndex values, ezdxf RGB values and 0-255 RGB tuples are deprecated by @gumyr in 279f7b15.
  • Face.location_at now respects the face's orientation, so a reversed face returns a location whose z axis matches normal_at by @cycsmail in #1352.
  • The 2D exporters report a non-planar shape with warnings.warn instead of printing to stdout, and pack raises errors instead of failing assertions by @gumyr in fa75e6d6.
  • Shape.cast is one registry-backed implementation for every dimension, so Mixin2D.cast(solid) returns a Solid where it used to raise by @gumyr in f22736a1.
  • bd_materials, threejs-materials and fontTools are new dependencies by @bernhard-42 in #1270 and @kforris in #1395.

Notable Changes

  • Added materials: Shape.material takes a bd_materials material or its name (shape.material = "brass"), Shape.mass, compute_mass and compute_volume use it, export_gltf writes the material's visual properties, and a materials tutorial explains the workflow by @bernhard-42 in #1270; Compound.mass sums each child's own material by @gumyr in c1637160.
  • Added Convexity (CONVEX, CONCAVE, SMOOTH, SADDLE) as a property of every Vertex, Edge and Face relative to the shape it was selected from, usable with filter_by and group_by, together with topo_path, the route a shape was selected by, by @gumyr in 2440c53c and 7511588d.
  • Unified the builder scope model so BuildPart, BuildSketch and BuildLine share one placement and publication path and can be placed by Locations contexts by @gumyr in #1373.
  • Added UV texture coordinates: Shape.tessellate_with_uvs() with optional atlas packing, a new export_obj() exporter, and UVs in export_gltf for texture, baking and displacement workflows by @zalo in #1272.
  • Added support for lofting faces with more than one inner wire, with the path between holes chosen automatically by @MatthiasJ1 in #449.
  • Added the Superellipse sketch object, covering squircles and rounded rectangles by @Silcantar in #1398.
  • Added Rotation(Axis, angle) construction by @DaWeidmann in #1262.
  • Added BoundBox(shape) construction, and bounding boxes of coplanar and collinear shapes now compare on their non-degenerate axes by @DaWeidmann in #1313 and @gumyr in 30268618 and 0147c20d.
  • Added Builder.label, which propagates to the builder's output object by @kforris in #1424.
  • Improved 2D filleting: fillet_2d handles fillets that consume whole edges, the 2-tangent radius arc solver is more stable, and the OCCT ChFi2d fillet algorithm is replaced by @javimixet in #1341.
  • Location multiplication now applies to iterables of shapes and planes, and Locations accepts iterators such as generators and map by @gumyr in e7652c64 and @kforris in #1396.
  • ExtensionLine accepts a VectorLike offset, choosing the side by direction rather than sign, and DimensionLine no longer crashes when its label is wider than its path by @pzfreo in #1338 and #1336.
  • Face.make_surface_from_array_of_points(smoothing=...) now works by @gumyr in 1cb4aa48.
  • Added a build123d_type class variable to the geometry, topology and builder classes for external applications by @gumyr in e3cfdde3.
  • Documentation now ships llms.txt and llms-full.txt for language models by @marked23 in #1074, and gained a series of examples and explanations by @kforris (see below).
  • Test coverage moved from codecov to coverage.py with diff-cover, the docs examples are now tested, and every raise in the package is covered by @jdegenstein in #1377 and #1376 and @gumyr in db3fa0dc.

Selected Other Changes

  • Fixed BoundBox.is_inside by @jdegenstein in #828.
  • Fixed export_step of an imported single-shape STEP file by detaching it from its temporary wrapper by @cyberhuman in #1365.
  • Fixed the inverted bulge direction in import_dxf by @greyltc in #1372.
  • Fixed loading .ttf files that actually contain a TrueType Collection by @cycsmail in #1380.
  • Enhanced the diff-cover step of the coverage workflow by @jdegenstein in #1384 and #1438.
  • Added ArgilCAD to the external tools documentation by @turanerdem in #1386.
  • Raised FileNotFoundError for a missing STL export directory by @kforris in #1389.
  • Completed the builder cheat sheet by @kforris in #1391.
  • Preserved labels for 3MF assembly children by @kforris in #1397.
  • Warned when Plane ignores origin while being built from a Face by @kforris in #1399.
  • Clarified constrained geometry terminology in the docs by @kforris in #1400.
  • Added a positioned sketch example by @kforris in #1401.
  • Documented Draft configuration by @kforris in #1402.
  • Added a rotation methods example by @kforris in #1404.
  • Documented vectorized location operations by @kforris in #1405.
  • Added ExportToPython to the external tools documentation by @RanVisionware in #1406.
  • Explained mixing builder and algebra modes in the docs by @kforris in #1408.
  • Deferred FontManager initialization until fonts are needed, so import build123d no longer scans system fonts by @kforris in #1413.
  • Text.font and Text.font_path now report the font OpenCascade actually resolved by @kforris in #1415.
  • Skipped documentation builds for pull requests without documentation changes and moved them to Python 3.11 by @jdegenstein in #1416.
  • Documented out-of-range curve position behavior by @kforris in #1417.
  • Documented local and global assembly locations by @kforris in #1419.
  • Fixed stochastic font registration test failures by @jdegenstein in #1421.
  • Added a helical spring example by @kforris in #1422.
  • Fixed the full_round return type annotation by @kforris in #1423.
  • offset_2d now raises a clear RuntimeError naming the offset when OCCT fails by @kforris in #1426.
  • Preserved colors when exporting base part objects to 3MF by @kforris in #1427.
  • Fixed through holes on parts positioned away from the origin by @kforris in #1429 and @gumyr in 3236d2bd.
  • Corrected the description of Solids and Parts as 3D shapes by @iparsrc in #1436.
  • Guarded import_step against unnamed assembly components by @atirna in #1443.
  • Fixed a regression where a Curve containing wires was not accepted as a builder argument by @gumyr in 87198852.
  • Fixed RevoluteJoint ignoring angle_reference by @gumyr in 2c5e6a0b.
  • Fixed joints inherited from the input part of a BasePartObject by @gumyr in 1f66b0c8.
  • Fixed Compound intersection after the parent has been moved by @gumyr in 217db07e.
  • Fixed Vertex.X, Y and Z of a transformed vertex by @gumyr in 4ae9e170.
  • Skipped corrupt fonts during registration, based on a proposal by @karugaru, by @gumyr in 0e7f4015.
  • Hardened the Rotation axis-angle constructor by @gumyr in 2627b6b9.

New Contributors

Thanks to the following first-time contributors:

Contributors

Thanks to everyone who contributed to this release:

@atirna, @bernhard-42, @cyberhuman, @cycsmail, @DaWeidmann, @greyltc, @gumyr, @iparsrc, @javimixet, @jdegenstein, @kforris, @marked23, @MatthiasJ1, @pzfreo, @RanVisionware, @Silcantar, @turanerdem, and @zalo.

Full Changelog

Full Changelog: v0.11.1...v0.12.0

Don't miss a new build123d release

NewReleases is sending notifications on new releases.