DesignmatixDX-CAD

DX-CAD documentation

Example parts

Every part here is a model.py: a short Python script with its numbers at the top. Every name the kernel and the sketch API have is already in scope, so a model imports nothing. To build one into a project, and to look at it:

dxcad run bracket.py --output bracket.dxcprt
dxcad describe bracket.dxcprt
dxcad gui bracket.py

Change a number and run it again: that is the whole of DX-CAD™'s parametric model. The test suite runs every model on this page, checks each part it builds against arithmetic, and builds it again with one number changed, so what is written here is what the script does.

A sketch is drawn on a plane. Plane.XY, Plane.XZ and Plane.YZ are the three standard ones, Plane.XY.offset(z) is XY lifted by z, which is what engine_inline4.py draws its bolt heads on, and Plane.from_face(face) is the plane of a face of a part already built.

ModelWhat it is
bolt_mate.pyA bolt placed in a plate's hole by two mates, as docs/kernel.md shows it.
bracket.pyA mounting bracket with four holes: the worked example of docs/examples/bracket.md.
channel.pyA lipped channel, its width, depth and lips dimensioned to the outside.
clip.pyA cable clip, drawn with arcs.
corner_post.pyA door corner post bent from one 1.5 mm sheet, with flanges on its flanges' edges.
door.pyA door hung on one hinge sub-assembly used twice, from door-hinge.dxcasm.
drawn_bracket.pyAn angle bracket with its drawing, drawn_bracket.dxcdrg, on an ISO A3 sheet.
enclosure.pyA box and its lid, two parts from one model.
engine_inline4.pyInline-four DOHC petrol engine, cut away.
flange.pyA pipe flange with a bolt circle.
funnel.pyA funnel, a thin wall turned about its axis.
gearbox.pyA two-stage helical speed reducer, its cover cut away to show the gear train.
handle.pyA bent handle, a round bar swept along a path.
knob.pyA scalloped knob with a pocket for a captive nut.
mated_enclosure.pyA round enclosure whose lid is placed on its base by two mates.
mitred_door.pyA 1000 x 800 cabinet door bent from 2 mm steel, its return lips mitred at the corners.
race_car_frame.pyA Formula Student race car: tubular spaceframe chassis and running gear.
rack.pyA welded rack frame on castors, from plain parts.
relieved_tray.pyA sheet metal tray with two relieved flanges and two holes in its base.
robot_arm.pyA six-axis industrial robot arm in a working pose, with a parallel gripper.
sheet_door.pyA cabinet door bent from 1.5 mm mild steel, with flanges and return lips.
steel_structure.pyA two-level industrial steel platform, 3 x 2 bays.
tight_fits.pyA shaft in a housing with two collars and a cover, at fits of 0.05 to 0.2 mm.
tray.pyA sheet metal tray, a flange bent up on each edge of its base.

Seven of them show what v0.1 adds: sheet metal with relief and holes (relieved_tray.py) and dimensioned to the outside (channel.py), parts placed by mates (mated_enclosure.py, bolt_mate.py), a sub-assembly used twice (door.py), raised text (the nameplate of gearbox.py) and a drawing document (drawn_bracket.py). Two keep a file beside them: door.py uses door-hinge.dxcasm, and drawn_bracket.dxcdrg is the bracket's drawing. dxcad examples door copies the file along with the model.

Five are whole machines of some two hundred to four hundred parts each: gearbox.py, engine_inline4.py, robot_arm.py, race_car_frame.py and steel_structure.py. Each opens drawn light, so that it builds in a few seconds, and its docstring names the numbers that draw it in full: the gear teeth's involutes, the cam lobes, the bores of the suspension tubes, the bolts on every end plate.

Some of the numbers in these models are not chosen but looked up: a clearance hole, a tapping drill, the seat a screw head sits in. dimensions.md says where each of those comes from.

The bracket is also the worked example for agents: bracket.md tells the story of an agent making it through dxcad serve, and bracket.jsonl is that conversation, line for line.

From the DX-CAD documentation, examples/README.md. All the pages.