Build precise CAD models with a compact, PEG-based scripting language. Write your model, watch
it take shape in a live preview, then export it as a print-ready 3MF or a STEP file for CAD.
Everything runs locally — right in your browser or from the CLI.
An open handle and a wedge-shaped edge, built from two simple profiles.
def%basepath"M 0 26 v -52 H 10 C 26 -26 10 -20 80 -19 H 127
C 130 -19 132 -15 132 -4 V 4 C 132 16 130 19 127 19 H 80
C 10 19 26 26 10 26 Z"set$h7!colorcoralplate:%base|extrude$h[-honeycomb71.5rim5in%base|extrude7]@leftblock15plate.depth$h|chamfer15$hat#topand#left
Helical threads and chamfered edges bring a pair of mechanical parts together.
/* Screw and nut - trapezoidal right hand thread */set$pitch3.81set$height24.3/* head/nut height *//* hex body, 46.8 across flats and so 54.04 across corners, its corners
chamfered at 45 degrees from a circle just outside the flats */def%hex{prism6across46.8$height|rotate90aboutz[-path"M23.53,0 H28 V4.47 Z"|revolve]@bottom-path"M28,0 V4.47 H23.53 Z"|revolve}part"screw"set$minor26.57/* root diameter of the thread */set$shaft56.7{head:%hexcylinder$minor$shaft/* ridge in section: 2.94 wide at the root, 0.65 at the crest, 2.02 tall.
it runs a pitch past both ends, so its capped ends lie inside the head
and above the tip, and the chamfer tapers the ridge to nothing */@centerpath"M-0.2,-1.47 L0,-1.47 L2.02,-0.325 L2.02,0.325 L0,1.47 L-0.2,1.47 Z"|helix$minorpitch$pitchheight($shaft+(2*$pitch))/* trim the run-out and chamfer the tip - drawn top down, as SVG y grows down */onhead&path"M0,0 H13.73 L15.5,1.6 V56.7 H28 V81 H0 Z"|revolve}part"nut"set$bore27.84/* crest diameter of the internal thread */@right10%hex/* groove in section: 2.65 wide at the bore, 0.59 at the bottom, 1.8 deep */@center-{cylinder$bore($height+2)@centerpath"M-0.2,-1.325 L0,-1.325 L1.8,-0.295 L1.8,0.295 L0,1.325 L-0.2,1.325 Z"|helix$borepitch$pitchheight($height+(2*$pitch))}
A revolved body with a rounded rim and a handle swept along a single curve.
colorwheat{/* body: one profile for the wall, the rounded rim and the floor */path"M0,90 H33 Q37,90 37.5,86 C42,76 47,62 46,48 C45,30 40,18 40,3
Q40,0 38,0 Q36,0 36,3 C36,18 41,30 42,48 C43,62 39,74 33,82 Q30,84 26,84 H0 Z"|revolve/* handle: a D drawn with x up the mug and y out from it, stood up by about y;
both ends sink into the wall */@right-6zbottom27ellipse714|sweepalongpath"M42,0 C46,-14 40,-31 26,-31 C12,-31 4,-20 0,-3"abouty}|rotate-45aboutz
A 2×4 brick with hollow studs on top and anti-stud tubes, ribs and clutch stubs underneath.
set$pitch16set$length63.8set$width31.8set$height19.15set$wall1.5set$rib1set$rib_height13.25set$stub_depth1.75def%stud{tube9.76.74.6|chamfer0.33atnearest504.6}color#C91A09{body:block$length$width$height[grid42($pitch-9.7)%stud]cavity:@bottom-block($length-2*$wall)($width-2*$wall)($height-$wall)[!@center/* stiffening ribs hang from the roof */ztopblockcavity.width$rib$rib_heightztoplinear$pitch3block$ribcavity.depth$rib_height/* anti-stud tubes, bored clear of the ribs */zbottomlinear$pitch3tube13.611.6cavity.height|chamfer0.33atnearest700zbottomlinear$pitch3-cylinder11.6cavity.height/* clutch stubs on the inside of the walls */yfrontzbottomlinear$pitch4block$rib$stub_depthcavity.heightybackzbottomlinear$pitch4block$rib$stub_depthcavity.heightxleftzbottommirrory($pitch-$rib)block$stub_depth$ribcavity.heightxrightzbottommirrory($pitch-$rib)block$stub_depth$ribcavity.height]}|chamfer0.2atz==0and(x<(0.1-$length/2)orx>($length/2-0.1)ory<(0.1-$width/2)ory>($width/2-0.1))
A chamfered hexagonal box studded with rows of pyramids, topped by a lid that fits its inner wall.
set$side42set$height40def%decoration{grid(floor($side/8)-1)(floor($height/8)-1)pyramid4edge81.5}part"box"box:prism6edge$side$height|chamfer2at(parallelzor#bottom)inner:-prism6edge($side-3)($height-3)block(($side-3)*2)3($height-6)onbox[#f2#f3#f4#f5#f6#f7]y1-%decoration|flipzpart"lid"!colorsteelblue/* set reference face to box#top then extrude #top shape there */onbox#top#top|extrude3on#bottominner#top|offset-0.2|round2|extrude3
Three flat plates that step a SIM card up a size, each with a chamfered pocket cut to fit the smaller card.
set$thick0.76/* SIM card thickness */set$fit0/* extra clearance around the inserted card */!@front5/* spacing between the printed plates *//* pocket position, measured in from the outer card's right and back edges */set$microRight1.9set$microBack1.2set$nanoRight1.15set$nanoBack0.54/* card outline with the orientation chamfer on the front-left corner */def%card$w$d$cpolygonpoints[$c0][$w0][$w$d][0$d][0$c]|round0.1def%mini%card25153def%micro%card1511.82.5def%nano%card12.38.81.75!colorblackpart"Micro to Mini"%mini|extrude$thick[on#topxright-$microRightyback-$microBack-%micro|offset$fit|extrude$thick]part"Nano to Micro"%micro|extrude$thick[on#topxright-$nanoRightyback-$nanoBack-%nano|offset$fit|extrude$thick]part"Nano to Mini"%mini|extrude$thick[on#topxright(-$microRight-$nanoRight)yback(-$microBack-$nanoBack)-%nano|offset$fit|extrude$thick]
Start a model yourself or pick up a script from an AI agent. The same concise language keeps
your design easy to read, change and build on. And when you write by hand, the editor helps
you along.