drawing-axi 0.1.0 → 0.1.1
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.md +1 -1
- package/dist/commands/measure.js +2 -1
- package/dist/drawing/sizes.js +6 -4
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -118,7 +118,7 @@ sized_by[3]{group,size,label,labelled_m,runs}:
|
|
|
118
118
|
- **Runs.** A pipe is plotted as dashes, and broken where a letter or a label sits on it. A run joins pieces that lie on one line and end near each other, and is measured end to end. A break with a linetype letter in it, such as the F of a fire line, is joined up to twice as wide. Curved pipe and runs shorter than 6 mm on paper are left out.
|
|
119
119
|
- **Scale.** The ratio comes from the title block. A plot is often a little off its stated scale, so the factor is refined from the printed scale bar when one is found. `drawing-axi scale` shows both. Pass `--scale 1:N` or `--pt-per-m` when the sheet is wrong or silent.
|
|
120
120
|
- **Sizes.** A run takes the size of a label written along it: just beside the line, or in a break left in the line for it. A line that passes through the middle of a label's text is another pipe, and takes nothing. A run without a label takes the size of the runs of its own group that it touches, when they all agree. `labelled_m` is the part sized by a label of its own.
|
|
121
|
-
- **System codes.** A label such as `F-Ø4"` or `CW1-Ø3"` starts with its system's code. Name a group by that code (`--group F=<layer>`, `--group CW=<layer>`) and it takes only those labels, and no other group takes them. Digits and dots do not count: `C.W.2` is `CW`. A coded label that sits on no run, as one on a leader does, is listed under `labels_apart`: the sheet names that size for the system, and does not say which pipe. It is a size to confirm, not a measured one.
|
|
121
|
+
- **System codes.** A label such as `F-Ø4"` or `CW1-Ø3"` starts with its system's code. Name a group by that code (`--group F=<layer>`, `--group CW=<layer>`) and it takes only those labels, and no other group takes them. Digits and dots do not count: `C.W.2` is `CW`. A label written in a break of a line still sizes that line, whatever its group is called. A coded label that sits on no run, as one on a leader does, is listed under `labels_apart`: the sheet names that size for the system, and does not say which pipe. It is a size to confirm, not a measured one.
|
|
122
122
|
- **Unsized.** What no label sizes is reported as `unsized`. The tool never guesses a size.
|
|
123
123
|
- **Not on a plan.** Vertical lengths, fittings, hangers and insulation are not drawn to scale on a plan. `tags` and `symbols` count what the sheet marks; the rest needs rules or a person.
|
|
124
124
|
|
package/dist/commands/measure.js
CHANGED
|
@@ -221,7 +221,8 @@ export function measure(input) {
|
|
|
221
221
|
const group = label.code === null ? -1 : codes.indexOf(label.code);
|
|
222
222
|
if (group < 0)
|
|
223
223
|
continue;
|
|
224
|
-
|
|
224
|
+
// One row for each way the label is written: CW1 and C.W.2 are two rows.
|
|
225
|
+
const key = `${group}|${label.size}|${label.text}`;
|
|
225
226
|
const e = apart.get(key);
|
|
226
227
|
if (e)
|
|
227
228
|
e.labels++;
|
package/dist/drawing/sizes.js
CHANGED
|
@@ -103,15 +103,17 @@ placed) {
|
|
|
103
103
|
continue;
|
|
104
104
|
tried.add(index);
|
|
105
105
|
const groupCode = codes[out[index].group] ?? null;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
const score = fit(label, cx, cy, out[index], options);
|
|
107
|
+
// A label written in a break of a line is that line's, whatever
|
|
108
|
+
// the groups are called. Beside a line, a coded label belongs to
|
|
109
|
+
// the group of that code, when there is one, and never to a group
|
|
110
|
+
// of another code.
|
|
111
|
+
if (score >= 1 && label.code !== null) {
|
|
109
112
|
if (bound.has(label.code) && groupCode !== label.code)
|
|
110
113
|
continue;
|
|
111
114
|
if (groupCode !== null && groupCode !== label.code)
|
|
112
115
|
continue;
|
|
113
116
|
}
|
|
114
|
-
const score = fit(label, cx, cy, out[index], options);
|
|
115
117
|
if (score < bestScore) {
|
|
116
118
|
best = index;
|
|
117
119
|
bestScore = score;
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Kept equal to package.json by test/unit/version.test.ts.
|
|
2
|
-
export const VERSION = '0.1.
|
|
2
|
+
export const VERSION = '0.1.1';
|
package/package.json
CHANGED