@ifc-lite/create 3.2.0 → 4.0.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.md +9 -0
- package/dist/in-store/auto-space-detect.d.ts +1 -1
- package/dist/in-store/auto-space-detect.js +1 -1
- package/dist/in-store/beam.d.ts +10 -1
- package/dist/in-store/beam.d.ts.map +1 -1
- package/dist/in-store/beam.js +14 -25
- package/dist/in-store/beam.js.map +1 -1
- package/dist/in-store/column.d.ts +10 -1
- package/dist/in-store/column.d.ts.map +1 -1
- package/dist/in-store/column.js +23 -22
- package/dist/in-store/column.js.map +1 -1
- package/dist/in-store/copy-frame.d.ts +52 -0
- package/dist/in-store/copy-frame.d.ts.map +1 -0
- package/dist/in-store/copy-frame.js +99 -0
- package/dist/in-store/copy-frame.js.map +1 -0
- package/dist/in-store/copy-product.d.ts +96 -0
- package/dist/in-store/copy-product.d.ts.map +1 -0
- package/dist/in-store/copy-product.js +318 -0
- package/dist/in-store/copy-product.js.map +1 -0
- package/dist/in-store/curtain-wall.d.ts +87 -0
- package/dist/in-store/curtain-wall.d.ts.map +1 -0
- package/dist/in-store/curtain-wall.js +237 -0
- package/dist/in-store/curtain-wall.js.map +1 -0
- package/dist/in-store/extract-grids.d.ts +46 -0
- package/dist/in-store/extract-grids.d.ts.map +1 -0
- package/dist/in-store/extract-grids.js +211 -0
- package/dist/in-store/extract-grids.js.map +1 -0
- package/dist/in-store/extract-walls.d.ts +12 -23
- package/dist/in-store/extract-walls.d.ts.map +1 -1
- package/dist/in-store/extract-walls.js +6 -69
- package/dist/in-store/extract-walls.js.map +1 -1
- package/dist/in-store/generate-spaces.d.ts +1 -1
- package/dist/in-store/grid.d.ts +118 -0
- package/dist/in-store/grid.d.ts.map +1 -0
- package/dist/in-store/grid.js +194 -0
- package/dist/in-store/grid.js.map +1 -0
- package/dist/in-store/host-geometry-frame.d.ts +44 -0
- package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
- package/dist/in-store/host-geometry-frame.js +146 -0
- package/dist/in-store/host-geometry-frame.js.map +1 -0
- package/dist/in-store/hosted-element-edit.d.ts +29 -0
- package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-element-edit.js +120 -0
- package/dist/in-store/hosted-element-edit.js.map +1 -0
- package/dist/in-store/hosted-element.d.ts +41 -0
- package/dist/in-store/hosted-element.d.ts.map +1 -0
- package/dist/in-store/hosted-element.js +124 -0
- package/dist/in-store/hosted-element.js.map +1 -0
- package/dist/in-store/hosted-fill-read.d.ts +56 -0
- package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
- package/dist/in-store/hosted-fill-read.js +197 -0
- package/dist/in-store/hosted-fill-read.js.map +1 -0
- package/dist/in-store/hosted-global-id.d.ts +8 -0
- package/dist/in-store/hosted-global-id.d.ts.map +1 -0
- package/dist/in-store/hosted-global-id.js +53 -0
- package/dist/in-store/hosted-global-id.js.map +1 -0
- package/dist/in-store/hosted-placement-edit.d.ts +30 -0
- package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-placement-edit.js +123 -0
- package/dist/in-store/hosted-placement-edit.js.map +1 -0
- package/dist/in-store/hosted-scale-chain.d.ts +12 -0
- package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
- package/dist/in-store/hosted-scale-chain.js +74 -0
- package/dist/in-store/hosted-scale-chain.js.map +1 -0
- package/dist/in-store/hosted-shape-edit.d.ts +9 -0
- package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
- package/dist/in-store/hosted-shape-edit.js +79 -0
- package/dist/in-store/hosted-shape-edit.js.map +1 -0
- package/dist/in-store/index.d.ts +59 -0
- package/dist/in-store/index.d.ts.map +1 -0
- package/dist/in-store/index.js +64 -0
- package/dist/in-store/index.js.map +1 -0
- package/dist/in-store/member.d.ts +8 -2
- package/dist/in-store/member.d.ts.map +1 -1
- package/dist/in-store/member.js +12 -14
- package/dist/in-store/member.js.map +1 -1
- package/dist/in-store/placement-frame.d.ts +9 -4
- package/dist/in-store/placement-frame.d.ts.map +1 -1
- package/dist/in-store/placement-frame.js +20 -35
- package/dist/in-store/placement-frame.js.map +1 -1
- package/dist/in-store/profile.d.ts +141 -0
- package/dist/in-store/profile.d.ts.map +1 -0
- package/dist/in-store/profile.js +174 -0
- package/dist/in-store/profile.js.map +1 -0
- package/dist/in-store/railing.d.ts +65 -0
- package/dist/in-store/railing.d.ts.map +1 -0
- package/dist/in-store/railing.js +112 -0
- package/dist/in-store/railing.js.map +1 -0
- package/dist/in-store/rel-connects-path.d.ts +43 -0
- package/dist/in-store/rel-connects-path.d.ts.map +1 -0
- package/dist/in-store/rel-connects-path.js +65 -0
- package/dist/in-store/rel-connects-path.js.map +1 -0
- package/dist/in-store/resolve-host.d.ts +12 -1
- package/dist/in-store/resolve-host.d.ts.map +1 -1
- package/dist/in-store/resolve-host.js +169 -85
- package/dist/in-store/resolve-host.js.map +1 -1
- package/dist/in-store/resolve-source.d.ts.map +1 -1
- package/dist/in-store/resolve-source.js +39 -59
- package/dist/in-store/resolve-source.js.map +1 -1
- package/dist/in-store/schema-attributes.d.ts +5 -0
- package/dist/in-store/schema-attributes.d.ts.map +1 -1
- package/dist/in-store/schema-attributes.js +9 -2
- package/dist/in-store/schema-attributes.js.map +1 -1
- package/dist/in-store/space-footprints.d.ts +55 -0
- package/dist/in-store/space-footprints.d.ts.map +1 -0
- package/dist/in-store/space-footprints.js +260 -0
- package/dist/in-store/space-footprints.js.map +1 -0
- package/dist/in-store/space.d.ts.map +1 -1
- package/dist/in-store/space.js +15 -3
- package/dist/in-store/space.js.map +1 -1
- package/dist/in-store/spatial-children.d.ts +1 -1
- package/dist/in-store/spatial-children.js +1 -1
- package/dist/in-store/stair-edit.d.ts +24 -0
- package/dist/in-store/stair-edit.d.ts.map +1 -0
- package/dist/in-store/stair-edit.js +190 -0
- package/dist/in-store/stair-edit.js.map +1 -0
- package/dist/in-store/stair.d.ts +58 -0
- package/dist/in-store/stair.d.ts.map +1 -0
- package/dist/in-store/stair.js +156 -0
- package/dist/in-store/stair.js.map +1 -0
- package/dist/in-store/wall-join-apply.d.ts +74 -0
- package/dist/in-store/wall-join-apply.d.ts.map +1 -0
- package/dist/in-store/wall-join-apply.js +137 -0
- package/dist/in-store/wall-join-apply.js.map +1 -0
- package/dist/in-store/wall-join-edit.d.ts +70 -0
- package/dist/in-store/wall-join-edit.d.ts.map +1 -0
- package/dist/in-store/wall-join-edit.js +217 -0
- package/dist/in-store/wall-join-edit.js.map +1 -0
- package/dist/in-store/wall-join-read.d.ts +60 -0
- package/dist/in-store/wall-join-read.d.ts.map +1 -0
- package/dist/in-store/wall-join-read.js +230 -0
- package/dist/in-store/wall-join-read.js.map +1 -0
- package/dist/in-store/wall-join.d.ts +122 -0
- package/dist/in-store/wall-join.d.ts.map +1 -0
- package/dist/in-store/wall-join.js +231 -0
- package/dist/in-store/wall-join.js.map +1 -0
- package/dist/in-store/wall-opening-fit.d.ts +11 -0
- package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
- package/dist/in-store/wall-opening-fit.js +27 -0
- package/dist/in-store/wall-opening-fit.js.map +1 -0
- package/dist/in-store/wall.d.ts +32 -0
- package/dist/in-store/wall.d.ts.map +1 -1
- package/dist/in-store/wall.js +77 -13
- package/dist/in-store/wall.js.map +1 -1
- package/dist/index.d.ts +1 -38
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -40
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
import { AnchorEntityReader } from './resolve-anchor.js';
|
|
5
|
+
const WALL_TYPES = new Set(['IFCWALL', 'IFCWALLSTANDARDCASE']);
|
|
6
|
+
const EPS = 1e-9;
|
|
7
|
+
const CONNECTIONS = ['ATSTART', 'ATEND', 'ATPATH'];
|
|
8
|
+
function refId(value) {
|
|
9
|
+
if (typeof value === 'number' && Number.isInteger(value) && value > 0)
|
|
10
|
+
return value;
|
|
11
|
+
if (typeof value === 'string' && /^#[1-9][0-9]*$/.test(value))
|
|
12
|
+
return Number(value.slice(1));
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
function numbers(value, min) {
|
|
16
|
+
return Array.isArray(value) && value.length >= min && value.every((v) => typeof v === 'number' && Number.isFinite(v))
|
|
17
|
+
? value
|
|
18
|
+
: null;
|
|
19
|
+
}
|
|
20
|
+
/** A polyline's 2D points (native), without a repeated closing point; null unless every point is a 2D or 3D IfcCartesianPoint. */
|
|
21
|
+
function polylinePoints(reader, polylineId) {
|
|
22
|
+
const polyline = polylineId === null ? null : reader.entity(polylineId);
|
|
23
|
+
if (polyline?.type.toUpperCase() !== 'IFCPOLYLINE' || !Array.isArray(polyline.attributes[0]))
|
|
24
|
+
return null;
|
|
25
|
+
const points = [];
|
|
26
|
+
for (const ref of polyline.attributes[0]) {
|
|
27
|
+
const id = refId(ref);
|
|
28
|
+
const point = id === null ? null : reader.entity(id);
|
|
29
|
+
const xy = point?.type.toUpperCase() === 'IFCCARTESIANPOINT' ? numbers(point.attributes[0], 2) : null;
|
|
30
|
+
if (!xy)
|
|
31
|
+
return null;
|
|
32
|
+
points.push([xy[0], xy[1]]);
|
|
33
|
+
}
|
|
34
|
+
const first = points[0];
|
|
35
|
+
const last = points[points.length - 1];
|
|
36
|
+
if (points.length > 1 && Math.hypot(first[0] - last[0], first[1] - last[1]) <= EPS)
|
|
37
|
+
points.pop();
|
|
38
|
+
return points;
|
|
39
|
+
}
|
|
40
|
+
/** The body profile's extent in the wall frame, or null when it is neither an axis-aligned rectangle nor a four-point trapezoid. */
|
|
41
|
+
function bodyExtent(reader, profileId) {
|
|
42
|
+
const profile = reader.entity(profileId);
|
|
43
|
+
const type = profile?.type.toUpperCase();
|
|
44
|
+
if (!profile)
|
|
45
|
+
return null;
|
|
46
|
+
if (type === 'IFCRECTANGLEPROFILEDEF') {
|
|
47
|
+
const position = refId(profile.attributes[2]) === null ? null : reader.entity(refId(profile.attributes[2]));
|
|
48
|
+
const xDim = profile.attributes[3];
|
|
49
|
+
const yDim = profile.attributes[4];
|
|
50
|
+
if (position?.type.toUpperCase() !== 'IFCAXIS2PLACEMENT2D' || typeof xDim !== 'number' || typeof yDim !== 'number')
|
|
51
|
+
return null;
|
|
52
|
+
if (!(xDim > 0) || !(yDim > 0))
|
|
53
|
+
return null;
|
|
54
|
+
// A rotated profile is not one this reader can express as cuts.
|
|
55
|
+
const rotation = refId(position.attributes[1]) === null ? null : reader.entity(refId(position.attributes[1]));
|
|
56
|
+
const dir = rotation ? numbers(rotation.attributes[0], 2) : null;
|
|
57
|
+
if (dir && (Math.abs(dir[0] - 1) > EPS || Math.abs(dir[1]) > EPS))
|
|
58
|
+
return null;
|
|
59
|
+
const point = refId(position.attributes[0]) === null ? null : reader.entity(refId(position.attributes[0]));
|
|
60
|
+
const centre = point ? numbers(point.attributes[0], 2) : null;
|
|
61
|
+
if (!centre)
|
|
62
|
+
return null;
|
|
63
|
+
const x = [centre[0] - xDim / 2, centre[0] + xDim / 2];
|
|
64
|
+
return {
|
|
65
|
+
right: x, left: x, yMin: centre[1] - yDim / 2, yMax: centre[1] + yDim / 2,
|
|
66
|
+
rectangular: true, centred: Math.abs(x[0]) <= EPS && Math.abs(centre[1]) <= EPS,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (type === 'IFCARBITRARYCLOSEDPROFILEDEF') {
|
|
70
|
+
const points = polylinePoints(reader, refId(profile.attributes[2]));
|
|
71
|
+
if (!points || points.length !== 4)
|
|
72
|
+
return null;
|
|
73
|
+
const ys = [...new Set(points.map((p) => p[1]))].sort((a, b) => a - b);
|
|
74
|
+
if (ys.length !== 2 || !(ys[1] - ys[0] > EPS))
|
|
75
|
+
return null;
|
|
76
|
+
const along = (y) => {
|
|
77
|
+
const xs = points.filter((p) => p[1] === y).map((p) => p[0]);
|
|
78
|
+
return xs.length === 2 ? [Math.min(...xs), Math.max(...xs)] : null;
|
|
79
|
+
};
|
|
80
|
+
const right = along(ys[0]);
|
|
81
|
+
const left = along(ys[1]);
|
|
82
|
+
return right && left ? { right, left, yMin: ys[0], yMax: ys[1], rectangular: false, centred: false } : null;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
const clean = (v) => (Math.abs(v) <= EPS ? 0 : v);
|
|
87
|
+
/**
|
|
88
|
+
* Read wall `wallId` as a join target. `lengthUnitScale` is the model's native
|
|
89
|
+
* unit in metres; the target's plan values are metres.
|
|
90
|
+
*/
|
|
91
|
+
export function readWallJoinTarget(store, view, wallId, lengthUnitScale) {
|
|
92
|
+
const reader = new AnchorEntityReader(store, view);
|
|
93
|
+
const wall = reader.entity(wallId);
|
|
94
|
+
if (!wall || !WALL_TYPES.has(wall.type.toUpperCase()))
|
|
95
|
+
return null;
|
|
96
|
+
// Placement: the wall's Location and RefDirection (explicit: the join keeps the frame).
|
|
97
|
+
const placementId = refId(wall.attributes[5]);
|
|
98
|
+
const placement = placementId === null ? null : reader.entity(placementId);
|
|
99
|
+
if (placement?.type.toUpperCase() !== 'IFCLOCALPLACEMENT')
|
|
100
|
+
return null;
|
|
101
|
+
const axisPlacementId = refId(placement.attributes[1]);
|
|
102
|
+
const axisPlacement = axisPlacementId === null ? null : reader.entity(axisPlacementId);
|
|
103
|
+
if (axisPlacementId === null || axisPlacement?.type.toUpperCase() !== 'IFCAXIS2PLACEMENT3D')
|
|
104
|
+
return null;
|
|
105
|
+
const locationPointId = refId(axisPlacement.attributes[0]);
|
|
106
|
+
const refDirectionId = refId(axisPlacement.attributes[2]);
|
|
107
|
+
if (locationPointId === null || refDirectionId === null)
|
|
108
|
+
return null;
|
|
109
|
+
const location = numbers(reader.entity(locationPointId)?.attributes[0], 3);
|
|
110
|
+
const ratios = numbers(reader.entity(refDirectionId)?.attributes[0], 2);
|
|
111
|
+
if (!location || !ratios)
|
|
112
|
+
return null;
|
|
113
|
+
const dirLength = Math.hypot(ratios[0], ratios[1]);
|
|
114
|
+
if (!(dirLength > EPS) || (ratios.length > 2 && Math.abs(ratios[2]) > 1e-6 * dirLength))
|
|
115
|
+
return null;
|
|
116
|
+
const dir = [ratios[0] / dirLength, ratios[1] / dirLength];
|
|
117
|
+
// Representations: the Body (an extruded profile) and the optional Axis.
|
|
118
|
+
const productShapeId = refId(wall.attributes[6]);
|
|
119
|
+
const productShape = productShapeId === null ? null : reader.entity(productShapeId);
|
|
120
|
+
if (productShapeId === null || productShape?.type.toUpperCase() !== 'IFCPRODUCTDEFINITIONSHAPE'
|
|
121
|
+
|| !Array.isArray(productShape.attributes[2]))
|
|
122
|
+
return null;
|
|
123
|
+
const representationIds = productShape.attributes[2].map(refId);
|
|
124
|
+
if (representationIds.length === 0 || representationIds.some((id) => id === null))
|
|
125
|
+
return null;
|
|
126
|
+
const ids = representationIds;
|
|
127
|
+
const repOf = (identifier) => ids.find((id) => reader.entity(id)?.attributes[1] === identifier) ?? null;
|
|
128
|
+
const bodyRepId = repOf('Body') ?? ids[0];
|
|
129
|
+
const axisRepId = repOf('Axis');
|
|
130
|
+
const bodyItems = reader.entity(bodyRepId)?.attributes[3];
|
|
131
|
+
const solidId = Array.isArray(bodyItems) && bodyItems.length > 0 ? refId(bodyItems[0]) : null;
|
|
132
|
+
const solid = solidId === null ? null : reader.entity(solidId);
|
|
133
|
+
if (solidId === null || solid?.type.toUpperCase() !== 'IFCEXTRUDEDAREASOLID')
|
|
134
|
+
return null;
|
|
135
|
+
const profileId = refId(solid.attributes[0]);
|
|
136
|
+
const extent = profileId === null ? null : bodyExtent(reader, profileId);
|
|
137
|
+
if (profileId === null || !extent)
|
|
138
|
+
return null;
|
|
139
|
+
// The axis, from its polyline when there is one (on the wall's own centreline), else the body's length.
|
|
140
|
+
let a0;
|
|
141
|
+
let a1;
|
|
142
|
+
let axisIsBody = false;
|
|
143
|
+
if (axisRepId !== null) {
|
|
144
|
+
const items = reader.entity(axisRepId)?.attributes[3];
|
|
145
|
+
const points = Array.isArray(items) && items.length === 1 ? polylinePoints(reader, refId(items[0])) : null;
|
|
146
|
+
if (!points || points.length !== 2 || Math.abs(points[0][1]) > EPS || Math.abs(points[1][1]) > EPS
|
|
147
|
+
|| !(points[1][0] - points[0][0] > EPS))
|
|
148
|
+
return null;
|
|
149
|
+
[a0, a1] = [points[0][0], points[1][0]];
|
|
150
|
+
axisIsBody = Math.abs(a0 - extent.right[0]) <= EPS && Math.abs(a1 - extent.right[1]) <= EPS;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
a0 = Math.min(extent.right[0], extent.left[0]);
|
|
154
|
+
a1 = Math.max(extent.right[1], extent.left[1]);
|
|
155
|
+
axisIsBody = extent.rectangular;
|
|
156
|
+
}
|
|
157
|
+
const m = lengthUnitScale > 0 && Number.isFinite(lengthUnitScale) ? lengthUnitScale : 1;
|
|
158
|
+
const metre = (native) => Math.round(native * m * 1e9) / 1e9;
|
|
159
|
+
const origin = [metre(location[0]), metre(location[1])];
|
|
160
|
+
const at = (x) => [metre(location[0] + dir[0] * x), metre(location[1] + dir[1] * x)];
|
|
161
|
+
const startCut = { left: metre(clean(a0 - extent.left[0])), right: metre(clean(a0 - extent.right[0])) };
|
|
162
|
+
const endCut = { left: metre(clean(extent.left[1] - a1)), right: metre(clean(extent.right[1] - a1)) };
|
|
163
|
+
const offset = metre((extent.yMin + extent.yMax) / 2);
|
|
164
|
+
const wallShape = {
|
|
165
|
+
start: at(a0),
|
|
166
|
+
end: at(a1),
|
|
167
|
+
thickness: metre(extent.yMax - extent.yMin),
|
|
168
|
+
...(offset !== 0 ? { offset } : {}),
|
|
169
|
+
...(startCut.left !== 0 || startCut.right !== 0 ? { startCut } : {}),
|
|
170
|
+
...(endCut.left !== 0 || endCut.right !== 0 ? { endCut } : {}),
|
|
171
|
+
};
|
|
172
|
+
const depth = solid.attributes[3];
|
|
173
|
+
return {
|
|
174
|
+
wallId,
|
|
175
|
+
solidId,
|
|
176
|
+
profileId,
|
|
177
|
+
productShapeId,
|
|
178
|
+
representationIds: ids,
|
|
179
|
+
axisRepId,
|
|
180
|
+
origin,
|
|
181
|
+
wall: wallShape,
|
|
182
|
+
axisPlacementId,
|
|
183
|
+
locationPointId,
|
|
184
|
+
refDirectionId,
|
|
185
|
+
location: [location[0], location[1], location[2]],
|
|
186
|
+
parentPlacementId: refId(placement.attributes[0]),
|
|
187
|
+
height: typeof depth === 'number' ? metre(depth) : Number.NaN,
|
|
188
|
+
plain: extent.rectangular && extent.centred && axisIsBody && offset === 0
|
|
189
|
+
&& startCut.left === 0 && startCut.right === 0 && endCut.left === 0 && endCut.right === 0,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/** The connection type of an enum attribute, `.ATSTART.` or `ATSTART`. */
|
|
193
|
+
function connectionOf(value) {
|
|
194
|
+
const text = typeof value === 'string' ? value.replace(/^\.|\.$/g, '').toUpperCase() : '';
|
|
195
|
+
return CONNECTIONS.includes(text) ? text : null;
|
|
196
|
+
}
|
|
197
|
+
function prioritiesOf(value) {
|
|
198
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === 'number') : [];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Every live `IfcRelConnectsPathElements` that touches one of `wallIds` (all
|
|
202
|
+
* of them when omitted). The attribute slots (Relating 5, Related 6,
|
|
203
|
+
* priorities 7 and 8, connection types 9 and 10) are the same in IFC2X3,
|
|
204
|
+
* IFC4 and IFC4X3.
|
|
205
|
+
*/
|
|
206
|
+
export function readWallJoinRels(store, view, wallIds) {
|
|
207
|
+
const reader = new AnchorEntityReader(store, view);
|
|
208
|
+
const rels = [];
|
|
209
|
+
for (const relId of reader.ids('IFCRELCONNECTSPATHELEMENTS')) {
|
|
210
|
+
const attributes = reader.entity(relId)?.attributes;
|
|
211
|
+
if (!attributes)
|
|
212
|
+
continue;
|
|
213
|
+
const relatingId = refId(attributes[5]);
|
|
214
|
+
const relatedId = refId(attributes[6]);
|
|
215
|
+
const relatedConnection = connectionOf(attributes[9]);
|
|
216
|
+
const relatingConnection = connectionOf(attributes[10]);
|
|
217
|
+
if (relatingId === null || relatedId === null || !relatedConnection || !relatingConnection)
|
|
218
|
+
continue;
|
|
219
|
+
if (wallIds && !wallIds.has(relatingId) && !wallIds.has(relatedId))
|
|
220
|
+
continue;
|
|
221
|
+
rels.push({
|
|
222
|
+
relId, relatingId, relatedId, relatingConnection, relatedConnection,
|
|
223
|
+
relatingPriorities: prioritiesOf(attributes[7]),
|
|
224
|
+
relatedPriorities: prioritiesOf(attributes[8]),
|
|
225
|
+
name: typeof attributes[2] === 'string' ? attributes[2] : null,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return rels;
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=wall-join-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-join-read.js","sourceRoot":"","sources":["../../src/in-store/wall-join-read.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAqCzD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAC/D,MAAM,GAAG,GAAG,IAAI,CAAC;AACjB,MAAM,WAAW,GAAsB,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAEtE,SAAS,KAAK,CAAC,KAAc;IAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACpF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,C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
|
|
2
|
+
* Wall joins (#6232 D1): where two straight walls meet, decide which one runs
|
|
3
|
+
* through and how far each body extends past, or stops short of, its axis end,
|
|
4
|
+
* so the two bodies meet with no overlap and no gap. Pure plan geometry: no
|
|
5
|
+
* editor, no store.
|
|
6
|
+
*
|
|
7
|
+
* Three kinds, told apart by where the two axes' lines cross:
|
|
8
|
+
*
|
|
9
|
+
* - `L` both walls end at the crossing (a corner). One wall runs through
|
|
10
|
+
* to the outer corner, the other stops at its inner face.
|
|
11
|
+
* - `T` one wall ends on the other's path. The path wall runs through
|
|
12
|
+
* unchanged, the ending wall stops at its near face.
|
|
13
|
+
* - `butt` the walls are collinear and meet end to end. Both stop square at
|
|
14
|
+
* the shared point, whatever their thicknesses or offsets.
|
|
15
|
+
*
|
|
16
|
+
* The joined end of each axis is snapped to the crossing, so a wall drawn to
|
|
17
|
+
* the other's face (or a little short of it) gets an axis that meets the
|
|
18
|
+
* other's axis, which is what `IfcRelConnectsPathElements` describes.
|
|
19
|
+
*
|
|
20
|
+
* A body end is a cut across the wall's thickness: how far the body reaches
|
|
21
|
+
* past the axis end along its left face and along its right face. A right-angle
|
|
22
|
+
* join or a butt join cuts square (both the same), so the body stays an
|
|
23
|
+
* `IfcRectangleProfileDef`. At any other angle the cut runs along the other
|
|
24
|
+
* wall's face, which a rectangle cannot follow: the body becomes a four-point
|
|
25
|
+
* `IfcArbitraryClosedProfileDef`. It is still a butt join (one wall runs through,
|
|
26
|
+
* the other stops at its face), not a mitre, and no boolean clipping is used.
|
|
27
|
+
*/
|
|
28
|
+
/** A point in the storey plan, metres. */
|
|
29
|
+
export type PlanPoint = [number, number];
|
|
30
|
+
/** Which face of the wall its axis runs along. `left`/`right` are relative to Start -> End. */
|
|
31
|
+
export type WallAlignment = 'center' | 'left' | 'right';
|
|
32
|
+
/** `IfcConnectionTypeEnum` values a wall join writes. */
|
|
33
|
+
export type WallConnectionType = 'ATSTART' | 'ATEND' | 'ATPATH';
|
|
34
|
+
/**
|
|
35
|
+
* How far a wall body reaches past one end of its axis, in metres, measured
|
|
36
|
+
* along the axis at each face. Positive extends past the end, negative trims
|
|
37
|
+
* back from it. Equal values are a square cut.
|
|
38
|
+
*/
|
|
39
|
+
export interface WallEndCut {
|
|
40
|
+
/** At the left face (left of Start -> End). */
|
|
41
|
+
left: number;
|
|
42
|
+
/** At the right face. */
|
|
43
|
+
right: number;
|
|
44
|
+
}
|
|
45
|
+
/** A straight wall as the join sees it: plan axis, thickness and where the body sits across the axis. */
|
|
46
|
+
export interface WallJoinWall {
|
|
47
|
+
start: PlanPoint;
|
|
48
|
+
end: PlanPoint;
|
|
49
|
+
/** Metres, > 0. */
|
|
50
|
+
thickness: number;
|
|
51
|
+
/** Default `center`. */
|
|
52
|
+
alignment?: WallAlignment;
|
|
53
|
+
/** Extra shift of the body across the axis, metres, positive to the left. Default 0. */
|
|
54
|
+
offset?: number;
|
|
55
|
+
/** Body end at Start. Default square at the axis end. */
|
|
56
|
+
startCut?: WallEndCut;
|
|
57
|
+
/** Body end at End. Default square at the axis end. */
|
|
58
|
+
endCut?: WallEndCut;
|
|
59
|
+
}
|
|
60
|
+
export type WallJoinKind = 'L' | 'T' | 'butt';
|
|
61
|
+
export interface WallJoinSide {
|
|
62
|
+
/** Where this wall takes part: the end that is joined, or its path for the through wall of a T. */
|
|
63
|
+
connection: WallConnectionType;
|
|
64
|
+
/** True for the wall whose body runs through the joint. */
|
|
65
|
+
runsThrough: boolean;
|
|
66
|
+
/** The wall after the join: joined end snapped to the joint, body cut there. The other end is kept as it was. */
|
|
67
|
+
wall: WallJoinWall;
|
|
68
|
+
}
|
|
69
|
+
export interface WallJoin {
|
|
70
|
+
kind: WallJoinKind;
|
|
71
|
+
/** Where the axes meet, storey plan metres. */
|
|
72
|
+
point: PlanPoint;
|
|
73
|
+
/** The wall written as `RelatingElement`: the one that runs through (wall `a` for a butt join). */
|
|
74
|
+
relating: 'a' | 'b';
|
|
75
|
+
a: WallJoinSide;
|
|
76
|
+
b: WallJoinSide;
|
|
77
|
+
}
|
|
78
|
+
export interface WallJoinOptions {
|
|
79
|
+
/**
|
|
80
|
+
* How far (metres, along each axis) an axis end may sit from the crossing and
|
|
81
|
+
* still count as joined there. Default twice the larger thickness, which
|
|
82
|
+
* covers a wall drawn to the other's face.
|
|
83
|
+
*/
|
|
84
|
+
tolerance?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Which wall runs through at an `L` corner, and is the relating wall of a
|
|
87
|
+
* `butt` join. Default: the thicker wall, `a` on a tie. Ignored for a `T`,
|
|
88
|
+
* where the path wall always runs through.
|
|
89
|
+
*/
|
|
90
|
+
priority?: 'a' | 'b';
|
|
91
|
+
}
|
|
92
|
+
/** The wall body's plan outline in the wall's own frame: origin at Start, +X along the axis, +Y to the left. */
|
|
93
|
+
export interface WallBodyOutline {
|
|
94
|
+
/** Right-start, right-end, left-end, left-start (counter-clockwise). */
|
|
95
|
+
corners: [PlanPoint, PlanPoint, PlanPoint, PlanPoint];
|
|
96
|
+
/** Both ends are square, so the outline is a rectangle. */
|
|
97
|
+
rectangular: boolean;
|
|
98
|
+
/** Axis length, Start to End. */
|
|
99
|
+
length: number;
|
|
100
|
+
/** Body extent across the axis. */
|
|
101
|
+
yMin: number;
|
|
102
|
+
yMax: number;
|
|
103
|
+
}
|
|
104
|
+
/** The body's extent across the axis, `[min, max]`, positive to the left of Start -> End. */
|
|
105
|
+
export declare function wallBodyLateralRange(wall: Pick<WallJoinWall, 'thickness' | 'alignment' | 'offset'>): [number, number];
|
|
106
|
+
/** Put a wall on a new axis, retaining cuts only at unchanged ends with the
|
|
107
|
+
* same direction. Cuts are distances from their OWN end, so extending Start
|
|
108
|
+
* does not rebase EndCut. Changed ends start square before a join recuts them.
|
|
109
|
+
* Shared by the canonical editor and its preview (#6232/#6535). */
|
|
110
|
+
export declare function reshapeWallAxis(wall: WallJoinWall, start: Readonly<PlanPoint>, end: Readonly<PlanPoint>): WallJoinWall;
|
|
111
|
+
/**
|
|
112
|
+
* The body outline of `wall` in its own frame. Throws when the cuts leave a
|
|
113
|
+
* face with no length (the ends cross), which no single extrusion can build.
|
|
114
|
+
*/
|
|
115
|
+
export declare function wallBodyOutline(wall: WallJoinWall): WallBodyOutline;
|
|
116
|
+
/**
|
|
117
|
+
* Join two straight walls. Works at any angle in plan; throws when the walls
|
|
118
|
+
* do not meet within `tolerance`, when they cross (split one first), or when
|
|
119
|
+
* they are parallel without being collinear and end to end.
|
|
120
|
+
*/
|
|
121
|
+
export declare function computeWallJoin(a: WallJoinWall, b: WallJoinWall, options?: WallJoinOptions): WallJoin;
|
|
122
|
+
//# sourceMappingURL=wall-join.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-join.d.ts","sourceRoot":"","sources":["../../src/in-store/wall-join.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,+FAA+F;AAC/F,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yGAAyG;AACzG,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,SAAS,CAAC;IACf,mBAAmB;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,UAAU,CAAC;IACt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,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,YAAY,CAatH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAiBnE;AA+DD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA+DzG"}
|
|
@@ -0,0 +1,231 @@
|
|
|
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
|
+
/** Directions closer to parallel than this (sine of the angle) are treated as parallel. */
|
|
5
|
+
const PARALLEL_SIN = 1e-6;
|
|
6
|
+
/** Length slack for "the same point" / "on the line" / "non-empty face". */
|
|
7
|
+
const LENGTH_EPS = 1e-9;
|
|
8
|
+
const SQUARE_EPS = 1e-9;
|
|
9
|
+
const sub = (a, b) => [a[0] - b[0], a[1] - b[1]];
|
|
10
|
+
const add = (a, b) => [a[0] + b[0], a[1] + b[1]];
|
|
11
|
+
const scale = (a, s) => [a[0] * s, a[1] * s];
|
|
12
|
+
const dot = (a, b) => a[0] * b[0] + a[1] * b[1];
|
|
13
|
+
const cross = (a, b) => a[0] * b[1] - a[1] * b[0];
|
|
14
|
+
function assertWall(wall, label, op) {
|
|
15
|
+
const finite = [...wall.start, ...wall.end, wall.thickness, wall.offset ?? 0,
|
|
16
|
+
wall.startCut?.left ?? 0, wall.startCut?.right ?? 0, wall.endCut?.left ?? 0, wall.endCut?.right ?? 0];
|
|
17
|
+
if (finite.some((v) => !Number.isFinite(v)))
|
|
18
|
+
throw new Error(`${op}: wall ${label} has a non-finite coordinate or dimension`);
|
|
19
|
+
if (!(wall.thickness > 0))
|
|
20
|
+
throw new Error(`${op}: wall ${label} thickness must be positive`);
|
|
21
|
+
if (Math.hypot(wall.end[0] - wall.start[0], wall.end[1] - wall.start[1]) <= LENGTH_EPS) {
|
|
22
|
+
throw new Error(`${op}: wall ${label} Start and End must be distinct points`);
|
|
23
|
+
}
|
|
24
|
+
const alignment = wall.alignment ?? 'center';
|
|
25
|
+
if (alignment !== 'center' && alignment !== 'left' && alignment !== 'right') {
|
|
26
|
+
throw new Error(`${op}: wall ${label} alignment must be center, left or right; got ${String(alignment)}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** The body's extent across the axis, `[min, max]`, positive to the left of Start -> End. */
|
|
30
|
+
export function wallBodyLateralRange(wall) {
|
|
31
|
+
const half = wall.thickness / 2;
|
|
32
|
+
const alignment = wall.alignment ?? 'center';
|
|
33
|
+
// The axis runs along the named face, so the body lies on the other side of it.
|
|
34
|
+
const centre = (wall.offset ?? 0) + (alignment === 'left' ? -half : alignment === 'right' ? half : 0);
|
|
35
|
+
return [centre - half, centre + half];
|
|
36
|
+
}
|
|
37
|
+
/** Put a wall on a new axis, retaining cuts only at unchanged ends with the
|
|
38
|
+
* same direction. Cuts are distances from their OWN end, so extending Start
|
|
39
|
+
* does not rebase EndCut. Changed ends start square before a join recuts them.
|
|
40
|
+
* Shared by the canonical editor and its preview (#6232/#6535). */
|
|
41
|
+
export function reshapeWallAxis(wall, start, end) {
|
|
42
|
+
assertWall(wall, '', 'reshapeWallAxis');
|
|
43
|
+
const { startCut, endCut, ...rest } = wall;
|
|
44
|
+
const next = { ...rest, start: [start[0], start[1]], end: [end[0], end[1]] };
|
|
45
|
+
assertWall(next, '', 'reshapeWallAxis');
|
|
46
|
+
const directionHeld = dot(frameOf(wall).dir, frameOf(next).dir) > 1 - 1e-12;
|
|
47
|
+
if (directionHeld && startCut && Math.hypot(start[0] - wall.start[0], start[1] - wall.start[1]) <= LENGTH_EPS) {
|
|
48
|
+
next.startCut = { ...startCut };
|
|
49
|
+
}
|
|
50
|
+
if (directionHeld && endCut && Math.hypot(end[0] - wall.end[0], end[1] - wall.end[1]) <= LENGTH_EPS) {
|
|
51
|
+
next.endCut = { ...endCut };
|
|
52
|
+
}
|
|
53
|
+
return next;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The body outline of `wall` in its own frame. Throws when the cuts leave a
|
|
57
|
+
* face with no length (the ends cross), which no single extrusion can build.
|
|
58
|
+
*/
|
|
59
|
+
export function wallBodyOutline(wall) {
|
|
60
|
+
assertWall(wall, '', 'wallBodyOutline');
|
|
61
|
+
const length = Math.hypot(wall.end[0] - wall.start[0], wall.end[1] - wall.start[1]);
|
|
62
|
+
const [yMin, yMax] = wallBodyLateralRange(wall);
|
|
63
|
+
const s = wall.startCut ?? { left: 0, right: 0 };
|
|
64
|
+
const e = wall.endCut ?? { left: 0, right: 0 };
|
|
65
|
+
const corners = [
|
|
66
|
+
[-s.right, yMin],
|
|
67
|
+
[length + e.right, yMin],
|
|
68
|
+
[length + e.left, yMax],
|
|
69
|
+
[-s.left, yMax],
|
|
70
|
+
];
|
|
71
|
+
if (corners[1][0] - corners[0][0] <= LENGTH_EPS || corners[2][0] - corners[3][0] <= LENGTH_EPS) {
|
|
72
|
+
throw new Error('wallBodyOutline: the body ends cross; the wall is too short for this join');
|
|
73
|
+
}
|
|
74
|
+
const rectangular = Math.abs(s.left - s.right) <= SQUARE_EPS && Math.abs(e.left - e.right) <= SQUARE_EPS;
|
|
75
|
+
return { corners, rectangular, length, yMin, yMax };
|
|
76
|
+
}
|
|
77
|
+
function frameOf(wall) {
|
|
78
|
+
const d = sub(wall.end, wall.start);
|
|
79
|
+
const length = Math.hypot(d[0], d[1]);
|
|
80
|
+
const dir = scale(d, 1 / length);
|
|
81
|
+
const [yMin, yMax] = wallBodyLateralRange(wall);
|
|
82
|
+
return { wall, origin: wall.start, dir, normal: [-dir[1], dir[0]], length, yMin, yMax };
|
|
83
|
+
}
|
|
84
|
+
/** Where parameter `s` (metres along the axis from Start) falls on a wall of `length`. */
|
|
85
|
+
function placeOn(s, length, tolerance) {
|
|
86
|
+
const fromStart = Math.abs(s);
|
|
87
|
+
const fromEnd = Math.abs(s - length);
|
|
88
|
+
if (fromStart <= tolerance || fromEnd <= tolerance)
|
|
89
|
+
return fromStart <= fromEnd ? 'ATSTART' : 'ATEND';
|
|
90
|
+
return s > 0 && s < length ? 'ATPATH' : 'OFF';
|
|
91
|
+
}
|
|
92
|
+
/** Outward direction of the body at a joined end. */
|
|
93
|
+
function outward(f, end) {
|
|
94
|
+
return end === 'ATEND' ? f.dir : scale(f.dir, -1);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The cut at a joined end of `f` that lies along the line through `linePoint`
|
|
98
|
+
* with direction `lineDir`: distance past the axis end (the joint `p`) at each
|
|
99
|
+
* face, measured outward.
|
|
100
|
+
*/
|
|
101
|
+
function cutAlong(f, end, p, linePoint, lineDir) {
|
|
102
|
+
const u = outward(f, end);
|
|
103
|
+
const denom = cross(u, lineDir);
|
|
104
|
+
// p + s·u + y·n = linePoint + r·lineDir => s = cross(linePoint - p - y·n, lineDir) / cross(u, lineDir)
|
|
105
|
+
const at = (y) => cross(sub(sub(linePoint, p), scale(f.normal, y)), lineDir) / denom;
|
|
106
|
+
return { left: at(f.yMax), right: at(f.yMin) };
|
|
107
|
+
}
|
|
108
|
+
/** `f`'s wall with the joined end moved to `p` and cut by `cut`. */
|
|
109
|
+
function joinedWall(f, end, p, cut) {
|
|
110
|
+
const wall = end === 'ATSTART'
|
|
111
|
+
? { ...f.wall, start: [p[0], p[1]], startCut: cut }
|
|
112
|
+
: { ...f.wall, end: [p[0], p[1]], endCut: cut };
|
|
113
|
+
wallBodyOutline(wall);
|
|
114
|
+
return wall;
|
|
115
|
+
}
|
|
116
|
+
/** Which side (+1 left, -1 right) of `f`'s axis the direction `v` points to. */
|
|
117
|
+
function sideOf(f, v) {
|
|
118
|
+
return dot(v, f.normal) >= 0 ? 1 : -1;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Join two straight walls. Works at any angle in plan; throws when the walls
|
|
122
|
+
* do not meet within `tolerance`, when they cross (split one first), or when
|
|
123
|
+
* they are parallel without being collinear and end to end.
|
|
124
|
+
*/
|
|
125
|
+
export function computeWallJoin(a, b, options = {}) {
|
|
126
|
+
const op = 'computeWallJoin';
|
|
127
|
+
assertWall(a, 'a', op);
|
|
128
|
+
assertWall(b, 'b', op);
|
|
129
|
+
const tolerance = options.tolerance ?? 2 * Math.max(a.thickness, b.thickness);
|
|
130
|
+
if (!Number.isFinite(tolerance) || tolerance < 0)
|
|
131
|
+
throw new Error(`${op}: tolerance must be a finite, non-negative length`);
|
|
132
|
+
if (options.priority !== undefined && options.priority !== 'a' && options.priority !== 'b') {
|
|
133
|
+
throw new Error(`${op}: priority must be 'a' or 'b'`);
|
|
134
|
+
}
|
|
135
|
+
const fa = frameOf(a);
|
|
136
|
+
const fb = frameOf(b);
|
|
137
|
+
const denom = cross(fa.dir, fb.dir);
|
|
138
|
+
if (Math.abs(denom) <= PARALLEL_SIN)
|
|
139
|
+
return buttJoin(fa, fb, tolerance, options, op);
|
|
140
|
+
const w = sub(fb.origin, fa.origin);
|
|
141
|
+
const sA = cross(w, fb.dir) / denom;
|
|
142
|
+
const sB = cross(w, fa.dir) / denom;
|
|
143
|
+
const point = add(fa.origin, scale(fa.dir, sA));
|
|
144
|
+
const placeA = placeOn(sA, fa.length, tolerance);
|
|
145
|
+
const placeB = placeOn(sB, fb.length, tolerance);
|
|
146
|
+
if (placeA === 'OFF' || placeB === 'OFF') {
|
|
147
|
+
throw new Error(`${op}: the walls do not meet (their axes cross more than ${tolerance} m past an end)`);
|
|
148
|
+
}
|
|
149
|
+
if (placeA === 'ATPATH' && placeB === 'ATPATH') {
|
|
150
|
+
throw new Error(`${op}: the walls cross each other; split one of them at the crossing first`);
|
|
151
|
+
}
|
|
152
|
+
if (placeA === 'ATPATH' || placeB === 'ATPATH') {
|
|
153
|
+
// T: the path wall runs through untouched; the other stops at its near face.
|
|
154
|
+
const throughIsA = placeA === 'ATPATH';
|
|
155
|
+
const [fr, fw] = throughIsA ? [fa, fb] : [fb, fa];
|
|
156
|
+
const endW = (throughIsA ? placeB : placeA);
|
|
157
|
+
const ending = endingSide(fr, fw, endW, point);
|
|
158
|
+
const through = { connection: 'ATPATH', runsThrough: true, wall: { ...fr.wall } };
|
|
159
|
+
return {
|
|
160
|
+
kind: 'T',
|
|
161
|
+
point,
|
|
162
|
+
relating: throughIsA ? 'a' : 'b',
|
|
163
|
+
a: throughIsA ? through : ending,
|
|
164
|
+
b: throughIsA ? ending : through,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
// L: both walls end at the corner.
|
|
168
|
+
const throughIsA = (options.priority ?? (b.thickness > a.thickness ? 'b' : 'a')) === 'a';
|
|
169
|
+
const [fr, fw] = throughIsA ? [fa, fb] : [fb, fa];
|
|
170
|
+
const [endR, endW] = (throughIsA ? [placeA, placeB] : [placeB, placeA]);
|
|
171
|
+
const ending = endingSide(fr, fw, endW, point);
|
|
172
|
+
// The through wall reaches the ending wall's outer face: the face on the far
|
|
173
|
+
// side from where the through wall comes in.
|
|
174
|
+
const comesFrom = sideOf(fw, scale(outward(fr, endR), -1));
|
|
175
|
+
const outerY = comesFrom > 0 ? fw.yMin : fw.yMax;
|
|
176
|
+
const cut = cutAlong(fr, endR, point, add(point, scale(fw.normal, outerY)), fw.dir);
|
|
177
|
+
const through = { connection: endR, runsThrough: true, wall: joinedWall(fr, endR, point, cut) };
|
|
178
|
+
return {
|
|
179
|
+
kind: 'L',
|
|
180
|
+
point,
|
|
181
|
+
relating: throughIsA ? 'a' : 'b',
|
|
182
|
+
a: throughIsA ? through : ending,
|
|
183
|
+
b: throughIsA ? ending : through,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/** The wall that stops at the through wall's face: the face on the side it comes in from. */
|
|
187
|
+
function endingSide(fr, fw, endW, point) {
|
|
188
|
+
const comesFrom = sideOf(fr, scale(outward(fw, endW), -1));
|
|
189
|
+
const faceY = comesFrom > 0 ? fr.yMax : fr.yMin;
|
|
190
|
+
const cut = cutAlong(fw, endW, point, add(point, scale(fr.normal, faceY)), fr.dir);
|
|
191
|
+
return { connection: endW, runsThrough: false, wall: joinedWall(fw, endW, point, cut) };
|
|
192
|
+
}
|
|
193
|
+
function buttJoin(fa, fb, tolerance, options, op) {
|
|
194
|
+
const reach = Math.max(fa.length, fb.length);
|
|
195
|
+
if (Math.abs(cross(sub(fb.origin, fa.origin), fa.dir)) > Math.max(1e-6 * reach, LENGTH_EPS)) {
|
|
196
|
+
throw new Error(`${op}: the walls are parallel but not in line; a join needs the axes to meet`);
|
|
197
|
+
}
|
|
198
|
+
const ends = ['ATSTART', 'ATEND'];
|
|
199
|
+
const endPoint = (f, end) => (end === 'ATSTART' ? f.wall.start : f.wall.end);
|
|
200
|
+
let best = null;
|
|
201
|
+
for (const endA of ends) {
|
|
202
|
+
for (const endB of ends) {
|
|
203
|
+
// End to end means the two bodies leave the joint in opposite directions.
|
|
204
|
+
if (dot(outward(fa, endA), outward(fb, endB)) >= 0)
|
|
205
|
+
continue;
|
|
206
|
+
const gap = Math.hypot(...sub(endPoint(fa, endA), endPoint(fb, endB)));
|
|
207
|
+
if (!best || gap < best.gap)
|
|
208
|
+
best = { endA, endB, gap };
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// The ends must meet within tolerance, and the walls must not overlap along the line.
|
|
212
|
+
const overlap = best
|
|
213
|
+
? dot(sub(endPoint(fb, best.endB), endPoint(fa, best.endA)), outward(fa, best.endA)) < -tolerance
|
|
214
|
+
: true;
|
|
215
|
+
if (!best || best.gap > tolerance || overlap) {
|
|
216
|
+
throw new Error(`${op}: the walls are in line but do not meet end to end within ${tolerance} m`);
|
|
217
|
+
}
|
|
218
|
+
const pa = endPoint(fa, best.endA);
|
|
219
|
+
const pb = endPoint(fb, best.endB);
|
|
220
|
+
const point = [(pa[0] + pb[0]) / 2, (pa[1] + pb[1]) / 2];
|
|
221
|
+
const square = { left: 0, right: 0 };
|
|
222
|
+
const relating = options.priority ?? 'a';
|
|
223
|
+
return {
|
|
224
|
+
kind: 'butt',
|
|
225
|
+
point,
|
|
226
|
+
relating,
|
|
227
|
+
a: { connection: best.endA, runsThrough: false, wall: joinedWall(fa, best.endA, point, square) },
|
|
228
|
+
b: { connection: best.endB, runsThrough: false, wall: joinedWall(fb, best.endB, point, square) },
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=wall-join.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wall-join.js","sourceRoot":"","sources":["../../src/in-store/wall-join.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAoH/D,2FAA2F;AAC3F,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,4EAA4E;AAC5E,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,MAAM,KAAK,GAAG,CAAC,CAAY,EAAE,CAAS,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3E,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC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