Skip to main content

Module examples

Module examples 

Source
Expand description

The examples of extruding, revolving and sweeping: programs written in Rust against the operation types, which an editor offers to load (set).

Each refers to what earlier steps built only by name, and so reads as the recipe it is: extrude(box,end) is the end cap of the step box, whatever internal id it happens to get.

Functions§

box_with_drill_hole
A 2 x 2 x 1 box with a blind hole drilled into its top: a rectangle sketched on the Z plane and extruded up (box), and a circle sketched on the box’s end cap extrude(box,end) and extruded back into it, cutting it out of the box (hole) — the drilled box is extrude(hole).
bracket
A 40 x 40 x 10 mm bracket with a 6 mm hole through its middle: a rectangle sketched on the Z plane and extruded up (block), and a circle sketched on the block’s end cap and extruded back through its full thickness, cutting it out of the block (hole). Unlike box_with_drill_hole, the cut ends exactly on the bottom face, so the hole goes all the way through. The program the landing page’s agent demo transcript writes, step for step.
coil_spring
A coil spring: a 2 x 2 rectangle (section) on the origin’s y plane, swept (coil) along a helix of radius 10 rising 20 in three turns round the z axis, drawn in a 3-D sketch (route).
cross_drilled_shaft
A stepped shaft revolved around the world z-axis, cross-drilled through its thinner end: a half section sketched on the X plane, closed by the axis itself (shaft), and a circle on the Y plane extruded through both sides of it and cut out of it (bore) — the drilled shaft is extrude(bore).
edge_part
Three outlines sketched on the origin’s three planes, each extruded and joined to the one before, as drawn in the editor.
handle_with_hole
A hand-drawn handle-shaped outline (an irregular blob, splined, with a smaller splined region inside it — as a free-hand sketch in the web editor draws, unconstrained) extruded, then cross-drilled with a circular hole near one end.
horn
A horn: a circle swept along a straight path, its size set by a rail — a spline flaring out beside the path, which the circle’s point on it follows.
luggage_tag
A rounded-top luggage tag: two vertical sides and a horizontal bottom, closed by a semicircular top tangent to both sides, with a hang-hole through the top (concentric with it) and a rectangular window in the body, inset 0.15 from each of the two sides and the bottom.
motor_flange
A motor flange 30 across and 2.5 thick, drawn the way the sketch tools draw it: its bore an offset of its rim, 10 in, so the wall follows the rim; and its bolt circle one hole patterned six times round its middle, so the copies follow the first hole.
name_plate
A name plate: a 40 x 14 x 3 plate sketched on the Z plane and extruded up (plate), and the word “GEOP”, its capitals 7 tall, its baseline from a point fixed at (7, 3.5), sketched on the plate’s top extrude(plate,end) and extruded 1 up from it, joined to the plate (letters): each letter a lump standing on the plate, the holes of the O and the P open down to it.
parametric_plate
A plate designed by its parameters: width and depth — half the width, unless placed otherwise — extruded thickness thick, and a blind hole in its middle sized for the screw chosen from a table of sizes, and its colour. The hole’s sketch, on the plate’s top, projects the top, and puts the hole in the middle of it. The plate is meant to be placed with other values, and everything follows.
pipe
A pipe bent through space — a cable conduit, say: a circle of radius 0.3 on the x plane (section), swept along a 3-D sketch of lines and bends (route, see pipe_route) into the solid sweep(pipe).
pipe_route
The route of pipe, its bends of radius bend: from the origin along x, a bend turning to y at (4, 0, 0), a bend turning up to z at (4, 4, 0), and up to (4, 4, 4) — every bend tangent to the lines it joins.
revolved_cone_on_box
A box with a round hole through it, and a triangle sketched on its side face, revolved around one of its own edges and joined to the box: a double cone whose axis lies in the side face, so that both apexes sit on it and half the cone stands out of the box.
set
The examples of this crate, as an editor offers them.
square_thread
A square thread, as drawn in the editor: a rectangle standing on a revolved cylinder, swept five turns along a helix in a 3-D sketch and joined to it, the wall it stands on lying in the cylinder’s. Kept as the program it saved, as edge_part is.