@kensnzk/koyu 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/assets/plan/README.md +18 -0
- package/assets/plan/catalog.muro +87 -0
- package/assets/plan/library.muro +26 -0
- package/assets/plan/svg/bathtub.svg +9 -0
- package/assets/plan/svg/bed-double.svg +9 -0
- package/assets/plan/svg/bed-single.svg +8 -0
- package/assets/plan/svg/cabinet.svg +9 -0
- package/assets/plan/svg/chair.svg +8 -0
- package/assets/plan/svg/desk.svg +9 -0
- package/assets/plan/svg/hedge-2m.svg +7 -0
- package/assets/plan/svg/kitchen-sink.svg +10 -0
- package/assets/plan/svg/locker.svg +9 -0
- package/assets/plan/svg/office-chair.svg +25 -0
- package/assets/plan/svg/potted-plant.svg +14 -0
- package/assets/plan/svg/refrigerator.svg +10 -0
- package/assets/plan/svg/shelf.svg +9 -0
- package/assets/plan/svg/shrub-1m.svg +7 -0
- package/assets/plan/svg/sofa-2.svg +9 -0
- package/assets/plan/svg/sofa-3.svg +9 -0
- package/assets/plan/svg/table-rect.svg +7 -0
- package/assets/plan/svg/table-round.svg +7 -0
- package/assets/plan/svg/tree-3m.svg +8 -0
- package/assets/plan/svg/urinal.svg +9 -0
- package/assets/plan/svg/washing-machine-pan.svg +13 -0
- package/assets/plan/svg/washing-machine.svg +10 -0
- package/assets/plan/svg/washstand-500.svg +12 -0
- package/assets/plan/svg/washstand.svg +12 -0
- package/assets/plan/svg/wc-cabinet.svg +14 -0
- package/assets/plan/svg/wc.svg +9 -0
- package/dist/analysis/contracts.d.ts +1 -0
- package/dist/analysis/contracts.d.ts.map +1 -1
- package/dist/cli.js +16 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/components.d.ts +31 -0
- package/dist/core/components.d.ts.map +1 -0
- package/dist/core/components.js +167 -0
- package/dist/core/components.js.map +1 -0
- package/dist/core/derive.d.ts +13 -2
- package/dist/core/derive.d.ts.map +1 -1
- package/dist/core/derive.js +36 -5
- package/dist/core/derive.js.map +1 -1
- package/dist/core/diagnose.d.ts +7 -0
- package/dist/core/diagnose.d.ts.map +1 -1
- package/dist/core/diagnose.js +141 -5
- package/dist/core/diagnose.js.map +1 -1
- package/dist/core/diff.d.ts +4 -0
- package/dist/core/diff.d.ts.map +1 -1
- package/dist/core/diff.js +4 -0
- package/dist/core/diff.js.map +1 -1
- package/dist/core/fabric.js +1 -1
- package/dist/core/fabric.js.map +1 -1
- package/dist/core/graph.d.ts +8 -0
- package/dist/core/graph.d.ts.map +1 -1
- package/dist/core/graph.js +31 -1
- package/dist/core/graph.js.map +1 -1
- package/dist/core/light.d.ts.map +1 -1
- package/dist/core/light.js +2 -0
- package/dist/core/light.js.map +1 -1
- package/dist/core/model.d.ts +20 -14
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/model.js +15 -8
- package/dist/core/model.js.map +1 -1
- package/dist/core/parse.d.ts.map +1 -1
- package/dist/core/parse.js +23 -4
- package/dist/core/parse.js.map +1 -1
- package/dist/core/vocabulary.d.ts +20 -4
- package/dist/core/vocabulary.d.ts.map +1 -1
- package/dist/core/vocabulary.js +107 -9
- package/dist/core/vocabulary.js.map +1 -1
- package/dist/draw/component-files.d.ts +8 -0
- package/dist/draw/component-files.d.ts.map +1 -0
- package/dist/draw/component-files.js +35 -0
- package/dist/draw/component-files.js.map +1 -0
- package/dist/draw/component-svg.d.ts +14 -0
- package/dist/draw/component-svg.d.ts.map +1 -0
- package/dist/draw/component-svg.js +67 -0
- package/dist/draw/component-svg.js.map +1 -0
- package/dist/draw/conventions/architectural.d.ts +32 -0
- package/dist/draw/conventions/architectural.d.ts.map +1 -0
- package/dist/draw/conventions/architectural.js +29 -0
- package/dist/draw/conventions/architectural.js.map +1 -0
- package/dist/draw/index.d.ts +1 -1
- package/dist/draw/index.d.ts.map +1 -1
- package/dist/draw/index.js +1 -1
- package/dist/draw/index.js.map +1 -1
- package/dist/draw/marks.d.ts +37 -12
- package/dist/draw/marks.d.ts.map +1 -1
- package/dist/draw/marks.js +508 -38
- package/dist/draw/marks.js.map +1 -1
- package/dist/draw/plan.d.ts +3 -1
- package/dist/draw/plan.d.ts.map +1 -1
- package/dist/draw/plan.js +257 -86
- package/dist/draw/plan.js.map +1 -1
- package/dist/form.d.ts +1 -1
- package/dist/form.d.ts.map +1 -1
- package/dist/form.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.js +22 -3
- package/dist/mcp.js.map +1 -1
- package/dist/parse-file.d.ts +1 -0
- package/dist/parse-file.d.ts.map +1 -1
- package/dist/parse-file.js +1 -0
- package/dist/parse-file.js.map +1 -1
- package/dist/validate/assessment.js +13 -2
- package/dist/validate/assessment.js.map +1 -1
- package/dist/validate/builtin/index.d.ts +4 -2
- package/dist/validate/builtin/index.d.ts.map +1 -1
- package/dist/validate/builtin/index.js +9 -2
- package/dist/validate/builtin/index.js.map +1 -1
- package/dist/validate/builtin/opening-operations.d.ts +63 -0
- package/dist/validate/builtin/opening-operations.d.ts.map +1 -0
- package/dist/validate/builtin/opening-operations.js +406 -0
- package/dist/validate/builtin/opening-operations.js.map +1 -0
- package/dist/validate/contracts.d.ts +1 -0
- package/dist/validate/contracts.d.ts.map +1 -1
- package/dist/validate/contracts.js.map +1 -1
- package/editors/vscode/syntaxes/koyu.tmLanguage.json +4 -4
- package/examples/basement/main.muro +3 -3
- package/examples/complex/L1.muro +1 -1
- package/examples/complex/assets.muro +2 -2
- package/examples/complex/main.muro +1 -1
- package/examples/house/L1.muro +3 -3
- package/examples/house/L2.muro +2 -2
- package/examples/house/assets.muro +8 -8
- package/examples/house/main.muro +1 -1
- package/examples/house/site.muro +2 -2
- package/examples/house.muro +6 -6
- package/examples/mansion.muro +1 -1
- package/examples/office.muro +1 -1
- package/examples/spatial/layout.muro +8 -0
- package/examples/spatial/main.muro +4 -0
- package/examples/steps/06-finished.muro +1 -1
- package/examples/tower/assets.muro +1 -1
- package/examples/tower/main.muro +1 -1
- package/examples/twin/assets.muro +2 -2
- package/examples/twin/main.muro +1 -1
- package/examples/two-rooms.canonical.json +1 -1
- package/examples/two-rooms.muro +1 -1
- package/package.json +9 -5
- package/src/analysis/contracts.ts +1 -0
- package/src/cli.ts +15 -4
- package/src/core/components.ts +224 -0
- package/src/core/derive.ts +53 -6
- package/src/core/diagnose.ts +185 -5
- package/src/core/diff.ts +3 -0
- package/src/core/fabric.ts +1 -1
- package/src/core/graph.ts +32 -0
- package/src/core/light.ts +1 -0
- package/src/core/model.ts +23 -13
- package/src/core/parse.ts +21 -4
- package/src/core/vocabulary.ts +115 -9
- package/src/draw/component-files.ts +36 -0
- package/src/draw/component-svg.ts +79 -0
- package/src/draw/conventions/architectural.ts +60 -0
- package/src/draw/index.ts +1 -1
- package/src/draw/marks.ts +564 -44
- package/src/draw/plan.ts +262 -89
- package/src/form.ts +1 -0
- package/src/index.ts +1 -1
- package/src/mcp.ts +22 -3
- package/src/parse-file.ts +1 -0
- package/src/validate/assessment.ts +17 -3
- package/src/validate/builtin/index.ts +14 -2
- package/src/validate/builtin/opening-operations.ts +519 -0
- package/src/validate/contracts.ts +1 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate an SVG before it is embedded as an isolated image. Isolation preserves Figma-style
|
|
3
|
+
* defs, masks and clip paths without letting IDs collide with the plan sheet.
|
|
4
|
+
*/
|
|
5
|
+
export function componentSvg(asset, source) {
|
|
6
|
+
const text = source.trim();
|
|
7
|
+
const root = /<svg\b([^>]*)>/i.exec(text);
|
|
8
|
+
if (!root)
|
|
9
|
+
throw new Error(`Component asset ${asset.name} plan-svg does not contain an svg root`);
|
|
10
|
+
const number = "[+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?";
|
|
11
|
+
const viewBox = new RegExp(`\\bviewBox\\s*=\\s*["']\\s*(${number})\\s+(${number})\\s+(${number})\\s+(${number})\\s*["']`, "i").exec(root[1]);
|
|
12
|
+
if (!viewBox)
|
|
13
|
+
throw new Error(`Component asset ${asset.name} plan-svg requires a positive viewBox`);
|
|
14
|
+
const width = Number(viewBox[3]);
|
|
15
|
+
const height = Number(viewBox[4]);
|
|
16
|
+
if (!(width > 0 && height > 0))
|
|
17
|
+
throw new Error(`Component asset ${asset.name} plan-svg requires a positive viewBox`);
|
|
18
|
+
const forbidden = [
|
|
19
|
+
/<!DOCTYPE/i,
|
|
20
|
+
/<!ENTITY/i,
|
|
21
|
+
/<script\b/i,
|
|
22
|
+
/<foreignObject\b/i,
|
|
23
|
+
/<(?:animate|animateMotion|animateTransform|set)\b/i,
|
|
24
|
+
/\s(?:[A-Za-z_][\w.-]*:)?on[a-z]+\s*=/i,
|
|
25
|
+
/javascript\s*:/i,
|
|
26
|
+
/@import\b/i,
|
|
27
|
+
];
|
|
28
|
+
if (forbidden.some((pattern) => pattern.test(text))) {
|
|
29
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains active or external content`);
|
|
30
|
+
}
|
|
31
|
+
for (const match of text.matchAll(/\b(?:href|src)\s*=\s*["']([^"']+)["']/gi)) {
|
|
32
|
+
const value = match[1];
|
|
33
|
+
if (!safeReference(value)) {
|
|
34
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains an external reference: ${value}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const match of text.matchAll(/url\(\s*([^)]+?)\s*\)/gi)) {
|
|
38
|
+
const value = match[1].replace(/^["']|["']$/g, "").trim();
|
|
39
|
+
if (!safeReference(value)) {
|
|
40
|
+
throw new Error(`Component asset ${asset.name} plan-svg contains an external reference: ${value}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const w = asset.attrs["w"];
|
|
44
|
+
const d = asset.attrs["d"];
|
|
45
|
+
if (typeof w !== "number" || !(w > 0) || typeof d !== "number" || !(d > 0)) {
|
|
46
|
+
throw new Error(`Component asset ${asset.name} requires positive w: and d:`);
|
|
47
|
+
}
|
|
48
|
+
const sourceRatio = width / height;
|
|
49
|
+
const physicalRatio = w / d;
|
|
50
|
+
const ratioError = Math.abs(sourceRatio - physicalRatio) / physicalRatio;
|
|
51
|
+
if (ratioError > 0.001) {
|
|
52
|
+
throw new Error(`Component asset ${asset.name} plan-svg viewBox ratio ${round(sourceRatio)} does not match w:d ratio ${round(physicalRatio)}`);
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
dataUri: `data:image/svg+xml,${encodeURIComponent(text).replace(/'/g, "%27").replace(/"/g, "%22")}`,
|
|
56
|
+
viewBox: { width, height },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function safeReference(value) {
|
|
60
|
+
if (value.startsWith("#"))
|
|
61
|
+
return true;
|
|
62
|
+
return /^data:image\/(?:png|jpeg|webp|gif);base64,/i.test(value);
|
|
63
|
+
}
|
|
64
|
+
function round(value) {
|
|
65
|
+
return Math.round(value * 10000) / 10000;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=component-svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-svg.js","sourceRoot":"","sources":["../../src/draw/component-svg.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAY,EAAE,MAAc;IACvD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC3B,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,KAAK,CAAC,IAAI,wCAAwC,CAAC,CAAC;IAClG,MAAM,MAAM,GAAG,qDAAqD,CAAC;IACrE,MAAM,OAAO,GAAG,IAAI,MAAM,CACxB,+BAA+B,MAAM,SAAS,MAAM,SAAS,MAAM,SAAS,MAAM,WAAW,EAC7F,GAAG,CACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,CAAC;IACjB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AC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,6CAA6C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,KAAK,CAAC,KAAa;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ArchitecturalPlanConvention {
|
|
2
|
+
readonly openings: {
|
|
3
|
+
/** Clear paper distance from the wall face to a sliding panel, in model millimetres. */
|
|
4
|
+
readonly slidingGapMm: number;
|
|
5
|
+
/** Extra overlap used to make two bypass leaves legible as separate panels. */
|
|
6
|
+
readonly bypassOverlapRatio: number;
|
|
7
|
+
/** Length of an automatic-door direction chevron relative to the aperture width. */
|
|
8
|
+
readonly automaticDirectionRatio: number;
|
|
9
|
+
/** Meeting point of the larger leaf in an unequal pair, measured from the first jamb. */
|
|
10
|
+
readonly unequalLeafMeetingRatio: number;
|
|
11
|
+
};
|
|
12
|
+
readonly stairs: {
|
|
13
|
+
/** How far an arrow enters a landing, relative to the narrower adjoining flight. */
|
|
14
|
+
readonly landingOffsetFlightWidthRatio: number;
|
|
15
|
+
readonly breakGlyph: {
|
|
16
|
+
/** Rotation from the line that crosses the flight. */
|
|
17
|
+
readonly angleDegrees: number;
|
|
18
|
+
/** Source-glyph proportions. The glyph is scaled to the flight width. */
|
|
19
|
+
readonly width: number;
|
|
20
|
+
readonly height: number;
|
|
21
|
+
readonly notch: number;
|
|
22
|
+
};
|
|
23
|
+
readonly arrowHead: {
|
|
24
|
+
/** SVG-space sizes: legibility belongs to paper, not to the building model. */
|
|
25
|
+
readonly length: number;
|
|
26
|
+
readonly halfWidth: number;
|
|
27
|
+
readonly startRadius: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare const ARCHITECTURAL_PLAN_CONVENTION: ArchitecturalPlanConvention;
|
|
32
|
+
//# sourceMappingURL=architectural.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architectural.d.ts","sourceRoot":"","sources":["../../../src/draw/conventions/architectural.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,QAAQ,EAAE;QACjB,wFAAwF;QACxF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,+EAA+E;QAC/E,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;QACpC,oFAAoF;QACpF,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;QACzC,yFAAyF;QACzF,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;KAC1C,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE;QACf,oFAAoF;QACpF,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;QAC/C,QAAQ,CAAC,UAAU,EAAE;YACnB,sDAAsD;YACtD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;YAC9B,yEAAyE;YACzE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;SACxB,CAAC;QACF,QAAQ,CAAC,SAAS,EAAE;YAClB,+EAA+E;YAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;SAC9B,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,2BAqB3C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Shared architectural plan conventions.
|
|
2
|
+
//
|
|
3
|
+
// These values describe paper symbols, never building geometry. They live outside core and Form
|
|
4
|
+
// so another drawing convention can replace them without changing a `.muro` file, canonical JSON,
|
|
5
|
+
// circulation, area or validation. The current set is broadly shared architectural practice; a
|
|
6
|
+
// jurisdiction module should override only a convention that is actually different.
|
|
7
|
+
export const ARCHITECTURAL_PLAN_CONVENTION = {
|
|
8
|
+
openings: {
|
|
9
|
+
slidingGapMm: 60,
|
|
10
|
+
bypassOverlapRatio: 0.12,
|
|
11
|
+
automaticDirectionRatio: 0.08,
|
|
12
|
+
unequalLeafMeetingRatio: 2 / 3,
|
|
13
|
+
},
|
|
14
|
+
stairs: {
|
|
15
|
+
landingOffsetFlightWidthRatio: 0.5,
|
|
16
|
+
breakGlyph: {
|
|
17
|
+
angleDegrees: 30,
|
|
18
|
+
width: 10,
|
|
19
|
+
height: 40,
|
|
20
|
+
notch: 3.5,
|
|
21
|
+
},
|
|
22
|
+
arrowHead: {
|
|
23
|
+
length: 8,
|
|
24
|
+
halfWidth: 3.5,
|
|
25
|
+
startRadius: 2.8,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=architectural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"architectural.js","sourceRoot":"","sources":["../../../src/draw/conventions/architectural.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,gGAAgG;AAChG,kGAAkG;AAClG,+FAA+F;AAC/F,oFAAoF;AAiCpF,MAAM,CAAC,MAAM,6BAA6B,GAAgC;IACxE,QAAQ,EAAE;QACR,YAAY,EAAE,EAAE;QAChB,kBAAkB,EAAE,IAAI;QACxB,uBAAuB,EAAE,IAAI;QAC7B,uBAAuB,EAAE,CAAC,GAAG,CAAC;KAC/B;IACD,MAAM,EAAE;QACN,6BAA6B,EAAE,GAAG;QAClC,UAAU,EAAE;YACV,YAAY,EAAE,EAAE;YAChB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,GAAG;SACX;QACD,SAAS,EAAE;YACT,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,GAAG;YACd,WAAW,EAAE,GAAG;SACjB;KACF;CACF,CAAC"}
|
package/dist/draw/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { svgPlan, type PlanOptions } from "./plan.js";
|
|
2
|
-
export { planMarks,
|
|
2
|
+
export { planMarks, SLIDE_GAP, type Mark, type MarkArc, type MarkNote, type MarkOptions, type MarkRole, type MarkSubject, } from "./marks.js";
|
|
3
3
|
export { svgAxo, type AxoOptions } from "./axo.js";
|
|
4
4
|
export { sceneOf, type Scene, type SceneFacts, type SceneLevel, type SceneLine, type SceneMark, type SceneNode, type ScenePrism, type SceneRole, type SceneSubject, } from "./scene.js";
|
|
5
5
|
export { svgSection, svgElevation, type ElevationOptions, type LineSectionOptions, type SectionGuide, type SectionOptions, } from "./section.js";
|
package/dist/draw/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,OAAO,EACP,KAAK,KAAK,EACV,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/draw/index.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// ルートからも同じものが出ている (`@kensnzk/koyu`)。分けてあるのは、
|
|
8
8
|
// **凍る面と凍らない面を、import 一行で見分けられるようにするため**である。
|
|
9
9
|
export { svgPlan } from "./plan.js";
|
|
10
|
-
export { planMarks,
|
|
10
|
+
export { planMarks, SLIDE_GAP, } from "./marks.js";
|
|
11
11
|
export { svgAxo } from "./axo.js";
|
|
12
12
|
export { sceneOf, } from "./scene.js";
|
|
13
13
|
export { svgSection, svgElevation, } from "./section.js";
|
package/dist/draw/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,2CAA2C;AAC3C,uBAAuB;AACvB,EAAE;AACF,6CAA6C;AAC7C,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/draw/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,uEAAuE;AACvE,2CAA2C;AAC3C,uBAAuB;AACvB,EAAE;AACF,6CAA6C;AAC7C,6CAA6C;AAE7C,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,SAAS,EACT,SAAS,GAOV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAmB,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,OAAO,GAUR,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,YAAY,GAKb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC"}
|
package/dist/draw/marks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Form, type PlanClass, type PlanEntity } from "../core/derive.js";
|
|
2
2
|
import { type Pt } from "../core/model.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type RunDevice, type Seg2 } from "../core/vertical.js";
|
|
4
4
|
/**
|
|
5
5
|
* A mark's role. The consumer decides stroke weight, colour, dash and every word from it.
|
|
6
6
|
*
|
|
@@ -26,16 +26,40 @@ export type MarkRole =
|
|
|
26
26
|
| "open"
|
|
27
27
|
/** the band of a segment that does not count */
|
|
28
28
|
| "seg"
|
|
29
|
-
/** a
|
|
29
|
+
/** a window opening, carrying the Form polygon whose two long edges continue the wall faces */
|
|
30
30
|
| "window"
|
|
31
31
|
/** hinge to leaf tip */
|
|
32
32
|
| "door-leaf"
|
|
33
33
|
/** the swing trace */
|
|
34
34
|
| "door-arc"
|
|
35
|
-
/** a sliding door's
|
|
35
|
+
/** a sliding door's closed leaf */
|
|
36
36
|
| "slide-panel"
|
|
37
|
-
/**
|
|
38
|
-
| "slide-
|
|
37
|
+
/** the short line across the centre of a sliding leaf */
|
|
38
|
+
| "slide-centre"
|
|
39
|
+
/** its travel into the pocket */
|
|
40
|
+
| "slide-tail"
|
|
41
|
+
/** the direction in which an automatic door opens */
|
|
42
|
+
| "auto-direction"
|
|
43
|
+
/** a general entrance threshold, without a claimed door operation */
|
|
44
|
+
| "entrance"
|
|
45
|
+
/** a gate jamb or post */
|
|
46
|
+
| "gate-post"
|
|
47
|
+
/** a vertically coiling shutter at the opening line */
|
|
48
|
+
| "rolling-shutter"
|
|
49
|
+
/** a sectional door that rises above the opening */
|
|
50
|
+
| "overhead-door"
|
|
51
|
+
/** an operable window leaf */
|
|
52
|
+
| "window-leaf"
|
|
53
|
+
/** an operable window's swing trace */
|
|
54
|
+
| "window-arc"
|
|
55
|
+
/** a sliding or projecting window sash */
|
|
56
|
+
| "window-sash"
|
|
57
|
+
/** the centre mark of a fixed window */
|
|
58
|
+
| "window-fixed"
|
|
59
|
+
/** a curtain-wall mullion at an explicitly divided panel boundary */
|
|
60
|
+
| "curtain-wall-mullion"
|
|
61
|
+
/** the meeting or overlap mark between window sashes */
|
|
62
|
+
| "window-sash-centre" | "column" | "run-outline" | "run-tread"
|
|
39
63
|
/** where the plane crosses the run — one line; making two of it is the consumer's convention */
|
|
40
64
|
| "run-break" | "run-arrow"
|
|
41
65
|
/** a seat only. The note has no geometry, and no words either */
|
|
@@ -52,7 +76,7 @@ export type MarkSubject = "space" | "boundary" | "opening" | "column" | "run" |
|
|
|
52
76
|
* belongs to them, not here.
|
|
53
77
|
*/
|
|
54
78
|
export type MarkNote =
|
|
55
|
-
/** direction
|
|
79
|
+
/** direction shown by an arrow; stair presentation always points towards the upper landing */
|
|
56
80
|
{
|
|
57
81
|
of: "direction";
|
|
58
82
|
up: boolean;
|
|
@@ -81,7 +105,7 @@ export interface Mark {
|
|
|
81
105
|
ref: string;
|
|
82
106
|
/**
|
|
83
107
|
* The classification `Form` gave the subject, carried through unchanged. Marks with no backing
|
|
84
|
-
* entity (`seg`, `void-hatch`, the
|
|
108
|
+
* entity (`seg`, `void-hatch`, the sliding marks) carry `"cut"` — they show at the cut.
|
|
85
109
|
*/
|
|
86
110
|
class: PlanClass;
|
|
87
111
|
polygon?: Pt[];
|
|
@@ -107,15 +131,16 @@ export interface Mark {
|
|
|
107
131
|
};
|
|
108
132
|
}
|
|
109
133
|
/**
|
|
110
|
-
*
|
|
134
|
+
* Clear distance from a wall face to a sliding door's panel, mm.
|
|
111
135
|
*
|
|
112
136
|
* **A drafting convention, not a derivation default.** It is not in the ledger of derivation
|
|
113
|
-
* constants because no shape of the building depends on it
|
|
137
|
+
* constants because no shape of the building depends on it. The actual offset from the wall
|
|
138
|
+
* centreline is half the opening's wall thickness plus this gap.
|
|
114
139
|
*/
|
|
115
|
-
export declare const
|
|
140
|
+
export declare const SLIDE_GAP: number;
|
|
116
141
|
export interface MarkOptions {
|
|
117
|
-
/** override `
|
|
118
|
-
|
|
142
|
+
/** override `SLIDE_GAP` */
|
|
143
|
+
slideGap?: number;
|
|
119
144
|
}
|
|
120
145
|
/**
|
|
121
146
|
* The marks drawn on one level's plan, from `Form`.
|
package/dist/draw/marks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/draw/marks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"marks.d.ts","sourceRoot":"","sources":["../../src/draw/marks.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAQ,KAAK,IAAI,EAAiD,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpI,OAAO,EAAc,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAW,KAAK,SAAS,EAAgB,KAAK,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAGvF;;;;;GAKG;AACH,MAAM,MAAM,QAAQ;AAClB,uCAAuC;AACrC,OAAO;AACT,uEAAuE;GACrE,oBAAoB;AACtB,4EAA4E;GAC1E,eAAe;AACjB,2CAA2C;GACzC,YAAY;AACd,iGAAiG;GAC/F,YAAY;AACd,gDAAgD;GAC9C,MAAM;AACR,kEAAkE;GAChE,MAAM;AACR,8EAA8E;GAC5E,MAAM;AACR,gDAAgD;GAC9C,KAAK;AACP,+FAA+F;GAC7F,QAAQ;AACV,wBAAwB;GACtB,WAAW;AACb,sBAAsB;GACpB,UAAU;AACZ,mCAAmC;GACjC,aAAa;AACf,yDAAyD;GACvD,cAAc;AAChB,iCAAiC;GAC/B,YAAY;AACd,qDAAqD;GACnD,gBAAgB;AAClB,qEAA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