L1 · DS-110

Workplanes & Sketches: 2D Becomes 3D

Place a 2D sketch on a workplane and extrude it into a solid, then cut a feature through it. Pass = the resulting build123d Part has the target bounding box AND the target volume (the through-hole removes the right amount of material).

01
Challenge

Try this first — before any explanation.

The Bench opens on task 02_plate. The spec card shows a target: a flat plate sketched from a Rectangle 70 x 45 mm, extruded 10 mm in Z, with a single Ø12 mm hole drilled clean through the center. The starter sketches the Rectangle and extrudes it correctly, so the bounding box is already right (70 x 45 x 10) and the 3D viewer shows a solid block. But run it cold and the verdict is red: the VOLUME is 31500 mm³, not the spec's 30369 mm³. There's no hole. The bbox looks done, but the part still fails. Figure out that a closed Circle cut through the plate is what removes the missing ~1131 mm³, and the autograder turns green.

The Bench

Real build123d on the OpenCascade kernel. Your code must define result as a build123d Part. The autograder reads result.bounding_box().size and result.volume and compares to the spec: a 70 x 45 x 10 mm plate with one Ø12 mm hole through the center. The starter already sketches and extrudes the plate (bbox is correct), but it has no hole, so the volume is too high. Add the through-hole cut.

PARAMETRIC CAD

Workplanes & Sketches: 2D Becomes 3D

Real build123d on the OpenCascade kernel. Your code must define result as a build123d Part. The autograder reads result.bounding_box().size and result.volume and compares to the spec: a 70 x 45 x 10 mm plate with one Ø12 mm hole through the center. The starter already sketches and extrudes the plate (bbox is correct), but it has no hole, so the volume is too high. Add the through-hole cut.

02
Model

The idea, built visually.

Every solid in real CAD starts as something flat: a sketch on a plane. The question is, how does a flat drawing get thickness? First you draw a closed outline. Closed is the magic word. An open line is just a squiggle, but a closed loop encloses a face, and a face can become a solid. Here the outline is a Rectangle, seventy by forty-five. Now give that face volume: extrude pushes it straight up ten millimeters, and the flat rectangle becomes a plate you could hold. But a plate isn't a part yet. A part has features. Sketch a Circle, extrude it into a peg the full thickness, and subtract it. That boolean cut bores a clean hole through the plate. Watch what the grader sees: the bounding box never changed, still seventy by forty-five by ten, because the hole is interior. What changed is the volume. The hole removed pi times r-squared times the height of material, about eleven hundred cubic millimeters. So bounding box tells you the envelope, volume tells you what's actually inside. Sketch, extrude, cut. Your starter has the plate but no hole. Drill it.

▣ Stage animation: Cold open: a flat blue rectangle outline on a dark plane, question 'How does a flat drawing turn into a part you could bolt down?'. Beat 1: the XY plane drawn faintly, a pen traces Rectangle(70, 45), the enclosed area filling translucent blue the instant the loop closes, caption 'a sketch must be a closed loop to become a face.' Beat 2 (money shot): the filled rectangle face lifts along +Z, the number 10 riding up as the prism sweeps out, caption 'extrude(sketch, amount=10).' Beat 3: a small Circle radius 6 appears centered on the top face, extrudes down through the plate as a translucent peg, then flips to warm-accent and subtracts, boring a clean through-hole, caption 'result = plate - Cylinder.' Beat 4: split readout, left chip 'bbox 70 x 45 x 10 OK' stays green the whole time while right chip flips from 'volume 31500 ✗' to 'volume 30369 OK' the moment the hole lands, kinetic caption 'bbox = the envelope, volume = what's inside.'

03
Guided practice

Build it up, step by step.

Step A (worked, fully shown): build the plate with a sketch-then-extrude, result = extrude(Rectangle(70, 45), amount=10); print result.bounding_box().size and result.volume, note the bbox is already 70 x 45 x 10 but the volume is 31500, a solid brick. Step B (the cut): introduce the hole as a boolean subtraction, result = result - Cylinder(radius=6, height=10); annotate 'Cylinder is a sketch-Circle extruded for you; the minus sign is the boolean cut that bores it through.' Re-print the volume and watch it drop to 30369.0. Step C (predict, no running): ask the learner to compute by hand how much volume one Ø12 x 10 hole removes (pi * 6**2 * 10 ≈ 1131) and confirm 31500 - 1131 matches the readout, tying the number to the geometry. Step D (independent, no code shown): final gate 02_plate asks for exactly the spec part, bbox [70, 45, 10] within 0.1 mm and volume 30369.0 within 5 mm³; the learner must produce the sketch, the extrude, and the cut from scratch.

04
Feedback

How the Bench grades your run.

PASS WHEN PASS prints when result.bounding_box().size is 70 x 45 x 10 mm within ±0.1 AND result.volume is 30369.0 mm³ within ±5. That volume only lands when a Ø12 mm hole (which removes π·6²·10 ≈ 1131 mm³) is cut clean through the 31500 mm³ plate. The 3D viewer shows the bored plate. Deterministic kernel grade, infinite retries.

  • bbox is correct (70 x 45 x 10) but volume reads 31500 mm³, not 30369. That's a solid plate with no hole. Subtract a Cylinder(radius=6, height=10) from result to bore the Ø12 through-hole.
  • Volume is 30746 mm³, too high by ~377. Your hole is too small: a Ø12 hole needs radius=6 (it removes π·6²·10 ≈ 1131 mm³), check the Cylinder radius.
  • Volume removed too much (result < 30369). Your hole radius or height is too big; the hole is Ø12 (radius 6) and the plate is 10 mm thick, so height=10.
  • bbox Z reads 8, not 10. The extrude amount sets the thickness; change extrude(Rectangle(70,45), amount=...) to amount=10.
  • bbox X/Y is wrong. Those come from the sketch: use Rectangle(70, 45), 70 in X and 45 in Y, before you extrude.
  • result is undefined or not a build123d object. The grader reads result.bounding_box() and result.volume, so the last thing your code builds must be assigned to result.
05
Retrieve & space

Bring back what you've already mastered.

  • Closed-loop recall (this lesson): a 2D ____ encloses a face that extrude can turn into a solid; an open wire cannot. -> a closed sketch (e.g. Rectangle or Circle). Keeps the closed-loop rule load-bearing.
  • extrude argument (typed): result = extrude(Rectangle(70, 45), amount=10) -> what is the solid's Z extent in mm? -> 10. The amount IS the thickness.
  • bbox vs volume (concept): you cut a small hole through the middle of a plate. Which changes, the bounding_box().size or the volume? -> only the volume; the envelope is unchanged. Pre-loads the idea that volume catches interior features bbox can't.
06
Mastery gate

What you must demonstrate to advance.

Pass 02_plate: result is a build123d Part with bounding_box().size 70 x 45 x 10 mm (±0.1) AND volume 30369.0 mm³ (±5), i.e. the sketched-and-extruded plate with a real Ø12 through-hole, AND clear retrieval cards 1-3. Proves the L1 competency: place a closed sketch on a workplane, extrude it into a solid, and cut a feature so both the envelope (bbox) and the material (volume) match spec. No time gate, infinite retries.

07
Project

How this feeds your build.

Not a capstone lesson. Feeds the capstone: sketch -> extrude -> cut is the workhorse that produces nearly every non-trivial part in Modules 3-5 (brackets, links, mounts, housings). The bored plate built here is the seed of every bolted mount downstream, and the bbox+volume grading contract established here is the exact interface the later parametric and assembly autograders use to judge a finished part.