A check of security and of speed, and the words brought up to date; 0.6.0 (asked for: "check for speed and performance, also security" and "also update everything: about, help, guide text etc.").

Security. Looked for: code run from text (none: no eval, no Function made from text), text written into the page as markup, pages and messages from elsewhere, links opened, what is fetched, the packages' known faults (npm audit: none).
- A project file can come from anyone, and three things in one reached the page as markup. A body's colour was written into a tool's button ("<span style=background:...>"): a file with markup for a colour had it on the page when that body's tools were listed. A colour is given to the swatch as a colour now; and a project read from a file keeps only colours that are colours ("#rgb", "#rrggbb", "#rrggbbaa") and see-through levels that are numbers - anything else is dropped. A drawing's ids and its text's size, weight and colour went into the sheet's SVG as they were: escaped now, as its texts were.
- The site sends security headers on every file: a Content-Security-Policy (only the site's own scripts run - none written into the page, none from another site, no plugins; pictures and the Browser window's pages may come from anywhere, they are what the user opens), nosniff, and a referrer that names only the site. 'unsafe-eval' is in it for the geometry engine, which builds part of itself as it starts: without it the engine did not start (tried). With the policy, on a build served with these headers: the app opened, the engine started, the tutorial's first 24 steps were built (sketches, extrudes, chamfers), the Technical Sheet and Drawings opened - no violation reported.
- Found sound: the Browser window opens http and https pages only, in a sandboxed frame; links open with noopener; the About page escapes its text.

Speed. Measured, on a ten-step part:
- A change that leaves the model's steps as they were - a body renamed, coloured or hidden, a material, a joint, an assembly's pose (saved at the end of every drag), a pin - went to the geometry engine and back all the same: about a fifth of a second each. What is shown is brought up to date from the model there is now, the engine not asked (only when the model on the screen is the project's own, and none is being made). A change to a step still makes the model again; undo and redo as before.
- Nothing to change: the tutorial's work each frame and an assembly's parts placed on each move of a drag are a few thousandths of a millisecond; nothing is drawn while nothing happens, with the tutorial open or not.

Words. Help: Insert (Image on plane, File, Project), Assemblies (the pose is kept; Joint from two picked faces; where the parts are shown while a tool is open), the tutorial (New project at its end). About (the README): the tutorial, BIM and Assemblies, Insert, what a .super file holds, the project's joints and pose for scripts.

In the app: a project loaded with markup for a body's colour, its see-through level and a material's colour - none of it kept, nothing run, the body's tools listed; a pose saved five times - no engine call, the pose there; a colour and a name changed - shown, no engine call; a step's size changed and undone - the model made again each time. tests: joints, linked, sketchfollow, holepattern pass.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
superGeometry
2026-11-23 17:01:43 +02:00
parent 27eb88e5c5
commit 6b796c06cf
9 changed files with 105 additions and 21 deletions
+32 -3
View File
@@ -30,7 +30,10 @@ think in 3D: brackets, boxes, vases, knobs, threads, enclosures, furniture parts
15. [For developers](#for-developers)
16. [License](#license)
Inside the app, **More → Help** shows what every button does.
Inside the app, **More → Help** shows what every button does, and **More →
Tutorial** builds a first part with you: an M10 bolt and the nut that fits it,
one lit tap at a time (the first time the app is opened, it is offered once
the welcome window is closed).
---
@@ -330,6 +333,22 @@ sketch. A sketch stays in view until every region of it is used.
shows as a solid face with a thick outline. **Place Plane** on the line
puts a construction plane where the cut is (to sketch on or split with).
- **Measure** - distances and angles; pin a measurement to keep it.
- **BIM** (under More) - **Materials**: a real material for each body, which
gives it its mass. **Technical Sheet**: the parts list with masses and the
materials' data. **Drawings**: sheets with views, dimensions, item numbers
and a title block.
- **Assemblies** (More → BIM, still being tried out) - how the parts move.
The parts stay where you modelled them; a **joint** only says how two of
them move against each other. **Add joint**, tap a face on each part, and
the kind is read off the faces: two round faces on one axis, or two flat
faces one above the other, make a **Hinge** (a **Screw** of the thread's
pitch when one part is threaded); two flat faces side by side, a **Slide**;
anything else, **Fixed**. Drag a part to move it by its joint, or type its
angle or distance; **Limits** keep it between two values; **Follows** makes
one joint go with another by a ratio (gears); **Explode** pulls the parts
apart. The pose is kept with the project and shown after OK; **Home** puts
every part back where it was modelled. No weight or forces, and parts pass
through each other.
---
@@ -401,8 +420,12 @@ can't be rebuilt after a change, it's marked and the reason is shown.
File → Export DXF. Construction lines go on their own layer.
- **File → New project** starts an empty one; the open project stays in the
gallery.
- **Insert** brings in STEP, STL, SVG and DXF files, and images to trace over
(on the floor, front or side, its middle at the X / Y you type).
- **More → Insert** brings in files (STEP, STL, OBJ, 3MF, DXF, SVG), another
project's parts (**Project**), and pictures to trace over (**Image on
plane**: on the floor, front or side, its middle at the X / Y you type).
- A **.super** file is the whole project: every step and sketch, variables,
saved views, names, colours, and the BIM side - materials, drawings, joints
and the assembly's pose.
---
@@ -516,6 +539,12 @@ three.js view. Units are millimetres internally; the display unit is a setting.
`parallel`), `axis`, `moveFace` (face / edge / vertex), `scaleFace`,
`replaceFace`, `deleteGeom`, `freeform` (`cage`, `surface`, `thickness`,
`symmetry {origin, normal}`), `thread`, `repair`, `import`, `image`.
- Beside `features`, the project holds `joints` (`type`: `fixed`, `hinge`,
`slide`, `screw`; the two bodies `a` and `b`; the joint's line `origin`,
`axis`; `min`, `max`; a screw's `pitch`; `drive {joint, ratio}`), `ground`
(the body that stands still) and `pose {values, exploded}` (each joint's
value by its id: degrees, or mm for a slide). They move what is shown, not
the model.
- Faces and edges are referenced by geometry, not index:
faces `{body, center, normal, area}`, edges `{body, mid, dir, length}`.
- `exprs` maps a field path (`"distance"`, `"op.translate.2"`) to an
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "supergeometry",
"version": "0.5.0",
"version": "0.6.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "supergeometry",
"version": "0.5.0",
"version": "0.6.0",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@fontsource/bebas-neue": "^5.3.0",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "supergeometry",
"private": true,
"version": "0.5.0",
"version": "0.6.0",
"description": "Free, browser-based solid modeler for every device.",
"license": "AGPL-3.0-or-later",
"type": "module",
+11
View File
@@ -25,3 +25,14 @@
/version.json
Cache-Control: no-cache
# Security, on every file.
# - What the page may load and run: its own files only. No script written into the page runs (a project file from
# someone else that got markup onto the page could do nothing with it), no script from another site, no plugins.
# 'unsafe-eval' is for the geometry engine, which builds part of itself as it starts ('wasm-unsafe-eval': its
# WebAssembly). Pictures and the Browser window's pages may come from anywhere: they are what the user opens.
# - Files are what they say they are (nosniff); other sites are told only the site's address, not the page's.
/*
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https: http:; font-src 'self' data:; connect-src 'self' data: blob:; worker-src 'self' blob:; frame-src https: http:; media-src 'self' data: blob:; object-src 'none'; base-uri 'self'; form-action 'none'
X-Content-Type-Options: nosniff
Referrer-Policy: strict-origin-when-cross-origin
+22 -2
View File
@@ -689,9 +689,21 @@ export class App implements AppContext {
// New planes, sketches and names show in Items now, not once a long rebuild
// has finished (a plane just made wasn't there to tap for seconds).
this.items.render(this.result);
// A change that leaves the model's steps as they were - a body renamed, coloured or hidden, a material, a joint,
// an assembly's pose, a pin, a saved view - needs no model made again: what is shown is brought up to date from
// the model there is. (Each of them went to the engine and back: a fifth of a second on a ten-step part.)
const steps = JSON.stringify([this.store.doc.features, this.store.doc.variables]);
// (Only the project's own model: one a tool is trying out is not the project's.)
if (this.result && this.result === this.made && !this.regenerating && steps === this.madeFor) return this.apply(this.result, this.store.doc.features);
this.madeFor = steps;
void this.regenerate();
}
/** The steps (and variables) the model on the screen was asked for, as text; and how many askings are under way. */
private madeFor = "";
private made: RegenResult | null = null;
private regenerating = 0;
/** The tags where the variables act on the model as it is now (Variables on). */
private showVariableTags(): void {
if (this.varsOn && this.result) this.varTags.set(variableTags(this.store.doc.variables, this.store.doc.features, this.result));
@@ -734,8 +746,16 @@ export class App implements AppContext {
private async regenerate(): Promise<void> {
const features = this.store.doc.features;
const r = await this.kernel.regenerate(features, true);
if (r) this.apply(r, features);
this.regenerating++;
let r: RegenResult | null = null;
try {
r = await this.kernel.regenerate(features, true);
} finally {
this.regenerating--;
}
if (r) ((this.made = r), this.apply(r, features));
// (Not made - stopped, or overtaken: the next change asks again, whatever it is.)
else this.madeFor = "";
}
/** Sketches the engine moved the curves of (they follow a body): those curves, by the sketch as it was sent. */
+9 -9
View File
@@ -530,7 +530,7 @@ function placePath(d: string, p: Placed): string {
function text(x: number, y: number, t: string, size: number, opts: { anchor?: string; angle?: number; weight?: string; fill?: string } = {}): string {
const rot = opts.angle ? ` transform="rotate(${f(opts.angle)} ${f(x)} ${f(y)})"` : "";
return `<text x="${f(x)}" y="${f(y)}" font-size="${size}" ${FONT} text-anchor="${opts.anchor ?? "start"}"${opts.weight ? ` font-weight="${opts.weight}"` : ""} fill="${opts.fill ?? "#000"}"${rot}>${esc(t)}</text>`;
return `<text x="${f(x)}" y="${f(y)}" font-size="${f(+size)}" ${FONT} text-anchor="${esc(String(opts.anchor ?? "start"))}"${opts.weight ? ` font-weight="${esc(String(opts.weight))}"` : ""} fill="${esc(String(opts.fill ?? "#000"))}"${rot}>${esc(t)}</text>`;
}
/** A rough width of a text (Arial: about 0.55 of its size a letter). */
@@ -751,7 +751,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
for (const im of o.images) {
const sel = data.interactive && data.selected === im.id;
const svg = `<image href="${esc(im.src)}" x="${f(im.x)}" y="${f(im.y)}" width="${f(im.w)}" height="${f(im.h)}" preserveAspectRatio="none"/>${sel ? `<rect x="${f(im.x)}" y="${f(im.y)}" width="${f(im.w)}" height="${f(im.h)}" fill="none" stroke="${SEL}" stroke-width="0.4" stroke-dasharray="2 1"/>` : ""}`;
out.push(data.interactive ? `<g data-ann="${im.id}">${svg}</g>` : svg);
out.push(data.interactive ? `<g data-ann="${esc(String(im.id))}">${svg}</g>` : svg);
}
for (const p of L.views) {
const v = views.get(p.src ?? p.id);
@@ -789,7 +789,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
}
if (sec) g.push(text((r.x0 + r.x1) / 2, r.y1 + 8, `${sec.letter}-${sec.letter}`, 5, { anchor: "middle", fill: c }));
if (det) g.push(text((r.x0 + r.x1) / 2, r.y1 + 8, `${det.letter} (${scaleLabel(p.s)})`, 5, { anchor: "middle", fill: c }));
out.push(data.interactive ? `<g data-view="${p.id}">${g.join("")}</g>` : g.join("\n"));
out.push(data.interactive ? `<g data-view="${esc(String(p.id))}">${g.join("")}</g>` : g.join("\n"));
}
// ---- Where the sections are cut (ISO 128-40: a chain line, thick at its
@@ -799,7 +799,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
const p = placed.get(sec.view);
if (!p || !placed.has(sec.id)) continue;
const c = color(`view:${sec.id}`);
out.push(`<g${data.interactive ? ` data-view="${sec.id}"` : ""}>${cutLine(toPaper(p, sec.a), toPaper(p, sec.b), sec.look, sec.letter, lw, c)}</g>`);
out.push(`<g${data.interactive ? ` data-view="${esc(String(sec.id))}"` : ""}>${cutLine(toPaper(p, sec.a), toPaper(p, sec.b), sec.look, sec.letter, lw, c)}</g>`);
}
for (const det of o.details) {
const p = placed.get(det.view);
@@ -809,7 +809,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
const R = det.r * p.s;
const at: [number, number] = [C[0] + (R + 2.5) * Math.SQRT1_2, C[1] - (R + 2.5) * Math.SQRT1_2];
out.push(
`<g${data.interactive ? ` data-view="${det.id}"` : ""}><circle cx="${f(C[0])}" cy="${f(C[1])}" r="${f(R)}" stroke="${c}" stroke-width="${lw.dims}" fill="none"/>${text(at[0], at[1], det.letter, 5, { fill: c })}</g>`,
`<g${data.interactive ? ` data-view="${esc(String(det.id))}"` : ""}><circle cx="${f(C[0])}" cy="${f(C[1])}" r="${f(R)}" stroke="${c}" stroke-width="${lw.dims}" fill="none"/>${text(at[0], at[1], det.letter, 5, { fill: c })}</g>`,
);
}
@@ -818,7 +818,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
const p = placed.get(m.view);
if (!p) continue;
const svg = markSVG(m, p, lw.center, color(m.id));
out.push(data.interactive ? `<g data-ann="${m.id}">${svg}</g>` : svg);
out.push(data.interactive ? `<g data-ann="${esc(String(m.id))}">${svg}</g>` : svg);
}
// ---- Overall dimensions (width and height on the front view, depth on the
@@ -828,13 +828,13 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
if (!p) continue;
const c = color(d.id);
const svg = dimSVG(d, p, o, c);
out.push(data.interactive ? `<g data-ann="${d.id}">${svg}</g>` : svg);
out.push(data.interactive ? `<g data-ann="${esc(String(d.id))}">${svg}</g>` : svg);
}
// ---- Notes (pointing at what they are about).
for (const n of o.notes) {
const svg = noteSVG(n, n.to ? placed.get(n.to.view) : undefined, lw.dims, color(n.id));
out.push(data.interactive ? `<g data-ann="${n.id}">${svg}</g>` : svg);
out.push(data.interactive ? `<g data-ann="${esc(String(n.id))}">${svg}</g>` : svg);
}
// ---- Balloons: item numbers of the parts list, each on the isometric view - or,
@@ -921,7 +921,7 @@ export function drawingSVG(data: SheetData): { svg: string; layout: Layout; ball
`<circle cx="${f(b.at[0])}" cy="${f(b.at[1])}" r="0.6" fill="${c}"/>` +
`<circle cx="${f(bx)}" cy="${f(by)}" r="4" stroke="${c}" stroke-width="0.35" fill="#fff"/>` +
text(bx, by + 1.4, String(b.item), 4, { anchor: "middle", fill: c });
out.push(data.interactive ? `<g data-ann="${id}">${svg}</g>` : svg);
out.push(data.interactive ? `<g data-ann="${esc(String(id))}">${svg}</g>` : svg);
balloonsAt.push({ id, x: bx, y: by });
}
}
+18
View File
@@ -410,7 +410,25 @@ export function parseProject(text: string): ProjectDoc {
// ------------------------------------------------------------------ migration
/** Bring any saved project up to the current format. */
/**
* A project file can come from anyone: what the app later puts on the page as a colour is kept to what a colour
* is ("#rrggbb"), and what it uses as a number is a number. Anything else is dropped (the body is the default grey).
*/
function cleanLooks(doc: ProjectDoc): void {
const hex = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i;
const record = (v: unknown): v is Record<string, unknown> => !!v && typeof v === "object" && !Array.isArray(v);
if (doc.colors !== undefined) doc.colors = record(doc.colors) ? Object.fromEntries(Object.entries(doc.colors).filter((e): e is [string, string] => typeof e[1] === "string" && hex.test(e[1]))) : undefined;
if (doc.opacity !== undefined) doc.opacity = record(doc.opacity) ? Object.fromEntries(Object.entries(doc.opacity).filter((e): e is [string, number] => typeof e[1] === "number" && Number.isFinite(e[1]))) : undefined;
if (Array.isArray(doc.customMaterials)) for (const m of doc.customMaterials) if (typeof m.color !== "string" || !hex.test(m.color)) m.color = "#9aa3ad";
}
export function migrate(raw: unknown): ProjectDoc {
const out = migrate0(raw);
cleanLooks(out);
return out;
}
function migrate0(raw: unknown): ProjectDoc {
const doc = raw as ProjectDoc & { version: number };
// "tessel" is the format name of files saved before the rename.
if (!doc || (doc.format !== "super" && (doc.format as string) !== "tessel") || !Array.isArray(doc.features)) throw new Error("Not a superGeometry.app project file");
+3 -3
View File
@@ -28,7 +28,7 @@ const SECTIONS: { title: string; intro?: string; items: Entry[] }[] = [
{ icon: "body", name: "Items", text: "Every body, sketch, plane and image, with an eye to hide or show it. Each kind (Bodies, Sketches, Planes & axes, Images) folds away under its heading; a plane's icon shows how it was made. Group things into folders (Select, tick them, New folder); tick items all in one folder for New subfolder inside it. Remove takes ticked items out of their folder (one level up); Move, then tick a folder or subfolder, puts them in it. A tool waiting for a body takes one tapped here. What is selected in the view (a body double-clicked, a plane) lights up in the list." },
{ icon: "more", name: "More", text: "Fullscreen (also in the window the app opens with), Update (loads the newest version - when one is out, More pulses and this item shows NEW), this Help, Feedback (a bug report, suggestion or discussion, posted on r/supergeometry), About, and support links." },
{ icon: "tools", name: "The line", text: "The line at the bottom is how every tool is reached. Tap part of the model (a face, an edge, a body, a sketch's shape): a tag over the line names what is picked, and the line shows the groups - Sketch, Freeform, Transform, Construct, Modify, Combine, Create - each a list: what can be done with that pick first, then the group's other tools in a quieter part (each of those asks for its own pick as it starts; with nothing picked: all the tools). The group whose list is open stays lit, and a list inside another says where it is (Transform › Pattern). More, at the end, holds only what is not on the line already: Insert, BIM, Section View, Measure, Variables, Print / Share, and the pick's own (Delete, Colour). Tap a tool and the line becomes its settings: tap a number to type it (or drag it sideways), tap a word to change it, tap the model to fill a blank. On a phone held upright a tool shows its size and what it still needs tapped; the rest is one word, Options. The tick finishes, the cross takes it back, the x on the tag lets go of the pick. With the pointer over a tool, some show in dashed yellow on the model what they would do (Extrude, Offset Face, Shell, Fillet, Chamfer, the patterns). At the right edge: Fit, Display and Settings (units & grid, snapping, the numpad, appearance)." },
{ icon: "tools", name: "Tutorial", text: "More > Tutorial builds an M10 bolt and the nut that fits it with you, in their real sizes, one tap at a time, with tools from Sketch, Create, Modify and Combine: a rod, a hexagon head, chamfered edges, a thread, and a nut cut to fit with 0.2 mm of room so the printed pair turns. The screen is dimmed but for the spot to tap next, with a short sentence beside it; the shapes land exactly where they belong wherever in the lit spot you tap, the head's and the nut's thickness are set for you, and a size typed wrong is set right. It starts a new project (the one open is saved); Exit tutorial leaves it at any step. The first time the app is opened it is offered once the welcome window is closed." },
{ icon: "tools", name: "Tutorial", text: "More > Tutorial builds an M10 bolt and the nut that fits it with you, in their real sizes, one tap at a time, with tools from Sketch, Create, Modify and Combine: a rod, a hexagon head, chamfered edges, a thread, and a nut cut to fit with 0.2 mm of room so the printed pair turns. The screen is dimmed but for the spot to tap next, with a short sentence beside it; the shapes land exactly where they belong wherever in the lit spot you tap, the head's and the nut's thickness are set for you, and a size typed wrong is set right. It starts a new project (the one open is saved); Exit tutorial leaves it at any step. Where a tap lands inside the lit spot does not matter. At the end, New project starts one of your own (the bolt and nut stay in the list of projects). The first time the app is opened it is offered once the welcome window is closed." },
],
},
{
@@ -47,7 +47,7 @@ const SECTIONS: { title: string; intro?: string; items: Entry[] }[] = [
{ icon: "tools", name: "Split, Fill, Thread, Repair, Offset", text: "Split Body (by a plane or face), Fill to Plane (an open freeform surface filled down to a plane becomes a solid), Thread (tap a round face or a hole's rim: ISO pitch, outside or inside, left-hand as an option; free ends get a 45° lead-in), Repair Body (fixes an imported or broken body without changing its shape), Offset Face, Offset Edge (tap a straight edge, then a flat face: a line on that face parallel to the edge at the distance you drag with its double arrow or type, running right across the face from edge to edge - it splits the face into shapes to extrude or cut; with a face selected it's Offset from Edge: tap the edge next)." },
{ icon: "patternLinear", name: "Pattern a hole, thread starts", text: "Tap the round wall of a hole, then Pattern - Linear or Circular: the hole is repeated in its body (the same depth), not the body copied. Thread has Starts: 1 is a bolt's thread; 2 to 8 are that many threads side by side, the crests still a pitch apart - a jar's lid, on in part of a turn." },
{ icon: "construct", name: "Construct", text: "Helper planes - offset, midplane, through 3 points, on a curve, perpendicular to an edge, through an edge at an angle, parallel to a face - each with its own mark at a corner. Tap a plane you made: its gimbal moves it (the blue arrow changes its offset) or turns it; with Copy on beside it a drag makes a new plane, selected after so the next drag copies again; and axes (from a face or edge, or along X / Y / Z through a point you type)." },
{ icon: "insert", name: "Insert", text: "Images to trace over (on the floor, front or side, at the X / Y you type), STEP/STL/SVG/DXF files." },
{ icon: "insert", name: "Insert", text: "More › Insert. Image on plane: a picture to trace over (on the floor, front or side, at the X / Y you type). File: STEP, STL, OBJ, 3MF, DXF and SVG files. Project: another .super project's parts, brought into this one." },
{ icon: "refImage", name: "Reference Image", text: "More › Insert › Reference Image: a picture in its own window over the model (under the buttons), to look at while you model. Drag it by its top bar or the picture, resize it from the corner, minimize it to its bar. Zoom the picture with the mouse wheel or a pinch; zoomed in, drag it to look about; double click or double tap to see it whole. More pictures are tabs along the top (+ adds one); drag a tab out to give it a window of its own, or onto another window's tabs to join them. They stay on this device until you close them, and are not part of the project." },
],
},
@@ -116,7 +116,7 @@ const SECTIONS: { title: string; intro?: string; items: Entry[] }[] = [
{ icon: "variable", name: "Rename a variable", text: "Variables > Rename: type a new name over an old one. Everything that uses it - other variables, sizes, sketch dimensions, a pattern's count - says the new name, and nothing changes size." },
{ icon: "isolate", name: "Print / Share", text: "Says whether the model is fit to print - each body closed and solid, or what is wrong with it and where to mend it - its size, and the files to take it away as: 3MF or STL for printing, STEP for other CAD programs, Picture for a PNG of the view." },
{ icon: "views", name: "Drawings", text: "Pick a body, then More › Create Drawing: a sheet with its views, overall sizes, item numbers and title block. Tools are on the left (Views, Dimensions, Centrelines, Note, Image); the sheet's settings on the right under Properties. A dimension, a note, a picture or an item number moves when you drag it - with a tool still on, too - and stays on the paper; the arrows nudge what is picked (Shift: further). Tap a view for its handle and scale. Double-tap a note or a dimension to change its text; a picked note has A− and A+ for the size of its letters; a moved item number has Put back. Esc puts the tool down, then lets go of the pick, then leaves the drawing." },
{ icon: "assembly", name: "Assemblies", text: "More › BIM › Assemblies (still being tried out). The parts stay where you modelled them: a joint only says how two of them move. Add joint, tap a face on each part, and the kind is read off the faces - two round faces on one axis, or two flat faces one above the other: a Hinge (a Screw, of the thread's pitch, when one part is threaded); two flat faces side by side: a Slide along the first one's normal; anything else: Fixed. Change the Type whenever you like. Drag a part to move it by its joint, or type its Angle or Distance; Limits keep it between two values; Flip turns the joint's line round. Follows makes a joint go with another by a Ratio (a gear: minus the ratio of the teeth). Explode pulls the parts apart along their joints. Stands still says which part doesn't move. Moving is a pose, not a change to the model: Home, or leaving Assemblies, has every part where it was modelled. No weight or forces, and parts go through each other." },
{ icon: "assembly", name: "Assemblies", text: "More › BIM › Assemblies (still being tried out). The parts stay where you modelled them: a joint only says how two of them move. Add joint, tap a face on each part, and the kind is read off the faces - two round faces on one axis, or two flat faces one above the other: a Hinge (a Screw, of the thread's pitch, when one part is threaded); two flat faces side by side: a Slide along the first one's normal; anything else: Fixed. Change the Type whenever you like. Drag a part to move it by its joint, or type its Angle or Distance; Limits keep it between two values; Flip turns the joint's line round. Follows makes a joint go with another by a Ratio (a gear: minus the ratio of the teeth). Explode pulls the parts apart along their joints. Stands still says which part doesn't move. Two faces picked on two parts have Joint among their tools as well. Moving is a pose, not a change to the model, and it is kept with the project: the parts stay as you left them after OK, and Assemblies opens with them that way. While something is picked or a tool is open the parts are shown where they were modelled (a tool's arrows and sizes are there), and go back to their pose after. Home puts every part where it was modelled. Exports, measurements and drawings use the modelled position. No weight or forces, and parts go through each other." },
{ icon: "isolate", name: "Isolate", text: "Show only the selected bodies (and sketches drawn on their faces - tap a shape on one to extrude, offset... it); tap again to show everything." },
],
},
+7 -1
View File
@@ -1971,7 +1971,13 @@ function toolButton(item: ToolItem, withLabel: boolean): HTMLButtonElement {
b.classList.toggle("has-children", !!item.children?.length);
b.classList.toggle("disabled", !!item.disabled);
b.title = item.disabled && item.why ? item.why : item.shortcut ? `${item.label} (${item.shortcut})` : item.label;
b.innerHTML = item.swatch ? `<span class="swatch" style="background:${item.swatch}"></span>` : icons[item.icon];
// (A colour comes from the project - a file someone else may have made: it is given to the swatch as a colour,
// never written into the page as markup.)
if (item.swatch) {
const sw = el("span", "swatch");
sw.style.background = item.swatch;
b.replaceChildren(sw);
} else b.innerHTML = icons[item.icon];
if (withLabel) {
const l = el("span", "tool-label");
const top = el("span", "tool-name", item.label);