A curved block with a slot swung through it by a pin.
The block is a sector of a ring about the z axis: everything with distance from the z axis between 8 and 12, with z between −1 and 1, and with polar angle between 0° and 60° (measured from +x toward +y).
The pin is a solid cylinder of radius 0.5 whose axis is the x axis, from x = 6 to x = 11, its ends flat. Its axis meets the block's at the origin.
The pin turns rigidly about the z axis, right-handed (from +x toward +y), from −140° to +140°: it starts clear of the block, passes through it, and ends clear of it. Cut from the block everything the pin passes through.
Each circle of the pin about its own axis touches at its two points in the plane of the two axes, so the pin's side sweeps the slot's flat roof and floor, z = ±0.5. On the rim of the pin's far end the circle whose normals pass through the origin touches all round and sweeps a zone of the sphere of radius √(11² + 0.5²) about the origin, the slot's end wall. The slot runs right through the block's inner wall and both its flat sides, so the block falls into what lies above the slot and what lies below it, joined beyond the sphere.
expected
closed form
volume
53.84340742
(π/3)·80 − (π/6)(57.25 − 1/12): the slot is |z| ≤ 0.5 out from ρ = 8 to the sphere ρ² + z² = 11² + 0.5², over the whole 60°
area
198.4923078
the block 40π + 16, less the inner wall's band 8π/3 and two openings ∫(√(121.25 − z²) − 8) dz over |z| ≤ 0.5, plus roof and floor (π/6)(11² − 8²) each and a sixth of the sphere's zone 2π√121.25·1
Drawing
TopIsometricFrontRight
Third-angle projection, the three views at one scale. Drawn from occt's result, which passed.
† works around a missing feature. Pick an entry to see its solid, its measures and its code.
Drag to turn, scroll or pinch to zoom, right-drag to move. The solid as its STEP file has it, meshed in the browser by Open CASCADE (occt-import-js): each face colored by the kind of its surface, and the edges that bound each face drawn between them.
Drag to turn, scroll or pinch to zoom, right-drag to move. Black lines are where the surface turns sharply; red ones, seen through the solid, are open edges, where the mesh is not closed.
Time
338 ms; CPU time 1.05 s; peak memory 21.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A ring sector (radii 8 to 12 about z, z from −1 to 1, polar angle 0° to 60°) with a slot swung//! through it by a pin, the solid cylinder of radius 0.5 about the x axis from x = 6 to 11, turned//! rigidly about z from −140° to +140°.//!//! The kernel's closed sweep (`swept::closed::cut_from`) takes the pin whole. Its closed class//! refuses it (`Unbuilt::Curved` at the centre of the pin's near end): under a turn a sharp circle//! leaning to the axis is turned into its ring, and the pin's end rims, square to a radius, have//! their normal in the plane through the turn's axis and their centre, which turns into no ring//! the kernel reads (`turned::Rim::simple`). Since 0.10.0 such a tool goes the contact's road —//! each sheet on the surface of revolution of its section's meridian, its rails circles about the//! axis, trimmed by membership in the sweep, and the result cut from the sector.usecrate::sketch::polygon;
use cad_kernel::build::{disc, prism, revolve};
use cad_kernel::geom::tolerance;
use cad_kernel::swept::closed::cut_from;
use cad_kernel::topo::Brep;
use cad_kernel::trajectory::{Screw, Trajectory};
constSECTOR: f64 = 60f64.to_radians();
constROLL: [f64; 2] = [-140f64.to_radians(), 140f64.to_radians()];
/// How closely the pin is meshed for the sweep's membership reads: a hundredth of its radius.constBAR: f64 = 0.005;
/// The ring sector about z: radii 8 to 12, heights −1 to 1, polar angles 0° to 60° — its section in/// the half-plane y = 0, x > 0 turned right-handed about z.fnsector() -> Result<Brep, String> {
let section = polygon(&[[8., 0., -1.], [12., 0., -1.], [12., 0., 1.], [8., 0., 1.]]);
revolve(§ion, [0., 0., 0.], [0., 0., 1.], SECTOR)
}
pubfnbuild() -> Result<Brep, String> {
let pin = prism(&disc([6., 0., 0.], [1., 0., 0.], 0.5), 0., 5.)?;
// the turn about z: a screw that does not advance, turning a radian a radian of the rolllet path = Trajectory::Twist(Screw {
origin: [0., 0., 0.], axis: [0., 0., 1.], ratio: 1., advance: 0.,
});
// the kernel's swept solid cut from the sector on one arrangement: a cylinder about an axis// square to the turn's, its contact the two generators in the plane of both axes, and its far// end's rim, a sharp circle leaning to the axis, turned into its ringlet blank = sector()?;
let size = blank.size().max(pin.size());
cut_from(&blank, &pin, &path, ROLL, BAR, tolerance(size))
.map_err(|why| format!("the pin's sweep not built: {why:?}"))
}
Time
846 ms; CPU time 845 ms; peak memory 372.8 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
not by the harness, which graded the runner's own measures instead: cannot measure: face #1029: a loop that does not join up on its surface ((-3.839724374976886, 3.141593106555937) to (-3.839724354387511, 6.283185307179697))
"""A slot swung by a pin lying along a radius. A curved block with a slot swung through it by a
pin.
The block is a sector of a ring about the z axis: everything with distance from the z axis between
8 and 12, with z between −1 and 1, and with polar angle between 0° and 60° (measured from +x toward
+y).
The pin is a solid cylinder of radius 0.5 whose axis is the x axis, from x = 6 to x = 11, its ends
flat. Its axis meets the block's at the origin.
The pin turns rigidly about the z axis, right-handed (from +x toward +y), from −140° to +140°: it
starts clear of the block, passes through it, and ends clear of it. Cut from the block everything
the pin passes through.
Each circle of the pin about its own axis touches at its two points in the plane of the two axes,
so the pin's side sweeps the slot's flat roof and floor, z = ±0.5. On the rim of the pin's far end
the circle whose normals pass through the origin touches all round and sweeps a zone of the sphere
of radius √(11² + 0.5²) about the origin, the slot's end wall. The slot runs right through the
block's inner wall and both its flat sides, so the block falls into what lies above the slot and
what lies below it, joined beyond the sphere."""fromOCP.BRepPrimAPIimportBRepPrimAPI_MakeCylinderfromOCP.gp import gp, gp_Ax2, gp_Pnt
from sweep import cut, plane, ring_sector, turn, turned
BLOCK = (8, 12, -1, 1, 0, 60) # radii, heights and polar anglesRADIUS, NEAR, FAR = 0.5, 6, 11# the pin, along the x axisSTART, STOP = -140, 140# degrees about the z axisdefbuild():
pin = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(NEAR, 0, 0), gp.DX_s()), RADIUS,
FAR - NEAR).Shape()
tool = turn(pin, gp.OZ_s(), START)
# The pin's axis meets the turn's. Its side, and its flat ends (each square to a line# through the turn's axis), meet the turn square-on where their normals lie in the plane# through both axes, which cuts them along their contact.
through_axes = turn(plane((0, 0, 0), (0, 1, 0)), gp.OZ_s(), START)
swept = turned(tool, gp.OZ_s(), STOP - START, [through_axes])
returncut(ring_sector(*BLOCK), swept)
arris left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
23 ms; CPU time 23 ms; peak memory 12.5 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A curved block, the sector of the ring about the z axis between radii 8 and 12, z from −1 to 1//! and polar angle from 0° to 60°, slotted by a pin swung through it: the solid cylinder of radius//! 0.5 about the x axis from x = 6 to x = 11, turned rigidly about the z axis from −140° to +140°.//! Everything the pin passes through, cut.//!//! The pin's sweep is kentron's sweep of a solid (`sweep::solid`, one turn), cut from the block.usecrate::bench::{frame, p};
usecrate::shared::swept::ring_sector;
use kentron::math::{Axis, Direction};
use kentron::primitives::Cylinder;
use kentron::sweep::{self, RigidMotion};
use kentron::topology::{Model, Shape};
pubfnbuild(m: &mutModel) -> kentron::Result<Shape> {
let block = ring_sector(m)?;
let pin = Cylinder::new(0.5, 5.0).with_frame(frame(p(6.0, 0.0, 0.0), Direction::X)).build(m)?;
let turn = RigidMotion::Turn { axis: Axis::Z, from: (-140f64).to_radians(), to: 140f64.to_radians() };
let swept = sweep::solid(m, pin, &turn)?;
kentron::boolean::difference(m, block, swept)
}
vcad left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
135 ms; CPU time 135 ms; peak memory 48.2 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A ring sector, everything between 8 and 12 from the z axis with |z| ≤ 1 and polar angle from//! 0° to 60°, slotted by a pin, the solid cylinder of radius 0.5 about the x axis from x = 6 to//! 11, swung about the z axis from −140° to +140°.//!//! solidcraft-kernel has no sweep of a solid, so the swing is built by elementary geometry. The//! pin spans a few degrees about the z axis, starts and ends clear of the block, and turns far//! enough that every circle about the z axis in the block that meets the pin is passed over//! where it crosses the block: what the pin takes from the block is its shadow, the circles it//! meets, revolved. At height z the pin is the rectangle 6 ≤ x ≤ 11, |y| ≤ √(0.5² − z²), nearest//! the axis at 6 and farthest at its outer corners, √(11² + 0.5² − z²): the shadow is the band//! |z| ≤ 0.5 from 6 out to the circle of radius √(11² + 0.5²) about the origin.usesuper::drum_swung_partway_into_ring_sector::{ring_sector, turned};
usecrate::solids::*;
use solidcore_record::Seg2;
pubfnbuild() -> R<Body> {
let far = (11f64 * 11.0 + 0.25).sqrt();
let reach = 0.5f64.atan2(11.0); // the far circle's angle at z = ±0.5let line = |a: (f64, f64), b: (f64, f64)| Seg2::Line { a: v2(a.0, a.1), b: v2(b.0, b.1) };
let shadow = vec![
line((6.0, -0.5), (11.0, -0.5)),
Seg2::Arc { center: v2(0.0, 0.0), radius: far, start: -reach, sweep: 2.0 * reach },
line((11.0, 0.5), (6.0, 0.5)),
line((6.0, 0.5), (6.0, -0.5)),
];
let shadow = Region2 { outer: Loop2 { segs: shadow }, holes: vec![] };
let swept = turned(&revolve_z(shadow, 280.0)?, -140.0)?;
cut(&ring_sector()?, &swept)
}
brepkit left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
175 ms; CPU time 323 ms; peak memory 40 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
// A ring sector (8 to 12 from the z axis, |z| ≤ 1, 0° to 60°) less everything a pin (radius 0.5 about the x axis, x = 6 to 11) passes through as it turns about z from -140° to 140°. Its shadow runs out to its far rim's corners, √(11² + 0.5²) from the origin.//// A turn about the z axis sweeps the tool where it starts and where it stops and, between them, the// shadow of the tool on a half-plane through the axis (each point carried there round its circle// about the axis) revolved through the turn: here the tool is symmetric about its own plane through// the axis, so the shadow is its section in that plane.fnblock(m) {
m.profile(xz()).polygon([[8.0, -1.0], [12.0, -1.0], [12.0, 1.0], [8.0, 1.0]]).sketch("block")
.revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), blind(60.0))
}
fnswing(m, section, from, to) {
section.sketch("shadow").revolve(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), blind(to - from))
.rotate(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), from)
}
fnturned(body, angle) { body.rotate(axis_at([0.0, 0.0, 0.0], [0.0, 0.0, 1.0]), angle) }
fncutter(m) { m.cylinder(0.5, 5.0, #{ at: [6.0, 0.0, 0.0], axis: [1.0, 0.0, 0.0], ref: [0.0, 1.0, 0.0] }) }
let m = model();
let b = block(m);
b = b.subtract(m.tool(|m| turned(cutter(m), -140.0)));
b = b.subtract(m.tool(|m| swing(m, m.profile(xz()).path(6.0, -0.5).line_to(11.0, -0.5).arc_to([sqrt(121.25), 0.0], [11.0, 0.5]).line_to(6.0, 0.5).close(), -140.0, 140.0)));
b = b.subtract(m.tool(|m| turned(cutter(m), 140.0)));
m
aetheris left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
14 ms; CPU time 13 ms; peak memory 16.2 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A ring sector slotted by a pin swung through it.//!//! The kernel's sweep of a solid (`sweep_solid_within`): the pin is a solid of revolution about the//! x axis, its meridian the rectangle out to radius 0.5 from x = 6 to x = 11, turned about the z//! axis from −140° to +140°. Asked for between 7.5 and 12.5 from the z axis, from z = −1.5 to 1.5//! and from −10° to 70°, which holds the block (the rectangle 8 ≤ x ≤ 12, |z| ≤ 1 revolved from 0°//! to 60°) and which neither end position reaches; cut from the block.usecrate::solids::{p, polygon};
usecrate::Refusal;
use brep_kernel::{
boolean_operation_nary, revolve_profile_brep, sweep_solid_within, BooleanOperation, BrepSolid,
OutlinePiece, ScrewStep, SolidMotion, SweepClip, SweptTool,
};
#[allow(unused_imports)]use std::f64::consts::{FRAC_PI_2, PI, TAU};
pubfnbuild() -> Result<BrepSolid, Refusal> {
let z = p(0.0, 0.0, 1.0);
let section = [p(8.0, 0.0, -1.0), p(12.0, 0.0, -1.0), p(12.0, 0.0, 1.0), p(8.0, 0.0, 1.0)];
let block = revolve_profile_brep(&polygon(§ion)?, p(0.0, 0.0, 0.0), z, 60f64.to_radians())?;
let tool = SweptTool::Revolved {
axis_origin: p(6.0, 0.0, 0.0),
axis_direction: p(1.0, 0.0, 0.0),
radial: p(0.0, 0.0, 1.0),
meridian: vec![
OutlinePiece::Line { from: [0.0, 0.0], to: [0.5, 0.0] },
OutlinePiece::Line { from: [0.5, 0.0], to: [0.5, 5.0] },
OutlinePiece::Line { from: [0.5, 5.0], to: [0.0, 5.0] },
OutlinePiece::Line { from: [0.0, 5.0], to: [0.0, 0.0] },
],
};
let motion = SolidMotion {
steps: vec![ScrewStep { axis_origin: p(0.0, 0.0, 0.0), axis_direction: z, turn: 1.0, advance: 0.0 }],
from: (-140.0f64).to_radians(),
to: 140.0f64.to_radians(),
};
let around_block = SweepClip {
axis_origin: p(0.0, 0.0, 0.0),
axis_direction: z,
reference: p(1.0, 0.0, 0.0),
radius: [7.5, 12.5],
axial: [-1.5, 1.5],
angle: Some([(-10f64).to_radians(), 70f64.to_radians()]),
};
letmut operands = vec![block];
operands.extend(sweep_solid_within(&tool, &motion, &around_block)?);
Ok(boolean_operation_nary(&operands, BooleanOperation::Subtract)?)
}
geop left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
9.1 ms; CPU time 17 ms; peak memory 9.9 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! A curved block (the ring sector between radii 8 and 12, heights ±1, polar angles 0° to 60°)//! slotted by a pin (radius 0.5 about the x axis from x = 6 to 11) turned about the z axis from//! −140° to +140°.//!//! The pin is a circle extruded; what it passes through is cadrs's sweep of a solid (one turn),//! cut from the block (cadrs's cylindrical box).usecrate::bench::{cut, cylinder, p3, v3};
usecrate::shared::swept::{ring_sector, swung, z_axis};
usecrate::Refusal;
use cadrs_kernel::{BodyId, DefaultKernel};
pubfnbuild(k: &mutDefaultKernel) -> Result<BodyId, Refusal> {
let block = ring_sector(k, (8.0, 12.0), (-1.0, 1.0), (0.0, 60.0))?;
let pin = cylinder(k, p3(6.0, 0.0, 0.0), v3(1.0, 0.0, 0.0), 0.5, 5.0)?;
let swept = swung(k, pin, z_axis(), -140.0, 140.0)?;
cut(k, block, swept)
}
smlib left no solid to show.
Time
It has not run.
Notes
missing no implementation
Data
No measures: it built no solid to measure.
Implementation
No implementation yet.
Time
66 ms; CPU time 66 ms; peak memory 9.2 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The ring sector (radii 8 to 12, heights −1 to 1, angles 0° to 60°) less everything a pin passes//! through as it turns about the z axis from −140° to 140°: the cylinder of radius 0.5 about the x//! axis from x = 6 to 11.use springrep::boolean::difference;
use springrep::primitive::cylinder;
use springrep::sweep::solid;
use springrep::topo::Brep;
usecrate::shared::swept::{deg, sector_block, turning};
usecrate::shared::{e, frame};
pubfnbuild() -> Result<Brep, String> {
let axis = frame([6.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0])?;
let pin = cylinder(&axis, 0.5, 5.0, "pin").map_err(e)?;
let slot = solid(&pin, &turning(deg(-140.0), deg(140.0)), "slot").map_err(e)?;
difference(§or_block()?, &slot).map_err(e)
}
Time
327 ms; CPU time 580 ms; peak memory 38.9 MB
Notes
wrong volume 53.8438098246 against 53.843407424 (its STEP's); area 198.492013949 against 198.492307787 (its STEP's)
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
Data
its STEP's
expected
rel. error
volume
53.84380982
53.84340742
7.5e-06
area
198.4920139
198.4923078
1.5e-06
agrees with
no other kernel
mesh
7544 triangles, closed
centre of gravity
(8.63316, 4.98436, -1.13069e-09) its STEP's solid
inertia
about it, of unit density: Ixx 430.098; Iyy 211.51; Izz 590.741; Ixy 189.303; Iyz 2.96914e-08; Izx 2.04708e-08
// A curved block slotted by a pin swung through it. The block is the ring 8 to 12 from the z axis,// |z| <= 1, its section in the front plane turned 60 degrees about z from +x toward +y. The pin is// a cylinder of radius 0.5 along the x axis from x = 6 to x = 11, drawn as its half section turned// about its own axis; it turns right-handed about z from -140 to +140 degrees, and everything it// passes through, the kernel's sweep of the pin under that turn, is cut from the block.unit mm
use std
use std.solids (cut)
use std.place (coords)
use std.motion (turns)
// the pin's half section, in the plane through its axis (x) and zprivate lift := axis
fix(dir == (0, 0, 1)) lift
private out := axis
fix(dir == (1, 0, 0)) out
holder := plane(u: out, v: lift)
fix(origin == (0, 0, 0)) holder
in holder {
private e0 := point
private e1 := point hint((6, 0.5))
private e2 := point hint((11, 0.5))
private e3 := point hint((11, 0))
e0 coords(du: 6mm, dv: 0mm) holder
e1 coords(du: 6mm, dv: 0.5mm) holder
e0 distance(5mm) e3
horizontal (spindle := line(e3, e0)) -> vertical (base := line(e0, e1)) ->
horizontal (side := line(e1, e2)) -> vertical (tip := line(e2, e3)) -> close
}
construction pin := solid(std.solids.Revolution(face(base, side, tip, spindle), about: spindle))
// the block: the ring's section in the front plane, turned a sixth of a turn about zin std.front {
construction centerline ax := line(std.origin, hint((0, 1)))
fix((0, 1)) ax.p2
private q0 := point
private q1 := point hint((12, -1))
private q2 := point hint((12, 1))
private q3 := point hint((8, 1))
q0 coords(du: 8mm, dv: -1mm) std.front
q0 distance(4mm) q1
q1 distance(2mm) q2
horizontal (underside := line(q0, q1)) -> vertical (wall_out := line(q1, q2)) ->
horizontal (topside := line(q2, q3)) -> vertical (wall_in := line(q3, q0)) -> close
}
part := solid(std.solids.Revolution(face(wall_in, underside, wall_out, topside), about: ax, to: 60deg))
// the turn about the block's axis, and the slot the pin sweeps
swing := frame
swing turns(1) ax
construction slot := solid({ p | some t in (-140deg, 140deg): p in pin at(under: swing) t })
slot cut part
Time
50 ms; CPU time 50 ms; peak memory 5.2 MB
Notes
pass Its volume and area are the expected ones, and its mesh is closed.
Workaround † no sweep of a solid
Its volume and area are its STEP file's, as the harness measures them from the file's exact geometry (harness/mass/); its triangles are Open CASCADE's mesh of the file, for the pictures.
//! The ring sector 8 ≤ ρ ≤ 12, |z| ≤ 1, 0° ≤ φ ≤ 60° less what a pin (radius 0.5 about the x//! axis from x = 6 to 11) passes through, turned about the z axis from −140° to 140°.use anvil_brep::Solid;
use anvil_brep::boolean::{BoolOp, boolean};
use anvil_brep::profile::Segment;
usecrate::shared::{e, line, rect, rod, swung, turn_z, union, v2};
pubfnbuild() -> Result<Vec<Solid>, String> {
let sector = swung(rect((8., -1.), (12., 1.)).segments, 0., 60.)?;
// anvil-brep has no sweep of a solid. The pin turned about an axis it meets fills the revolve// of what it covers in a half-plane through the axis, from 6 out to the sphere of radius// √(11² + 0.5²) its far rim reaches, within |z| ≤ 0.5, and itself where it starts and stopslet r = (121.25f64).sqrt();
let a = (0.5 / r).asin();
let fan = swung(
vec![
line(v2(6., -0.5), v2(r * a.cos(), -0.5)),
Segment::Arc { center: v2(0., 0.), radius: r, start: -a, sweep: 2. * a },
line(v2(r * a.cos(), 0.5), v2(6., 0.5)),
line(v2(6., 0.5), v2(6., -0.5)),
],
-140.,
280.,
)?;
let pin = rod([6., 0., 0.], [11., 0., 0.], 0.5)?;
let slot = union(&union(&fan, &pin.transformed(&turn_z(-140.)))?, &pin.transformed(&turn_z(140.)))?;
boolean(§or, &slot, BoolOp::Subtract).map_err(e)
}