diff --git a/src/cpp/bindings/python/bind_ops_features.cpp b/src/cpp/bindings/python/bind_ops_features.cpp index 9f10e1a7..383961f8 100644 --- a/src/cpp/bindings/python/bind_ops_features.cpp +++ b/src/cpp/bindings/python/bind_ops_features.cpp @@ -462,7 +462,8 @@ void bind_derived(py::module_& m) { return unlocked(selection.is_selector(), [&] { return inset_face_rsolid(solid, selection, distance); }); }, py::arg("solid"), py::arg("face"), py::arg("distance"), - "Imprint the loops of one planar face moved a distance inside it, splitting the face in an inner face and a ring."); + "Imprint the loops of one planar face moved a distance inside it, splitting the face in an inner face and a " + "ring."); m.def( "extrude_taper_rsolid", diff --git a/src/cpp/src/ops/features/extrusion.cpp b/src/cpp/src/ops/features/extrusion.cpp index 32ff3c39..e46225ec 100644 --- a/src/cpp/src/ops/features/extrusion.cpp +++ b/src/cpp/src/ops/features/extrusion.cpp @@ -88,7 +88,8 @@ Solid press_pull_rsolid(const Solid& solid, const FaceSelection& face, const Sca throw ValueError("press_pull takes exactly one face, got " + std::to_string(resolved.size())); const Face target = resolved.front(); const std::vector own_faces = solid.faces(); - if (std::none_of(own_faces.begin(), own_faces.end(), [&](const Face& f) { return f.wrapped().IsSame(target.wrapped()); })) + if (std::none_of(own_faces.begin(), own_faces.end(), + [&](const Face& f) { return f.wrapped().IsSame(target.wrapped()); })) throw ValueError("the face must belong to the input solid"); if (occt_guard([&] { return BRepAdaptor_Surface(TopoDS::Face(target.wrapped())).GetType(); }) != GeomAbs_Plane) throw ValueError("press_pull needs a planar face"); diff --git a/src/cpp/src/ops/features/offsets.cpp b/src/cpp/src/ops/features/offsets.cpp index 334badf8..465e58b5 100644 --- a/src/cpp/src/ops/features/offsets.cpp +++ b/src/cpp/src/ops/features/offsets.cpp @@ -189,7 +189,8 @@ Solid inset_face_rsolid(const Solid& solid, const FaceSelection& face, const Sca throw ValueError("inset_face takes exactly one face, got " + std::to_string(resolved.size())); const Face target = resolved.front(); const std::vector own_faces = solid.faces(); - if (std::none_of(own_faces.begin(), own_faces.end(), [&](const Face& f) { return f.wrapped().IsSame(target.wrapped()); })) + if (std::none_of(own_faces.begin(), own_faces.end(), + [&](const Face& f) { return f.wrapped().IsSame(target.wrapped()); })) throw ValueError("the face must belong to the input solid"); const TopoDS_Face source = TopoDS::Face(target.wrapped()); if (occt_guard([&] { return BRepAdaptor_Surface(source).GetType(); }) != GeomAbs_Plane) diff --git a/src/cpp/src/ops/geometry/executors.cpp b/src/cpp/src/ops/geometry/executors.cpp index ed60b703..405b5162 100644 --- a/src/cpp/src/ops/geometry/executors.cpp +++ b/src/cpp/src/ops/geometry/executors.cpp @@ -192,10 +192,10 @@ void register_primitives(reactive::ExecutorRegistry& registry) { // The workplane constructors make a value, not a shape: like the product values, they have nothing to // recompute here (a model-JSON replay rebuilds the frame from the recorded inputs). void register_workplanes(reactive::ExecutorRegistry& registry) { - for (const char* operation : {"make_workplane_rworkplane", "make_workplane_from_face_rworkplane", - "make_workplane_from_points_rworkplane", "make_workplane_from_axis_rworkplane", - "make_workplane_midplane_rworkplane", "make_workplane_normal_to_curve_rworkplane", - "make_workplane_offset_rworkplane"}) { + for (const char* operation : + {"make_workplane_rworkplane", "make_workplane_from_face_rworkplane", "make_workplane_from_points_rworkplane", + "make_workplane_from_axis_rworkplane", "make_workplane_midplane_rworkplane", + "make_workplane_normal_to_curve_rworkplane", "make_workplane_offset_rworkplane"}) { registry.add(operation, [](Params, Inputs, const ScalarValues&) { return std::vector{}; }); } } diff --git a/src/cpp/src/ops/geometry/workplanes.cpp b/src/cpp/src/ops/geometry/workplanes.cpp index 4e5b5adb..50c6ecbc 100644 --- a/src/cpp/src/ops/geometry/workplanes.cpp +++ b/src/cpp/src/ops/geometry/workplanes.cpp @@ -393,12 +393,14 @@ Workplane make_workplane_normal_to_curve_rworkplane(const EdgeOrWire& curve, con } Workplane make_workplane_offset_rworkplane(const Workplane& base, const Scalar3& offset, const Scalar& rx, - const Scalar& ry, const Scalar& rz, const std::optional& base_plane) { + const Scalar& ry, const Scalar& rz, + const std::optional& base_plane) { static constexpr const char* kOp = "make_workplane_offset_rworkplane"; - static const ErrorSpec kSpec{kOp, - "Failed to place a workplane relative to its base.", - {"The offset or an angle is not a finite number."}, - {"Pass offset as (dx, dy, dz) along the base's x, y and normal, and the angles in degrees."}}; + static const ErrorSpec kSpec{ + kOp, + "Failed to place a workplane relative to its base.", + {"The offset or an angle is not a finite number."}, + {"Pass offset as (dx, dy, dz) along the base's x, y and normal, and the angles in degrees."}}; return guarded(kSpec, [&] { const CoordinateSystem& frame_in = base.cs(); const Vec3 bx = frame_in.x_axis(); diff --git a/src/cpp/src/sketch/edit.cpp b/src/cpp/src/sketch/edit.cpp index cd5d8f4d..36a34075 100644 --- a/src/cpp/src/sketch/edit.cpp +++ b/src/cpp/src/sketch/edit.cpp @@ -143,7 +143,7 @@ struct Geometry { const opencascade::handle line = new Geom2d_Line(gp_Pnt2d(p1.first, p1.second), gp_Dir2d(p2.first - p1.first, p2.second - p1.second)); if (!bounded) - return line; + return CurveHandle(line); return new Geom2d_TrimmedCurve(line, -kTol, len + kTol); } if (entity.kind == kEllipseKind) { @@ -163,11 +163,11 @@ struct Geometry { const opencascade::handle full = new Geom2d_Circle( gp_Ax2d(gp_Pnt2d(circle.center.first, circle.center.second), gp_Dir2d(1.0, 0.0)), circle.radius); if (entity.kind == kCircleKind || !bounded) - return full; + return CurveHandle(full); const auto [start, sweep] = arc_span(entity); const double tol = kTol / circle.radius; if (sweep + 2.0 * tol >= kTwoPi) - return full; + return CurveHandle(full); return new Geom2d_TrimmedCurve(full, start - tol, start + sweep + tol); } };