@ifc-lite/create 2.9.2 → 3.2.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/dist/ifc-creator-alignment-referents.d.ts +35 -0
- package/dist/ifc-creator-alignment-referents.d.ts.map +1 -0
- package/dist/ifc-creator-alignment-referents.js +89 -0
- package/dist/ifc-creator-alignment-referents.js.map +1 -0
- package/dist/ifc-creator-alignment-vertical.d.ts +40 -0
- package/dist/ifc-creator-alignment-vertical.d.ts.map +1 -0
- package/dist/ifc-creator-alignment-vertical.js +182 -0
- package/dist/ifc-creator-alignment-vertical.js.map +1 -0
- package/dist/ifc-creator-alignment.d.ts +15 -0
- package/dist/ifc-creator-alignment.d.ts.map +1 -1
- package/dist/ifc-creator-alignment.js +27 -28
- package/dist/ifc-creator-alignment.js.map +1 -1
- package/dist/ifc-creator-math.d.ts +20 -0
- package/dist/ifc-creator-math.d.ts.map +1 -1
- package/dist/ifc-creator-math.js +62 -3
- package/dist/ifc-creator-math.js.map +1 -1
- package/dist/ifc-creator.d.ts.map +1 -1
- package/dist/ifc-creator.js +3 -7
- package/dist/ifc-creator.js.map +1 -1
- package/dist/in-store/_emit-helpers.d.ts +2 -1
- package/dist/in-store/_emit-helpers.d.ts.map +1 -1
- package/dist/in-store/_emit-helpers.js +7 -7
- package/dist/in-store/_emit-helpers.js.map +1 -1
- package/dist/in-store/anchor.d.ts +25 -0
- package/dist/in-store/anchor.d.ts.map +1 -1
- package/dist/in-store/column.d.ts +8 -0
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +16 -9
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/door.d.ts +10 -4
- package/dist/in-store/door.d.ts.map +1 -1
- package/dist/in-store/door.js +23 -17
- package/dist/in-store/door.js.map +1 -1
- package/dist/in-store/element-type.d.ts +40 -0
- package/dist/in-store/element-type.d.ts.map +1 -0
- package/dist/in-store/element-type.js +60 -0
- package/dist/in-store/element-type.js.map +1 -0
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +17 -15
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/hosted-fill.d.ts +48 -0
- package/dist/in-store/hosted-fill.d.ts.map +1 -0
- package/dist/in-store/hosted-fill.js +58 -0
- package/dist/in-store/hosted-fill.js.map +1 -0
- package/dist/in-store/material.d.ts +62 -0
- package/dist/in-store/material.d.ts.map +1 -0
- package/dist/in-store/material.js +107 -0
- package/dist/in-store/material.js.map +1 -0
- package/dist/in-store/opening.d.ts +45 -0
- package/dist/in-store/opening.d.ts.map +1 -0
- package/dist/in-store/opening.js +104 -0
- package/dist/in-store/opening.js.map +1 -0
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +19 -4
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/relate.d.ts +32 -0
- package/dist/in-store/relate.d.ts.map +1 -0
- package/dist/in-store/relate.js +39 -0
- package/dist/in-store/relate.js.map +1 -0
- package/dist/in-store/resolve-anchor.d.ts +21 -1
- package/dist/in-store/resolve-anchor.d.ts.map +1 -1
- package/dist/in-store/resolve-anchor.js +6 -2
- package/dist/in-store/resolve-anchor.js.map +1 -1
- package/dist/in-store/resolve-host.d.ts +5 -0
- package/dist/in-store/resolve-host.d.ts.map +1 -0
- package/dist/in-store/resolve-host.js +249 -0
- package/dist/in-store/resolve-host.js.map +1 -0
- package/dist/in-store/resolve-relations.d.ts +23 -0
- package/dist/in-store/resolve-relations.d.ts.map +1 -0
- package/dist/in-store/resolve-relations.js +57 -0
- package/dist/in-store/resolve-relations.js.map +1 -0
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +20 -4
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/schema-attributes.d.ts +28 -0
- package/dist/in-store/schema-attributes.d.ts.map +1 -0
- package/dist/in-store/schema-attributes.js +95 -0
- package/dist/in-store/schema-attributes.js.map +1 -0
- package/dist/in-store/spatial-zone.d.ts.map +1 -1
- package/dist/in-store/spatial-zone.js +5 -5
- package/dist/in-store/spatial-zone.js.map +1 -1
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +4 -14
- package/dist/in-store/wall.js.map +1 -1
- package/dist/in-store/window.d.ts +7 -0
- package/dist/in-store/window.d.ts.map +1 -1
- package/dist/in-store/window.js +24 -17
- package/dist/in-store/window.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/landxml/cant-superelevation.d.ts +28 -0
- package/dist/landxml/cant-superelevation.d.ts.map +1 -0
- package/dist/landxml/cant-superelevation.js +31 -0
- package/dist/landxml/cant-superelevation.js.map +1 -0
- package/dist/landxml/landxml-to-ifc.d.ts +8 -2
- package/dist/landxml/landxml-to-ifc.d.ts.map +1 -1
- package/dist/landxml/landxml-to-ifc.js +42 -4
- package/dist/landxml/landxml-to-ifc.js.map +1 -1
- package/dist/landxml/profile-geometry.d.ts +50 -0
- package/dist/landxml/profile-geometry.d.ts.map +1 -0
- package/dist/landxml/profile-geometry.js +221 -0
- package/dist/landxml/profile-geometry.js.map +1 -0
- package/dist/landxml/profile-mapping.d.ts +36 -0
- package/dist/landxml/profile-mapping.d.ts.map +1 -0
- package/dist/landxml/profile-mapping.js +181 -0
- package/dist/landxml/profile-mapping.js.map +1 -0
- package/dist/landxml/profile-record.d.ts +46 -0
- package/dist/landxml/profile-record.d.ts.map +1 -0
- package/dist/landxml/profile-record.js +38 -0
- package/dist/landxml/profile-record.js.map +1 -0
- package/dist/landxml/refusals.d.ts +5 -1
- package/dist/landxml/refusals.d.ts.map +1 -1
- package/dist/landxml/refusals.js +36 -8
- package/dist/landxml/refusals.js.map +1 -1
- package/dist/landxml/result-types.d.ts +49 -0
- package/dist/landxml/result-types.d.ts.map +1 -1
- package/dist/landxml/station-equations.d.ts +69 -0
- package/dist/landxml/station-equations.d.ts.map +1 -0
- package/dist/landxml/station-equations.js +140 -0
- package/dist/landxml/station-equations.js.map +1 -0
- package/dist/landxml/writers.d.ts +7 -1
- package/dist/landxml/writers.d.ts.map +1 -1
- package/dist/landxml/writers.js +22 -3
- package/dist/landxml/writers.js.map +1 -1
- package/dist/types.d.ts +13 -9
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -7
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* Which LandXML profiles become an `IfcAlignmentVertical`, and which are
|
|
6
|
+
* refused by name (mapping spec §12.2).
|
|
7
|
+
*
|
|
8
|
+
* Like `alignment-mapping.ts`, no STEP is written here, so the export dialog's
|
|
9
|
+
* pre-flight and the export itself give the same answer. The geometry lives in
|
|
10
|
+
* `profile-geometry.ts`; this module decides linkage and runs the mapping.
|
|
11
|
+
*/
|
|
12
|
+
import { ALIGNMENT_POSITION_TOLERANCE_M, isAlignmentRecord } from './alignment-mapping.js';
|
|
13
|
+
import { ProfileRefusal, assembleProfile, checkProfile, curveSegments, refuseProfile, } from './profile-geometry.js';
|
|
14
|
+
import { profileRecordProblem } from './profile-record.js';
|
|
15
|
+
import { distancesForStation } from './station-equations.js';
|
|
16
|
+
function mapDesignProfile(profile, distanceOf, horizontalLength, units) {
|
|
17
|
+
if (profile.pvis.length < 2)
|
|
18
|
+
refuseProfile('it has fewer than two PVIs, so it has no grade');
|
|
19
|
+
const vertices = profile.pvis.map((pvi, index) => {
|
|
20
|
+
if (pvi.elevation === null || !Number.isFinite(pvi.elevation) || !Number.isFinite(pvi.station)) {
|
|
21
|
+
refuseProfile(`its PVI ${index + 1} has no finite station and elevation`);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
sourceId: pvi.sourceId,
|
|
25
|
+
distAlong: distanceOf(pvi.station, `its PVI ${index + 1}`),
|
|
26
|
+
height: pvi.elevation * units.elevationScaleToMeters,
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
vertices.slice(1).forEach((vertex, index) => {
|
|
30
|
+
if (vertex.distAlong <= vertices[index].distAlong)
|
|
31
|
+
refuseProfile(`its PVI ${index + 2} does not advance in station`);
|
|
32
|
+
});
|
|
33
|
+
const start = vertices[0].distAlong;
|
|
34
|
+
const end = vertices[vertices.length - 1].distAlong;
|
|
35
|
+
if (start < -ALIGNMENT_POSITION_TOLERANCE_M || end > horizontalLength + ALIGNMENT_POSITION_TOLERANCE_M) {
|
|
36
|
+
refuseProfile(`it runs from ${start.toFixed(3)} m to ${end.toFixed(3)} m along an alignment ${horizontalLength.toFixed(3)} m long`);
|
|
37
|
+
}
|
|
38
|
+
const gradeOf = (a, b) => (b.height - a.height) / (b.distAlong - a.distAlong);
|
|
39
|
+
const curves = vertices.map(() => []);
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
profile.verticalCurves.forEach((curve, curveIndex) => {
|
|
42
|
+
const label = `vertical curve ${curveIndex + 1}`;
|
|
43
|
+
// The parser records a curve's PVI in `pvis` with the same station and
|
|
44
|
+
// elevation — the same pairing `rust/landxml`'s profile evaluator uses.
|
|
45
|
+
const index = profile.pvis.findIndex((pvi) => pvi.station === curve.station && pvi.elevation === curve.elevation);
|
|
46
|
+
if (index <= 0 || index >= vertices.length - 1) {
|
|
47
|
+
refuseProfile(`${label} is not at an interior PVI, so it has no grade on both sides`);
|
|
48
|
+
}
|
|
49
|
+
if (seen.has(index))
|
|
50
|
+
refuseProfile(`PVI ${index + 1} carries more than one vertical curve`);
|
|
51
|
+
seen.add(index);
|
|
52
|
+
const before = vertices[index - 1];
|
|
53
|
+
const pvi = vertices[index];
|
|
54
|
+
const after = vertices[index + 1];
|
|
55
|
+
curves[index] = curveSegments(curve, pvi, gradeOf(before, pvi), gradeOf(pvi, after), units, label);
|
|
56
|
+
});
|
|
57
|
+
const segments = assembleProfile(profile.sourceId, vertices, curves);
|
|
58
|
+
checkProfile(segments, vertices, curves);
|
|
59
|
+
return segments;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Map every profile onto the alignments `alignmentMapping` writes, and refuse
|
|
63
|
+
* the rest by name (§12.2). `alignments` is the source's raw list — a
|
|
64
|
+
* profile's link is checked against it, not only against the written ones, so
|
|
65
|
+
* a profile of a refused alignment says so rather than reading as unlinked.
|
|
66
|
+
*/
|
|
67
|
+
export function mapProfiles(profiles, alignments, alignmentMapping, units, stationing = new Map()) {
|
|
68
|
+
const result = { mapped: [], refused: [] };
|
|
69
|
+
const records = (alignments ?? []).filter(isAlignmentRecord);
|
|
70
|
+
const written = new Map(alignmentMapping.mapped.map((alignment) => [alignment.sourceId, alignment]));
|
|
71
|
+
const designCount = new Map();
|
|
72
|
+
const valid = [];
|
|
73
|
+
(profiles ?? []).forEach((candidate, index) => {
|
|
74
|
+
const problem = profileRecordProblem(candidate);
|
|
75
|
+
if (problem === null) {
|
|
76
|
+
valid.push(candidate);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const header = candidate;
|
|
80
|
+
const named = typeof header?.sourceId === 'string' && typeof header.name === 'string';
|
|
81
|
+
result.refused.push({
|
|
82
|
+
sourceId: named ? header.sourceId : `profile[${index}]`,
|
|
83
|
+
name: named ? header.name || header.sourceId : `profile ${index + 1}`,
|
|
84
|
+
reason: problem,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
// A profile is linked when its alignment exists and, if that alignment
|
|
88
|
+
// lists its profiles, lists this one. Only LINKED design profiles compete
|
|
89
|
+
// for the alignment's one vertical layout: an unlinked sibling is refused
|
|
90
|
+
// on its own and must not make the linked one look ambiguous (#5930 review).
|
|
91
|
+
const alignmentOf = (profile) => records.find((record) => record.sourceId === profile.parentAlignmentSourceId);
|
|
92
|
+
const isLinked = (profile) => {
|
|
93
|
+
const alignment = alignmentOf(profile);
|
|
94
|
+
const listed = alignment?.profileSourceIds ?? [];
|
|
95
|
+
return alignment !== undefined && (listed.length === 0 || listed.includes(profile.sourceId));
|
|
96
|
+
};
|
|
97
|
+
for (const profile of valid) {
|
|
98
|
+
if (profile.kind === 'design' && isLinked(profile)) {
|
|
99
|
+
designCount.set(profile.parentAlignmentSourceId, (designCount.get(profile.parentAlignmentSourceId) ?? 0) + 1);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
for (const profile of valid) {
|
|
103
|
+
const refuse = (reason) => {
|
|
104
|
+
result.refused.push({ sourceId: profile.sourceId, name: profile.name || profile.sourceId, reason });
|
|
105
|
+
};
|
|
106
|
+
const alignment = alignmentOf(profile);
|
|
107
|
+
// An empty `profileSourceIds` declares nothing; a non-empty one must agree.
|
|
108
|
+
if (!alignment || !isLinked(profile)) {
|
|
109
|
+
refuse('it is not linked to any alignment in the file');
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const alignmentName = alignment.name || alignment.sourceId;
|
|
113
|
+
const mapped = written.get(alignment.sourceId);
|
|
114
|
+
if (!mapped || units === null) {
|
|
115
|
+
refuse(`its alignment '${alignmentName}' is not written, so there is no horizontal to measure it along`);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (profile.kind === 'sampled') {
|
|
119
|
+
refuse('it is a sampled ground profile (ProfSurf), not a design vertical layout');
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const designs = designCount.get(alignment.sourceId) ?? 0;
|
|
123
|
+
if (designs > 1) {
|
|
124
|
+
refuse(`its alignment '${alignmentName}' has ${designs} design profiles, and IFC nests one vertical layout under an alignment; choosing one would be a guess`);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const horizontalLength = mapped.segments.reduce((total, segment) => total + segment.length, 0);
|
|
128
|
+
const distanceOf = profileDistances(alignment, mapped.startStation, horizontalLength, units, stationing);
|
|
129
|
+
if (typeof distanceOf === 'string') {
|
|
130
|
+
refuse(distanceOf);
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
result.mapped.push({
|
|
135
|
+
sourceId: profile.sourceId,
|
|
136
|
+
name: profile.name,
|
|
137
|
+
alignmentSourceId: alignment.sourceId,
|
|
138
|
+
segments: mapDesignProfile(profile, distanceOf, horizontalLength, units),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (!(error instanceof ProfileRefusal))
|
|
143
|
+
throw error;
|
|
144
|
+
refuse(error.message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* How a profile's stations become distances along its alignment (§14.5).
|
|
151
|
+
*
|
|
152
|
+
* Without station equations, linearly from the start station. With written
|
|
153
|
+
* ones, through the displayed stationing they define: a PVI station must occur
|
|
154
|
+
* at exactly one place along the alignment, and one in a forward jump's gap or
|
|
155
|
+
* displayed twice after a backward jump is refused by name, never guessed. When
|
|
156
|
+
* the alignment's equations were themselves refused (§14.2) there is no
|
|
157
|
+
* stationing to read the profile against, so it is refused as a whole.
|
|
158
|
+
*/
|
|
159
|
+
function profileDistances(alignment, startStation, length, units, stationing) {
|
|
160
|
+
const scale = units.linearScaleToMeters;
|
|
161
|
+
if ((alignment.stationEquations?.length ?? 0) === 0) {
|
|
162
|
+
return (station) => station * scale - startStation;
|
|
163
|
+
}
|
|
164
|
+
const alignmentName = alignment.name || alignment.sourceId;
|
|
165
|
+
const mapping = stationing.get(alignment.sourceId);
|
|
166
|
+
if (!mapping || mapping.refusal !== null) {
|
|
167
|
+
return `its alignment '${alignmentName}' has station equations that are not written, so its stations cannot be placed along it`;
|
|
168
|
+
}
|
|
169
|
+
return (station, label) => {
|
|
170
|
+
const places = distancesForStation(station * scale, startStation, mapping.equations, length);
|
|
171
|
+
if (places.length === 0) {
|
|
172
|
+
refuseProfile(`${label} is at station ${station}, which falls in a station-equation gap of '${alignmentName}'`);
|
|
173
|
+
}
|
|
174
|
+
if (places.length > 1) {
|
|
175
|
+
refuseProfile(`${label} is at station ${station}, which '${alignmentName}' displays at ${places.length} places `
|
|
176
|
+
+ `(${places.map((place) => `${place.toFixed(3)} m`).join(', ')}); choosing one would be a guess`);
|
|
177
|
+
}
|
|
178
|
+
return places[0];
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=profile-mapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-mapping.js","sourceRoot":"","sources":["../../src/landxml/profile-mapping.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;GAOG;AAEH,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAyB,MAAM,wBAAwB,CAAC;AAClH,OAAO,EACL,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,GAC5E,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAA0B,MAAM,qBAAqB,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAA+B,MAAM,wBAAwB,CAAC;AAwB1F,SAAS,gBAAgB,CACvB,OAA0B,EAAE,UAAsB,EAAE,gBAAwB,EAAE,KAAsB;IAEpG,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;QAAE,aAAa,CAAC,gDAAgD,CAAC,CAAC;IAC7F,MAAM,QAAQ,GAAoB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAChE,IAAI,GAAG,CAAC,SAAS,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/F,aAAa,CAAC,WAAW,KAAK,GAAG,CAAC,sCAAsC,CAAC,CAAC;QAC5E,CAAC;QACD,OAA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GAAG,mBAAmB,CAAC,OAAO,GAAG,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,aAAa,CAAC,GAAG,KAAK,kBAAkB,OAAO,+CAA+C,aAAa,GAAG,CAAC,CAAC;QAClH,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,aAAa,CACX,GAAG,KAAK,kBAAkB,OAAO,YAAY,aAAa,iBAAiB,MAAM,CAAC,MAAM,UAAU;kBAChG,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,kCAAkC,CAClG,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape of one `LandXmlIfcSource.profiles` record, and its run-time check
|
|
3
|
+
* (mapping spec §12).
|
|
4
|
+
*
|
|
5
|
+
* `profiles` stays `unknown[]` on the source (narrowing a published input type
|
|
6
|
+
* is a breaking change, #5370 review), so every record is checked here before
|
|
7
|
+
* the mapper reads it — exactly as `alignment-record.ts` does for alignments.
|
|
8
|
+
* A record that fails is refused by name, never read into.
|
|
9
|
+
*
|
|
10
|
+
* The shapes mirror the viewer's `LandXmlProfile` field for field, so the
|
|
11
|
+
* viewer's parsed document satisfies them without a translation layer.
|
|
12
|
+
*/
|
|
13
|
+
/** One `PVI` (or sampled station/elevation pair), in the file's declared units. */
|
|
14
|
+
export interface LandXmlIfcProfilePoint {
|
|
15
|
+
sourceId: string;
|
|
16
|
+
/** A STATION, not a distance along: `staStart` has not been subtracted. */
|
|
17
|
+
station: number;
|
|
18
|
+
elevation: number | null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A `ParaCurve`, `UnsymParaCurve` or `CircCurve`, anchored at its PVI. The
|
|
22
|
+
* parser also records that PVI in `pvis`, with the same station and elevation.
|
|
23
|
+
*/
|
|
24
|
+
export interface LandXmlIfcVerticalCurve {
|
|
25
|
+
sourceId: string;
|
|
26
|
+
kind: 'parabolic' | 'unsymmetrical_parabolic' | 'circular';
|
|
27
|
+
station: number;
|
|
28
|
+
elevation: number | null;
|
|
29
|
+
length: number | null;
|
|
30
|
+
lengthIn: number | null;
|
|
31
|
+
lengthOut: number | null;
|
|
32
|
+
radius: number | null;
|
|
33
|
+
}
|
|
34
|
+
/** A `ProfAlign` (`kind: 'design'`) or `ProfSurf` (`kind: 'sampled'`) under an alignment. */
|
|
35
|
+
export interface LandXmlIfcProfile {
|
|
36
|
+
sourceId: string;
|
|
37
|
+
parentAlignmentSourceId: string;
|
|
38
|
+
name: string;
|
|
39
|
+
kind: 'design' | 'sampled';
|
|
40
|
+
/** Authored order. */
|
|
41
|
+
pvis: readonly LandXmlIfcProfilePoint[];
|
|
42
|
+
verticalCurves: readonly LandXmlIfcVerticalCurve[];
|
|
43
|
+
}
|
|
44
|
+
/** Why this record is not a `LandXmlIfcProfile`, or `null` when it is. */
|
|
45
|
+
export declare function profileRecordProblem(value: unknown): string | null;
|
|
46
|
+
//# sourceMappingURL=profile-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-record.d.ts","sourceRoot":"","sources":["../../src/landxml/profile-record.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,mFAAmF;AACnF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,yBAAyB,GAAG,UAAU,CAAC;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,6FAA6F;AAC7F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC3B,sBAAsB;IACtB,IAAI,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACxC,cAAc,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACpD;AAqBD,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAgBlE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
const isObject = (value) => typeof value === 'object' && value !== null;
|
|
5
|
+
const isNumber = (value) => typeof value === 'number';
|
|
6
|
+
const isOptionalNumber = (value) => value === null || isNumber(value);
|
|
7
|
+
function isPoint(value) {
|
|
8
|
+
return isObject(value) && typeof value.sourceId === 'string' && isNumber(value.station)
|
|
9
|
+
&& isOptionalNumber(value.elevation);
|
|
10
|
+
}
|
|
11
|
+
function isCurve(value) {
|
|
12
|
+
return isObject(value) && typeof value.sourceId === 'string'
|
|
13
|
+
&& (value.kind === 'parabolic' || value.kind === 'unsymmetrical_parabolic' || value.kind === 'circular')
|
|
14
|
+
&& isNumber(value.station) && isOptionalNumber(value.elevation)
|
|
15
|
+
&& isOptionalNumber(value.length) && isOptionalNumber(value.lengthIn)
|
|
16
|
+
&& isOptionalNumber(value.lengthOut) && isOptionalNumber(value.radius);
|
|
17
|
+
}
|
|
18
|
+
/** Why this record is not a `LandXmlIfcProfile`, or `null` when it is. */
|
|
19
|
+
export function profileRecordProblem(value) {
|
|
20
|
+
if (!isObject(value)
|
|
21
|
+
|| typeof value.sourceId !== 'string'
|
|
22
|
+
|| typeof value.parentAlignmentSourceId !== 'string'
|
|
23
|
+
|| typeof value.name !== 'string'
|
|
24
|
+
|| (value.kind !== 'design' && value.kind !== 'sampled')
|
|
25
|
+
|| !Array.isArray(value.pvis)
|
|
26
|
+
|| !Array.isArray(value.verticalCurves)) {
|
|
27
|
+
return 'it is not a profile record (it needs a sourceId, a parentAlignmentSourceId, a name, a design or '
|
|
28
|
+
+ 'sampled kind, and PVI and vertical-curve lists)';
|
|
29
|
+
}
|
|
30
|
+
const badPoint = value.pvis.findIndex((point) => !isPoint(point));
|
|
31
|
+
if (badPoint !== -1)
|
|
32
|
+
return `its PVI ${badPoint + 1} is not a station/elevation record`;
|
|
33
|
+
const badCurve = value.verticalCurves.findIndex((curve) => !isCurve(curve));
|
|
34
|
+
if (badCurve !== -1)
|
|
35
|
+
return `its vertical curve ${badCurve + 1} is not a ParaCurve, UnsymParaCurve or CircCurve record`;
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=profile-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile-record.js","sourceRoot":"","sources":["../../src/landxml/profile-record.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmD/D,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC;AAClG,MAAM,QAAQ,GA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;WACrD,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;WAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC;QAC1C,OAAO,kGAAkG;cACrG,iDAAiD,CAAC;IACxD,CAAC;IACD,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,IAAI,QAAQ,KAAK,CAAC,CAAC;QAAE,OAAO,WAAW,QAAQ,GAAG,CAAC,oCAAoC,CAAC;IACxF,MAAM,QAAQ,GAAG,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,IAAI,QAAQ,KAAK,CAAC,CAAC;QAAE,OAAO,sBAAsB,QAAQ,GAAG,CAAC,yDAAyD,CAAC;IACxH,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import type { LandXmlIfcSource, LandXmlIfcSurface } from './source-types.js';
|
|
9
9
|
import type { LandXmlRefusal } from './result-types.js';
|
|
10
10
|
import { type AlignmentMapping, type RefusedAlignment } from './alignment-mapping.js';
|
|
11
|
+
import { type ProfileMapping, type RefusedProfile } from './profile-mapping.js';
|
|
12
|
+
import { type StationEquationMapping } from './station-equations.js';
|
|
11
13
|
/**
|
|
12
14
|
* A surface v1 can write: a rendered TIN with vertices and at least one
|
|
13
15
|
* VISIBLE face. A surface whose every face is an authored `<F i="true">` draws
|
|
@@ -24,12 +26,14 @@ export declare function isMappableSurface(surface: LandXmlIfcSurface): boolean;
|
|
|
24
26
|
*/
|
|
25
27
|
/** The alignment mapping for a source, computed the one way both the plan and the export use. */
|
|
26
28
|
export declare function alignmentMappingOf(source: LandXmlIfcSource): AlignmentMapping;
|
|
27
|
-
export declare function collectRefusals(source: LandXmlIfcSource, alignmentMapping?: AlignmentMapping): LandXmlRefusal[];
|
|
29
|
+
export declare function collectRefusals(source: LandXmlIfcSource, alignmentMapping?: AlignmentMapping, profileMapping?: ProfileMapping, stationing?: ReadonlyMap<string, StationEquationMapping>): LandXmlRefusal[];
|
|
28
30
|
/**
|
|
29
31
|
* Name each refused alignment and why. A count alone ("2 alignments") leaves
|
|
30
32
|
* the operator unable to tell a spiral type from a gap from a sign problem.
|
|
31
33
|
*/
|
|
32
34
|
export declare function alignmentRefusalMessage(refused: readonly RefusedAlignment[]): string;
|
|
35
|
+
/** Name each refused profile and why (§12.6), as alignments are. */
|
|
36
|
+
export declare function profileRefusalMessage(refused: readonly RefusedProfile[]): string;
|
|
33
37
|
/**
|
|
34
38
|
* The sentence shown when nothing in the source is mappable.
|
|
35
39
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../../src/landxml/refusals.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../../src/landxml/refusals.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAuB,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EACgD,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAClG,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAe,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAsCzF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAIrE;AAED;;;;;;GAMG;AACH,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAE7E;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAE,gBAA6C,EACzF,cAAc,GAAE,cAEf,EACD,UAAU,GAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAgD,GACrG,cAAc,EAAE,CA+ClB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAOpF;AAED,oEAAoE;AACpE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAKhF;AAcD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,MAAM,CAOzE"}
|
package/dist/landxml/refusals.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { cogoPointResolver, isAlignmentRecord, mapAlignments, } from './alignment-mapping.js';
|
|
5
|
+
import { mapProfiles } from './profile-mapping.js';
|
|
6
|
+
import { stationEquationsOf } from './station-equations.js';
|
|
7
|
+
import { CANT_REFUSAL_REASON, SUPERELEVATION_REFUSAL_REASON, cantRefusalMessage, superelevationRefusalMessage, } from './cant-superelevation.js';
|
|
5
8
|
/**
|
|
6
9
|
* Why each family is out of scope, in the operator's terms.
|
|
7
10
|
*
|
|
@@ -11,7 +14,7 @@ import { cogoPointResolver, isAlignmentRecord, mapAlignments, } from './alignmen
|
|
|
11
14
|
*/
|
|
12
15
|
const FAMILY_REASONS = {
|
|
13
16
|
alignments: 'an alignment is written only when every horizontal segment is a line, circular arc or clothoid that reproduces its authored end point; one that does not is refused whole, because a gap would make every later station wrong',
|
|
14
|
-
profiles: '
|
|
17
|
+
profiles: 'a profile is written, as IfcAlignmentVertical, only when it is the one design profile of a written alignment and its grades and vertical curves reproduce every authored PVI; one that does not is refused whole',
|
|
15
18
|
'cross-sections': 'cross sections have no v1 mapping — they are sampled along an alignment, which v1 does not carry',
|
|
16
19
|
roadways: 'roadways have no v1 mapping — they compose alignments and surfaces, and v1 carries only the surfaces',
|
|
17
20
|
parcels: 'parcel boundaries have no v1 mapping',
|
|
@@ -23,9 +26,9 @@ const FAMILY_REASONS = {
|
|
|
23
26
|
'surface-contours': 'surface contour lines are not written; only the triangulated surface itself is',
|
|
24
27
|
'non-rendered-surfaces': 'surfaces that carry no numeric, renderable triangulation (or whose every face is hidden) cannot become an IfcTriangulatedIrregularNetwork',
|
|
25
28
|
'unlocated-cgpoints': 'CgPoints that carry only a point reference and no coordinates of their own have nothing to place',
|
|
26
|
-
'station-equations': 'station equations are
|
|
27
|
-
cant:
|
|
28
|
-
superelevation:
|
|
29
|
+
'station-equations': "an alignment's station equations are written all or none, because a dropped one would make every later station wrong; the alignment is still written, with its start station only",
|
|
30
|
+
cant: CANT_REFUSAL_REASON,
|
|
31
|
+
superelevation: SUPERELEVATION_REFUSAL_REASON,
|
|
29
32
|
};
|
|
30
33
|
function countAcrossSurfaces(surfaces, pick) {
|
|
31
34
|
return surfaces.reduce((total, surface) => total + (pick(surface)?.length ?? 0), 0);
|
|
@@ -52,7 +55,7 @@ export function isMappableSurface(surface) {
|
|
|
52
55
|
export function alignmentMappingOf(source) {
|
|
53
56
|
return mapAlignments(source.alignments, source.units, false, cogoPointResolver(source.plan?.cogoPoints));
|
|
54
57
|
}
|
|
55
|
-
export function collectRefusals(source, alignmentMapping = alignmentMappingOf(source)) {
|
|
58
|
+
export function collectRefusals(source, alignmentMapping = alignmentMappingOf(source), profileMapping = mapProfiles(source.profiles, source.alignments, alignmentMapping, source.units, stationEquationsOf(source, alignmentMapping)), stationing = stationEquationsOf(source, alignmentMapping)) {
|
|
56
59
|
// Only the alignments that are WRITTEN carry these on into the IFC; a
|
|
57
60
|
// refused alignment takes its station equations and cant with it, and
|
|
58
61
|
// counting them twice would misstate what is missing.
|
|
@@ -62,10 +65,11 @@ export function collectRefusals(source, alignmentMapping = alignmentMappingOf(so
|
|
|
62
65
|
.filter((alignment) => written.has(alignment.sourceId));
|
|
63
66
|
const counts = [
|
|
64
67
|
['alignments', alignmentMapping.refused.length],
|
|
65
|
-
|
|
68
|
+
// Written as IfcReferents (§14) unless refused, all or none, per alignment.
|
|
69
|
+
['station-equations', writtenAlignments.reduce((n, a) => n + (stationing.get(a.sourceId)?.refusal ? (a.stationEquations?.length ?? 0) : 0), 0)],
|
|
66
70
|
['cant', writtenAlignments.filter((a) => a.cant || (a.cantStations?.length ?? 0) > 0).length],
|
|
67
71
|
['superelevation', writtenAlignments.reduce((n, a) => n + (a.superelevations?.length ?? 0), 0)],
|
|
68
|
-
['profiles',
|
|
72
|
+
['profiles', profileMapping.refused.length],
|
|
69
73
|
['cross-sections', (source.crossSections?.length ?? 0) + (source.crossSectionSurfaces?.length ?? 0)],
|
|
70
74
|
['roadways', source.roadways?.length ?? 0],
|
|
71
75
|
['parcels', source.plan?.parcels?.length ?? 0],
|
|
@@ -85,7 +89,15 @@ export function collectRefusals(source, alignmentMapping = alignmentMappingOf(so
|
|
|
85
89
|
count,
|
|
86
90
|
message: family === 'alignments'
|
|
87
91
|
? alignmentRefusalMessage(alignmentMapping.refused)
|
|
88
|
-
:
|
|
92
|
+
: family === 'profiles'
|
|
93
|
+
? profileRefusalMessage(profileMapping.refused)
|
|
94
|
+
: family === 'station-equations'
|
|
95
|
+
? stationEquationRefusalMessage(count, writtenAlignments, stationing)
|
|
96
|
+
: family === 'cant'
|
|
97
|
+
? cantRefusalMessage(writtenAlignments)
|
|
98
|
+
: family === 'superelevation'
|
|
99
|
+
? superelevationRefusalMessage(writtenAlignments)
|
|
100
|
+
: `${count} ${family.replace(/-/g, ' ')} record${count === 1 ? '' : 's'} will not be included: ${FAMILY_REASONS[family]}.`,
|
|
89
101
|
}));
|
|
90
102
|
}
|
|
91
103
|
/**
|
|
@@ -100,6 +112,22 @@ export function alignmentRefusalMessage(refused) {
|
|
|
100
112
|
return `${count} alignment record${count === 1 ? '' : 's'} will not be included (${named.join('; ')}). `
|
|
101
113
|
+ `${FAMILY_REASONS.alignments}.`;
|
|
102
114
|
}
|
|
115
|
+
/** Name each refused profile and why (§12.6), as alignments are. */
|
|
116
|
+
export function profileRefusalMessage(refused) {
|
|
117
|
+
const count = refused.length;
|
|
118
|
+
const named = refused.map((entry) => `'${entry.name}': ${entry.reason}`);
|
|
119
|
+
return `${count} profile record${count === 1 ? '' : 's'} will not be included (${named.join('; ')}). `
|
|
120
|
+
+ `${FAMILY_REASONS.profiles}.`;
|
|
121
|
+
}
|
|
122
|
+
/** Name each alignment whose station equations were refused, and why (§14.2). */
|
|
123
|
+
function stationEquationRefusalMessage(count, alignments, stationing) {
|
|
124
|
+
const named = alignments.flatMap((alignment) => {
|
|
125
|
+
const reason = stationing.get(alignment.sourceId)?.refusal;
|
|
126
|
+
return reason ? [`'${alignment.name || alignment.sourceId}': ${reason}`] : [];
|
|
127
|
+
});
|
|
128
|
+
return `${count} station equation record${count === 1 ? '' : 's'} will not be included (${named.join('; ')}). `
|
|
129
|
+
+ `${FAMILY_REASONS['station-equations']}.`;
|
|
130
|
+
}
|
|
103
131
|
/**
|
|
104
132
|
* The sentence shown when nothing in the source is mappable.
|
|
105
133
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../src/landxml/refusals.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EACL,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,GACpD,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"refusals.js","sourceRoot":"","sources":["../../src/landxml/refusals.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EACL,iBAAiB,EAAE,iBAAiB,EAAE,aAA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/**
|
|
48
|
+
* Design profiles written as `IfcAlignmentVertical` (§12). Optional for the
|
|
49
|
+
* same reason as `alignments`: read it as `coverage.profiles ?? 0`.
|
|
50
|
+
*/
|
|
51
|
+
profiles?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Georeferenced imagery draped on the terrain, recorded as provenance (§15.5).
|
|
55
|
+
* An imagery overlay is never a claim the LandXML contained it: LandXML has no
|
|
56
|
+
* raster element. The texture itself is written afterwards, by the appearance
|
|
57
|
+
* workspace's planner, on the TIN elements named in `surfaceElements`.
|
|
58
|
+
*/
|
|
59
|
+
export interface LandXmlIfcImagery {
|
|
60
|
+
/** The image file as the operator supplied it. */
|
|
61
|
+
sourceFileName: string;
|
|
62
|
+
/** SHA-256 (hex) of the supplied image bytes. */
|
|
63
|
+
sourceHash: string;
|
|
64
|
+
/** How the image was placed: its world file, or its GeoTIFF tags. */
|
|
65
|
+
placement: 'world file' | 'GeoTIFF';
|
|
66
|
+
/** The image's CRS as declared, e.g. `EPSG:2056`. */
|
|
67
|
+
crs: string;
|
|
68
|
+
/** The planar projection (§15.3), in the terrain CRS's native plan units. */
|
|
69
|
+
projection: {
|
|
70
|
+
crs: string;
|
|
71
|
+
origin: readonly [number, number];
|
|
72
|
+
axisU: readonly [number, number];
|
|
73
|
+
axisV: readonly [number, number];
|
|
74
|
+
extent: readonly [number, number];
|
|
75
|
+
};
|
|
76
|
+
/** Fraction of written TIN vertices on the image, 0–1. */
|
|
77
|
+
coveredFraction: number;
|
|
78
|
+
/** Set when the shipped image is not the supplied one (a GeoTIFF transcoded to PNG). */
|
|
79
|
+
shippedFileName?: string;
|
|
80
|
+
shippedHash?: string;
|
|
81
|
+
}
|
|
82
|
+
/** A written terrain surface and the `IfcGeographicElement` carrying it. */
|
|
83
|
+
export interface LandXmlIfcSurfaceElement {
|
|
84
|
+
/** The LandXML surface's source id, e.g. `landxml:surface:1`. */
|
|
85
|
+
sourceId: string;
|
|
86
|
+
/** Express id of its `IfcGeographicElement` in `content`. */
|
|
87
|
+
expressId: number;
|
|
47
88
|
}
|
|
48
89
|
/** What the produced file records about where it came from (§7). */
|
|
49
90
|
export interface LandXmlIfcProvenance {
|
|
@@ -55,11 +96,19 @@ export interface LandXmlIfcProvenance {
|
|
|
55
96
|
assumedLinearUnit: string | null;
|
|
56
97
|
coordinateOrderSwapped: boolean;
|
|
57
98
|
refusedFamilies: readonly LandXmlRefusedFamily[];
|
|
99
|
+
/** Imagery provenance (§15.5); absent when none was exported. */
|
|
100
|
+
imagery?: LandXmlIfcImagery;
|
|
58
101
|
}
|
|
59
102
|
export type LandXmlIfcResult = {
|
|
60
103
|
status: 'exported';
|
|
61
104
|
content: string;
|
|
62
105
|
coverage: LandXmlIfcCoverage;
|
|
106
|
+
/**
|
|
107
|
+
* Each written surface's element, so a caller can address it in
|
|
108
|
+
* `content` — the imagery export textures these (§15.5). Optional only so
|
|
109
|
+
* adding it is not a breaking change to a published result type.
|
|
110
|
+
*/
|
|
111
|
+
surfaceElements?: readonly LandXmlIfcSurfaceElement[];
|
|
63
112
|
provenance: LandXmlIfcProvenance;
|
|
64
113
|
refusals: readonly LandXmlRefusal[];
|
|
65
114
|
warnings: readonly LandXmlIfcWarning[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result-types.d.ts","sourceRoot":"","sources":["../../src/landxml/result-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,UAAU,GACV,gBAAgB,GAChB,UAAU,GACV,SAAS,GACT,WAAW,GACX,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,GACnB,MAAM,GACN,gBAAgB,CAAC;AAErB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,GAAG,cAAc,GAAG,qBAAqB,CAAC;IAC1F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"result-types.d.ts","sourceRoot":"","sources":["../../src/landxml/result-types.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,YAAY,GACZ,UAAU,GACV,gBAAgB,GAChB,UAAU,GACV,SAAS,GACT,WAAW,GACX,eAAe,GACf,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,GACnB,MAAM,GACN,gBAAgB,CAAC;AAErB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wEAAwE;AACxE,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,IAAI,EAAE,mBAAmB,GAAG,oBAAoB,GAAG,cAAc,GAAG,qBAAqB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c,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,sBAAsB,EAAE,OAAO,CAAC;IAChC,eAAe,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACjD,iEAAiE;IACjE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,MAAM,gBAAgB,GACxB;IACA,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B;;;;OAIG;IACH,eAAe,CAAC,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACtD,UAAU,EAAE,oBAAoB,CAAC;IACjC,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACxC,GACC;IACA,MAAM,EAAE,SAAS,CAAC;IAClB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IACpC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACxC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LandXML `StaEquation` → `IfcReferent` / `Pset_Stationing` parameters
|
|
3
|
+
* (mapping spec §14).
|
|
4
|
+
*
|
|
5
|
+
* Pure numbers, like `alignment-mapping.ts`: the export dialog's pre-flight
|
|
6
|
+
* and the export itself run this same function, so the refusal the dialog
|
|
7
|
+
* shows is the refusal the export gives.
|
|
8
|
+
*
|
|
9
|
+
* An alignment's equations are mapped ALL OR NONE (§14.2). Stationing is
|
|
10
|
+
* cumulative, so writing some and dropping one would make every station after
|
|
11
|
+
* the dropped one wrong in a file that looks complete.
|
|
12
|
+
*/
|
|
13
|
+
import { type AlignmentMapping, type MappedAlignment } from './alignment-mapping.js';
|
|
14
|
+
import type { LandXmlIfcAlignment, LandXmlIfcSource, LandXmlIfcUnits } from './source-types.js';
|
|
15
|
+
/**
|
|
16
|
+
* A `StaEquation` as the parser delivers it. `LandXmlIfcAlignment.stationEquations`
|
|
17
|
+
* stays `unknown[]` (narrowing a published input type is a breaking change), so
|
|
18
|
+
* each record is checked against this shape at run time instead.
|
|
19
|
+
*/
|
|
20
|
+
export interface LandXmlIfcStationEquation {
|
|
21
|
+
sourceId: string;
|
|
22
|
+
/** Where, in the alignment's continuous stationing (`staStart` + distance along). */
|
|
23
|
+
staInternal: number;
|
|
24
|
+
/** The station from here on. */
|
|
25
|
+
staAhead: number;
|
|
26
|
+
/** The station arriving here, when authored. */
|
|
27
|
+
staBack: number | null;
|
|
28
|
+
/** `'increasing'` / `'decreasing'` — the direction of stationing after this point. */
|
|
29
|
+
staIncrement: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** One station equation, in metres, ready for `Pset_Stationing`. */
|
|
32
|
+
export interface MappedStationEquation {
|
|
33
|
+
sourceId: string;
|
|
34
|
+
/** Distance along the alignment's basis curve from its start. */
|
|
35
|
+
distanceAlong: number;
|
|
36
|
+
/** `Pset_Stationing.Station` — the ahead station. */
|
|
37
|
+
station: number;
|
|
38
|
+
/** `Pset_Stationing.IncomingStation` — authored `staBack`, or derived (§14.1). */
|
|
39
|
+
incomingStation: number;
|
|
40
|
+
/** `Pset_Stationing.HasIncreasingStation`; `null` when `staIncrement` was not authored. */
|
|
41
|
+
increasing: boolean | null;
|
|
42
|
+
}
|
|
43
|
+
export interface StationEquationMapping {
|
|
44
|
+
/** Written equations, in order along the alignment. Empty when refused. */
|
|
45
|
+
equations: MappedStationEquation[];
|
|
46
|
+
/** How many equations the source carries on this alignment. */
|
|
47
|
+
count: number;
|
|
48
|
+
/** Why they were all refused, or `null` when they are written. */
|
|
49
|
+
refusal: string | null;
|
|
50
|
+
}
|
|
51
|
+
/** Map one WRITTEN alignment's station equations, all or none (§14.2). */
|
|
52
|
+
export declare function mapStationEquations(record: LandXmlIfcAlignment, alignment: MappedAlignment, units: LandXmlIfcUnits): StationEquationMapping;
|
|
53
|
+
/**
|
|
54
|
+
* The station-equation mapping of every WRITTEN alignment, by source id. A
|
|
55
|
+
* refused alignment takes its equations with it and is absent here: counting
|
|
56
|
+
* them again would misstate what is missing.
|
|
57
|
+
*/
|
|
58
|
+
export declare function stationEquationsOf(source: LandXmlIfcSource, alignmentMapping: AlignmentMapping): Map<string, StationEquationMapping>;
|
|
59
|
+
/**
|
|
60
|
+
* Every distance along the alignment at which the DISPLAYED `station` (metres)
|
|
61
|
+
* occurs, given its written station equations — `rust/landxml`'s
|
|
62
|
+
* `distances_for_station`, over the mapped (metre) values.
|
|
63
|
+
*
|
|
64
|
+
* Empty: the station falls in a forward jump's gap. More than one: a backward
|
|
65
|
+
* jump (or a change of direction) displays it twice. Only exactly one is a
|
|
66
|
+
* place (§12.2, §14.5).
|
|
67
|
+
*/
|
|
68
|
+
export declare function distancesForStation(station: number, startStation: number, equations: readonly MappedStationEquation[], length: number): number[];
|
|
69
|
+
//# sourceMappingURL=station-equations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"station-equations.d.ts","sourceRoot":"","sources":["../../src/landxml/station-equations.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAC8C,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAC/F,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhG;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,QAAQ,EAA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