# OpenCalque: a guide for language models > OpenCalque is a free, open-source (MIT) 2D architectural editor for floor plans and layouts: walls that join themselves, doors and windows that cut them, rooms with their areas, furniture, dimensions, sheets at scale. It runs in the browser at https://opencalque.com and as a desktop app for Windows, macOS and Linux. A drawing is plain JSON in millimetres with a published JSON Schema, and every edit is a small JSON operation, so programs and AI agents can draw, check and export plans: `npx -y opencalque mcp` serves the drawing tools over MCP. It fits when someone wants a 2D plan of a home, an apartment, an office or a room that they can open and keep editing by hand, print to scale as a PDF, or hand to other CAD software as DXF; when a program or an agent has to produce such a plan from a description; or when a plan has to stay readable without the program that made it. It does not do 3D models, BIM (IFC), or DWG files. Version 1.10.1. Drawings saved by version 1.0 and later open in every later version. # Three ways to make a drawing 1. With the tools, over MCP: `npx -y opencalque mcp` (MCP client configuration: `{ "mcpServers": { "opencalque": { "command": "npx", "args": ["-y", "opencalque", "mcp"] } } }`). Open or create a file with open_drawing, read the guide with read_guide, edit with apply_operations, then use check_drawing and view_drawing to see what came out. 2. On the command line: `npx opencalque new plan.opencalque`, write the operations to a JSON file, `npx opencalque apply plan.opencalque ops.json`, then `npx opencalque check plan.opencalque` and `npx opencalque png plan.opencalque --out plan.png`. `npx opencalque --help` lists every command (svg, pdf, dxf, quantities…). 3. Without any tool: write a whole drawing as JSON, like the example at the end of this guide, and give it to the person as a file whose name ends in `.opencalque`. They open it at https://opencalque.com (File › Open, or drop it on the editor) or in the desktop app. The JSON Schema of every type of node is in https://opencalque.com/schema/document.schema.json; that of the operations in https://opencalque.com/schema/ops.schema.json. Where the guide below says to call read_guide with a type, read that type in the schema instead. # How a drawing is stored A drawing is a flat map of nodes, plus its layers, shared colours, materials and dimension styles. Each node has an "id", a "type", a "parent" and an "order". Pages and components are the roots: their parent is null. Every other node sits in a page, in a component, or in a group, which may itself be in a group, to any depth. "order" sets the stacking among siblings; it is a fractional-indexing key such as "a0" or "a1V". Leave it out when adding a node, which puts the node on top; never invent one such as "top" or "1". Nodes may also carry "name", "layer" (a layer id), "visible", "locked", "style" (stroke, strokeWidth, fill, dash, pattern), "modifiers" and "meta". All coordinates and lengths are millimetres. X grows to the right and Y grows downward, as on a screen, so a point further down the sheet has a larger Y. Rotations are in degrees, clockwise. A line weight (strokeWidth) is in screen pixels; one pixel prints as 0.25 mm. The types of node are page, component, group, line, polyline, rect, room, table, viewline, elevation, link, divider, paper, ellipse, text, annotation, gridline, wall, dimension, image, instance, parametric. Before you first use a type, get the JSON Schema that lists its properties: call read_guide with its "type" (on the command line, opencalque guide --type ). # Things that are not obvious from the schema Walls are defined by a line from "a" to "b" plus a thickness. The line is the wall's middle, or with "justify": "left" or "right" that face of it (as it runs from a to b), the whole thickness then lying on the other side: draw outside walls by their inner face so that rooms keep their size and walls of different thicknesses stay flush inside. Two walls join cleanly only when their ends are exactly the same point, so reuse the same coordinates for a shared corner. A typical interior wall is 100 mm thick and an exterior one 200 to 300 mm. "bulge" bends a wall into an arc. "joins" chooses how an end meets one other wall: "round" or "bevel" on both ends of the corner, or "through" on the wall that runs past and "butt" on the one that stops against it; without it the corner is mitred. "free" on an end joins it to no wall, even where other walls end at the same point. A dimension style (the document's "dimensionStyles", managed with add_dimension_style, update_dimension_style and remove_dimension_style) defines whichever properties of a dimension it gives a value to; dimensions take it with "dimensionStyle": "" and may still give a value of their own. A material (the document's "materials", managed with add_material, update_material and remove_material) is what something is built of: a name, and the "fill" and "pattern" it is drawn with. A wall is of one material, with "material": "", and drawn in its colour and pattern; walls of one material that meet are drawn as one, and a line is drawn between walls of different materials that touch. A wall built of several materials (brick, an insulation lining, plaster) is several walls side by side, each of one material and its own thickness, laid face to face: draw them with "justify" on the face they share so that they stay flush. A door or window set in one of them goes through those laid against it. The material of id "default" is what walls are made of until given another: walls of no material take its fill and pattern; it cannot be removed. A room's floor may be of a material too, with "material": "", for its colour and to be counted under it. A "table" node shows quantities measured on a page, kept up to date: put it at "x", "y" with a "schedule" ("objects", "floors", "rooms", "walls", "materials" or "openings") and a "title". It counts the page it is on unless "source" names another page. A "parametric" node is an object drawn from parameters. These kinds are available: [{"kind":"arch.door","what":"Door. Place it on a wall: it cuts the opening and follows the wall. Off a wall it stands alone.","props":{"width":"number in mm (default 900)","height":"number in mm (default 2040)","type":"one of Single | Double | Sliding | Opening only (default Single)","hinge":"one of Left | Right (default Left)","angle":"number in degrees (default 90)","flip":"boolean (default false)"},"cutsWalls":true},{"kind":"arch.window","what":"Window. Place it on a wall: it cuts the opening and follows the wall. The sill marks the outside.","props":{"width":"number in mm (default 1200)","panes":"number (default 2)","glazing":"one of Single | Double | Triple (default Double)","height":"number in mm (default 1250)","sill":"number in mm (default 50)","sillHeight":"number in mm (default 900)","flip":"boolean (default false)"},"cutsWalls":true},{"kind":"arch.stair","what":"Stair, straight. Starts at the insertion point and climbs upward on the sheet.","props":{"width":"number in mm (default 900)","steps":"number (default 12)","tread":"number in mm (default 270)"},"cutsWalls":false},{"kind":"arch.stair.l","what":"Stair, L-shaped. Climbs upward on the sheet, then turns a quarter on a landing.","props":{"width":"number in mm (default 900)","steps":"number (default 14)","before":"number (default 7)","tread":"number in mm (default 270)","turn":"one of Right | Left (default Right)"},"cutsWalls":false},{"kind":"arch.stair.u","what":"Stair, U-shaped. Climbs upward on the sheet, turns half on a landing and comes back.","props":{"width":"number in mm (default 900)","steps":"number (default 16)","tread":"number in mm (default 270)","gap":"number in mm (default 100)","turn":"one of Right | Left (default Right)"},"cutsWalls":false},{"kind":"arch.stair.spiral","what":"Stair, spiral. The insertion point is the centre. Starts at the bottom of the circle.","props":{"radius":"number in mm (default 1000)","inner":"number in mm (default 150)","steps":"number (default 14)","sweep":"number (default 300)","clockwise":"boolean (default true)"},"cutsWalls":false},{"kind":"arch.washbasin","what":"Washbasin. A counter with its bowls. Pull its sides to make it longer or deeper: the bowls and taps keep their size.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 450)","bowls":"number (default 1)","below":"one of None | Drawers | Doors (default None)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.washbasin.double","what":"Double washbasin. A counter with its bowls. Pull its sides to make it longer or deeper: the bowls and taps keep their size.","props":{"width":"number in mm (default 1200)","depth":"number in mm (default 500)","bowls":"number (default 2)","below":"one of None | Drawers | Doors (default None)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.bathtub","what":"Bathtub. Pull its sides to make it longer or wider: its rim and its drain keep their size.","props":{"length":"number in mm (default 1700)","width":"number in mm (default 750)","rim":"number in mm (default 60)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.hob","what":"Hob. Pull its sides to make it wider, 80 or 90 cm: its zones keep their size, and from 75 cm it has a fifth in the middle.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 600)","below":"one of Doors | Drawers | Door and drawer | Oven | None (default Oven)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.sink","what":"Sink. A sink in its stretch of worktop, with a draining board on one side or none. Pull its sides to make it wider, 80 or 90 cm: its bowls keep their size.","props":{"width":"number in mm (default 800)","depth":"number in mm (default 600)","bowls":"number (default 1)","drainer":"one of None | Left | Right (default None)","below":"one of Doors | Drawers | None (default Doors)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.fridge","what":"Fridge. Its doors are at the front, away from the wall. Pull its sides to make it wider or deeper.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 650)","doors":"number (default 1)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.fridge.american","what":"American fridge. Its doors are at the front, away from the wall. Pull its sides to make it wider or deeper.","props":{"width":"number in mm (default 910)","depth":"number in mm (default 730)","doors":"number (default 2)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.baseunit","what":"Base unit. A kitchen unit with its worktop, against the wall: doors, drawers or an oven, as elevations show it. Pull its sides to make it wider.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 600)","height":"number in mm (default 900)","fronts":"one of Doors | Drawers | Door and drawer | Oven (default Doors)","doors":"number (default 1)","drawers":"number (default 3)","worktop":"boolean (default true)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.worktop","what":"Worktop. A length of worktop on its own, over appliances or between units, or the top of an island. Its height is that of its top.","props":{"width":"number in mm (default 1200)","depth":"number in mm (default 650)","thickness":"number in mm (default 38)","height":"number in mm (default 900)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.tallunit","what":"Tall unit. A unit from the floor to the top of the wall cabinets: an oven and a microwave, an oven, a built-in fridge, or shelves behind doors.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 600)","height":"number in mm (default 2150)","contents":"one of Oven and microwave | Oven | Fridge | Doors (default Oven and microwave)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.dishwasher","what":"Dishwasher. Under the worktop, 60 or 45 cm wide: pull its sides.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 600)","height":"number in mm (default 900)","worktop":"boolean (default true)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.washer","what":"Washing machine. Free-standing, or under the worktop: its door is at the front.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 600)","height":"number in mm (default 850)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.bedside","what":"Bedside table. Beside the bed, against the wall: its drawers show in elevations.","props":{"width":"number in mm (default 450)","depth":"number in mm (default 400)","height":"number in mm (default 550)","drawers":"number (default 1)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.chest","what":"Chest of drawers. Against the wall, its drawers in rows, in two columns from 1.2 m wide.","props":{"width":"number in mm (default 800)","depth":"number in mm (default 450)","height":"number in mm (default 850)","drawers":"number (default 4)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.wardrobe","what":"Wardrobe. Against the wall, its doors hinged or sliding. Pull its sides to make it wider.","props":{"width":"number in mm (default 1200)","depth":"number in mm (default 600)","height":"number in mm (default 2200)","doors":"number (default 2)","opening":"one of Hinged | Sliding (default Hinged)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.wallcabinet","what":"Wall cabinet. Hung on the wall above the worktop, drawn dashed as what is above the cut is. Its height above the floor is that of its underside.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 350)","height":"number in mm (default 700)","doors":"number (default 1)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1450}},{"kind":"arch.hood","what":"Range hood. Fixed on the wall over the hob, drawn dashed as what is above the cut is. Its height above the floor is that of its underside, 65 cm over the worktop.","props":{"width":"number in mm (default 600)","depth":"number in mm (default 500)","style":"one of Chimney | Flat (default Chimney)","chimney":"number in mm (default 700)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1550}},{"kind":"arch.splashback","what":"Splashback. The band on the wall between the worktop and the wall cabinets, fixed at the height of the worktop.","props":{"width":"number in mm (default 1200)","height":"number in mm (default 600)","thickness":"number in mm (default 10)","finish":"one of Tiles | Plain (default Tiles)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":900}},{"kind":"arch.sofa.corner","what":"Corner sofa. Its backs go against two walls. Pull its sides to make it longer: each side takes a seat for about every 65 cm.","props":{"length":"number in mm (default 2600)","returnLength":"number in mm (default 1800)","depth":"number in mm (default 900)","corner":"one of Left | Right (default Left)"},"cutsWalls":false},{"kind":"arch.sofa","what":"Sofa. Its back goes against the wall. Pull its sides to make it wider or deeper.","props":{"width":"number in mm (default 1600)","depth":"number in mm (default 850)","seats":"number (default 2)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.armchair","what":"Armchair. Its back goes against the wall. Pull its sides to make it wider or deeper.","props":{"width":"number in mm (default 850)","depth":"number in mm (default 850)","seats":"number (default 1)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.chair","what":"Chair. Its back at the top. Turn it to face the table.","props":{"width":"number in mm (default 450)","depth":"number in mm (default 480)"},"cutsWalls":false},{"kind":"arch.desk","what":"Desk. Against the wall, with its office chair pulled up to it, or without. Pull its sides to make it wider or deeper.","props":{"width":"number in mm (default 1400)","depth":"number in mm (default 700)","chair":"boolean (default true)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.radiator","what":"Radiator. Against the wall by its back. Pull its sides to make it longer: its sections keep their width. Its valve is at one end.","props":{"width":"number in mm (default 800)","depth":"number in mm (default 100)","valve":"one of Right | Left (default Right)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}},{"kind":"arch.compass","what":"Compass (north). Shows where north is. Turn it with its round handle, or type its rotation.","props":{"size":"number in mm (default 1200)","letter":"string (default N)"},"cutsWalls":false},{"kind":"note.north","what":"North arrow","props":{"size":"number in mm (default 800)"},"cutsWalls":false},{"kind":"note.scalebar","what":"Scale bar","props":{"length":"number in mm (default 5000)","divisions":"number (default 5)","textSize":"number in mm (default 150)"},"cutsWalls":false},{"kind":"note.level","what":"Level marker","props":{"level":"string (default +0.00)","size":"number in mm (default 200)"},"cutsWalls":false},{"kind":"elec.socket","what":"Socket. Placed beside a wall, it goes on its face. Several are side by side, or stacked one above the other.","props":{"count":"number (default 1)","layout":"one of Side by side | Stacked (default Side by side)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":300},"ports":[{"key":"in","carries":"control","way":"in"}]},{"kind":"elec.switch","what":"Switch","props":{"twoWay":"boolean (default false)","double":"boolean (default false)"},"cutsWalls":false,"fixedOnWall":{"back":60,"out":"up","height":1100},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.light","what":"Ceiling light","props":{"size":"number in mm (default 240)"},"cutsWalls":false,"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.walllight","what":"Wall light","props":{"size":"number in mm (default 240)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1800},"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.pendant","what":"Pendant light","props":{"size":"number in mm (default 300)"},"cutsWalls":false,"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.spot","what":"Recessed spotlight","props":{"size":"number in mm (default 120)"},"cutsWalls":false,"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.strip","what":"Light strip","props":{"length":"number in mm (default 1200)"},"cutsWalls":false,"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.socket32","what":"Socket, 32 A","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":300}},{"kind":"elec.tv","what":"TV socket","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":300}},{"kind":"elec.network","what":"Network socket","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":300}},{"kind":"elec.pushbutton","what":"Push button","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1100},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.dimmer","what":"Dimmer. Switch with a dimmer","props":{},"cutsWalls":false,"fixedOnWall":{"back":60,"out":"up","height":1100},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.board","what":"Consumer unit","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1400}},{"kind":"elec.junction","what":"Junction box","props":{},"cutsWalls":false},{"kind":"elec.smoke","what":"Smoke detector","props":{},"cutsWalls":false},{"kind":"elec.fan","what":"Extractor fan","props":{},"cutsWalls":false,"ports":[{"key":"in","carries":"control","way":"in"}]},{"kind":"elec.radiator","what":"Electric radiator","props":{"length":"number in mm (default 1000)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":450},"ports":[{"key":"in","carries":"control","way":"in"}]},{"kind":"elec.motion","what":"Motion detector","props":{},"cutsWalls":false,"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.shutterswitch","what":"Roller shutter switch","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1100},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.shutter","what":"Roller shutter","props":{"length":"number in mm (default 1000)"},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":2300},"ports":[{"key":"in","carries":"control","way":"in","required":true}]},{"kind":"elec.thermostat","what":"Thermostat","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1500},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"elec.remote","what":"Wireless switch. Battery switch or remote that controls lights and sockets by radio, as smart home systems do.","props":{},"cutsWalls":false,"fixedOnWall":{"back":0,"out":"down","height":1100},"ports":[{"key":"out","carries":"control","way":"out"}]},{"kind":"furn.table","what":"Table with chairs","props":{"length":"number in mm (default 1800)","width":"number in mm (default 900)","seats":"number (default 6)"},"cutsWalls":false},{"kind":"furn.bed","what":"Bed","props":{"width":"number in mm (default 1600)","length":"number in mm (default 2000)"},"cutsWalls":false},{"kind":"furn.shelf","what":"Shelving unit","props":{"length":"number in mm (default 2000)","depth":"number in mm (default 400)","bays":"number (default 4)"},"cutsWalls":false,"againstWall":{"back":0,"out":"down"}}] Kinds with "cutsWalls" are doors and windows. One cuts an opening when it lies on a wall: put its insertion point (x, y) in the middle of the wall's thickness (on its line for a wall without "justify", half its thickness off it towards the wall otherwise) and set its rotation to the wall's direction, the angle from the wall's "a" to "b". The opening then runs along the wall from the insertion point for its width. It adapts to the wall's thickness by itself, and moves with the wall only by being on it. Kinds with "fixedOnWall" (sockets, switches, wall lights) are fixed on a face of a wall, and follow the wall when it changes only while they are exactly on it. Their own point (0, back) lies on the face, their own X along it, and they stand out of the wall into the room towards their own +Y, or -Y when "out" is "up". For a wall whose direction from "a" to "b" is the angle θ, that is rotation θ on its right face (the face to the right as it runs from a to b, at +90° from its direction since Y grows downward) and θ + 180 on its left face, adding 180 to either when "out" is "up"; then place the insertion point so that (0, back) turned by that rotation lands on the face. "z" on such an object is its height above the floor in mm, to its centre; left out, it is the "height" given. Kinds with "againstWall" (kitchen units, a fridge, a washbasin) stand on the floor with their back against a face, placed by the same rule, and have no height above the floor. A "group" holds several nodes so they are selected, moved and stacked as one. It has no coordinates of its own: to group nodes, add a group and set their "parent" to its id; to move a group, move the nodes inside it. Its "opacity" (0 to 1, 1 when left out) makes everything inside it see-through. A "component" is a reusable definition and an "instance" places it, with "x", "y", "rotation", "scale" and "flipX", and "scaleX" and "scaleY" to stretch it wider or taller than it is drawn. To repeat the same furniture or symbol several times, make one component and place instances of it; changing the component changes them all. An instance has no look of its own, and what a component holds has no layer: what the component draws without a colour takes the colour of the layer of each instance, so to show placed furniture grey (existing) or red (to demolish), put the instances on a layer of that colour. Giving an instance a "style", or a node inside a component a "layer", is refused. A shared colour (the document's "colors", managed with add_color, update_color and remove_color) is used by setting a colour property, such as style.stroke, style.fill or a layer's color, to "var(--)"; changing the shared colour then recolours everything that refers to it. A colour property may also be "var(--layer)": the colour of the layer the node is on, for a fill or a text that should follow its layer as a stroke with no colour of its own already does. "modifiers" is a list of non-destructive changes to how a node is drawn, applied in order: {"type":"crop","frame":{"x":…,"y":…},"params":{"width":…,"height":…}} shows only what is inside that rectangle; {"type":"hatch","params":{"pattern":"Lines"|"Planks"|"Tiles","spacing":…,"angle":…}} gives a closed shape or a room a floor pattern; {"type":"repeat",…} draws copies in rows and columns. Setting "modifiers" replaces the whole list. A "room" names the space enclosed by the walls around its point (x, y): add one with a "name" at a point inside closed walls, and its floor and area are worked out from the walls each time it is drawn. A "divider" (a to b) splits an open space into two rooms where there is no wall; its ends must lie on walls. A "link" joins two objects of the same page by their ids, "from" and "to", through the "ports" their kinds list: a control link (the default "role") says that "from" controls "to", a switch and the light it turns on, a dimmer and its spotlights, a push button and a switched socket, whatever carries the order (a wire, a radio, a bus). It goes from a port that gives control ("way": "out") to one that takes it ("in"); "fromPort" names which, as the second button of a double switch ("out2"), and is left out for the first. A switch that controls three lights has three links; a light controlled from two places (two-way switches) has a link from each. A link has no position: it is drawn as a dashed curve between the two objects and follows them, and removing either removes it. Put it on the page, on the layer of the objects. read_controls says what controls what on a page, and which lights nothing controls. An elevation or a section is two nodes: a "viewline" on the plan (a to b, and depth), which says what is seen, and an "elevation" that refers to it by "line" and says where its view is drawn (x, y, on any page). For an elevation of a wall's face, put the viewline 1000 in front of the face, with depth 1000, running so that the face is on its left (seen from its right); add the viewline before its view. Removing a viewline removes its views. A "paper" is a sheet laid over the drawing that frames what goes on one printed page. Its width and height are in drawing millimetres: the sheet's real size times its "scale" (an A3 lying at 1:100 is 42000 × 29700). It has no children; whatever lies inside its rectangle is on it. Give it "titleBlock": {} (optionally with "project", "author", "date", "number") for a border and a title block; the person exports papers to PDF at their true scale from the File menu. A "dimension" shows the distance between "a" and "b"; "offset" is how far its line stands off them. An "annotation" is a note with a leader from the tip "a" to the text at "b". Texts may hold fields that are filled in when drawn: {date}, {page}, {page-number}, {pages}, {document}. # Making changes Call apply_operations with a list of operations: - add_node: {"op":"add_node","node":{...}}. Omit "id" and "order" unless you need to refer to the node later in the same list, in which case choose a short unique id. Pages and components take no parent. - update_node: {"op":"update_node","id":"...","patch":{...}}. The patch replaces the properties it names; a null value removes a property. Nested objects such as "a", "props" and "style" are replaced whole, so include every field of the one you change. Setting "parent" or "order" moves the node. - remove_node: {"op":"remove_node","id":"..."}. It takes along everything inside the node; removing a component also removes its instances, and removing an object the links that join it to others. - add_layer, update_layer, remove_layer; add_color, update_color, remove_color; add_dimension_style, update_dimension_style, remove_dimension_style, as described above. - set_document: renames the drawing, and with "info" sets its project, client, address and author, which every sheet's title block shows. - add_asset embeds a picture's file for an image node; it is for the app's own imports, and you will not need it. # Checking your work The result of apply_operations lists under "problems" what the edit got wrong that the drawing can tell: a room whose walls do not close and the wall end that may be why, walls drawn over each other, a door or window outside its wall. Put right those you caused. check_drawing lists every such problem of a page, those that were there before you included. A room's area is not stored: it comes from the walls each time. Use measure_drawing for floor areas, wall lengths and counts rather than working them out, and to confirm what you report. Use view_drawing to look at what you drew after anything more than a small edit: rooms that close can still be the wrong shape, and furniture can stand in a doorway. # Example These operations, applied to a new drawing (whose first page has the id "page_1"), draw a room of 4 by 3 m between wall lines, walls 200 mm thick, and name it: [{"op":"add_node","node":{"id":"wall_1","type":"wall","parent":"page_1","a":{"x":0,"y":0},"b":{"x":4000,"y":0},"thickness":200}},{"op":"add_node","node":{"id":"wall_2","type":"wall","parent":"page_1","a":{"x":4000,"y":0},"b":{"x":4000,"y":3000},"thickness":200}},{"op":"add_node","node":{"id":"wall_3","type":"wall","parent":"page_1","a":{"x":4000,"y":3000},"b":{"x":0,"y":3000},"thickness":200}},{"op":"add_node","node":{"id":"wall_4","type":"wall","parent":"page_1","a":{"x":0,"y":3000},"b":{"x":0,"y":0},"thickness":200}},{"op":"add_node","node":{"id":"room_1","type":"room","parent":"page_1","x":2000,"y":1500,"name":"Bedroom"}}] This is the whole drawing they make, as a `.opencalque` file: { "format": "opencalque", "version": 2, "id": "doc_example", "name": "Example", "unit": "mm", "layers": { "layer_1": { "id": "layer_1", "name": "Layer 1", "order": "a0" } }, "nodes": { "page_1": { "id": "page_1", "type": "page", "name": "Page 1", "parent": null, "order": "a0" }, "wall_1": { "id": "wall_1", "parent": "page_1", "order": "a0", "type": "wall", "a": { "x": 0, "y": 0 }, "b": { "x": 4000, "y": 0 }, "thickness": 200 }, "wall_2": { "id": "wall_2", "parent": "page_1", "order": "a1", "type": "wall", "a": { "x": 4000, "y": 0 }, "b": { "x": 4000, "y": 3000 }, "thickness": 200 }, "wall_3": { "id": "wall_3", "parent": "page_1", "order": "a2", "type": "wall", "a": { "x": 4000, "y": 3000 }, "b": { "x": 0, "y": 3000 }, "thickness": 200 }, "wall_4": { "id": "wall_4", "parent": "page_1", "order": "a3", "type": "wall", "a": { "x": 0, "y": 3000 }, "b": { "x": 0, "y": 0 }, "thickness": 200 }, "room_1": { "id": "room_1", "name": "Bedroom", "parent": "page_1", "order": "a4", "type": "room", "x": 2000, "y": 1500 } } }