@ifc-lite/drawing-2d 1.4.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/LICENSE +373 -0
- package/dist/drawing-generator.d.ts +80 -0
- package/dist/drawing-generator.d.ts.map +1 -0
- package/dist/drawing-generator.js +281 -0
- package/dist/drawing-generator.js.map +1 -0
- package/dist/edge-extractor.d.ts +47 -0
- package/dist/edge-extractor.d.ts.map +1 -0
- package/dist/edge-extractor.js +204 -0
- package/dist/edge-extractor.js.map +1 -0
- package/dist/gpu-section-cutter.d.ts +42 -0
- package/dist/gpu-section-cutter.d.ts.map +1 -0
- package/dist/gpu-section-cutter.js +405 -0
- package/dist/gpu-section-cutter.js.map +1 -0
- package/dist/graphic-overrides/index.d.ts +10 -0
- package/dist/graphic-overrides/index.d.ts.map +1 -0
- package/dist/graphic-overrides/index.js +8 -0
- package/dist/graphic-overrides/index.js.map +1 -0
- package/dist/graphic-overrides/presets.d.ts +22 -0
- package/dist/graphic-overrides/presets.d.ts.map +1 -0
- package/dist/graphic-overrides/presets.js +283 -0
- package/dist/graphic-overrides/presets.js.map +1 -0
- package/dist/graphic-overrides/rule-engine.d.ts +64 -0
- package/dist/graphic-overrides/rule-engine.d.ts.map +1 -0
- package/dist/graphic-overrides/rule-engine.js +438 -0
- package/dist/graphic-overrides/rule-engine.js.map +1 -0
- package/dist/graphic-overrides/types.d.ts +200 -0
- package/dist/graphic-overrides/types.d.ts.map +1 -0
- package/dist/graphic-overrides/types.js +5 -0
- package/dist/graphic-overrides/types.js.map +1 -0
- package/dist/hatch-generator.d.ts +76 -0
- package/dist/hatch-generator.d.ts.map +1 -0
- package/dist/hatch-generator.js +282 -0
- package/dist/hatch-generator.js.map +1 -0
- package/dist/hidden-line.d.ts +64 -0
- package/dist/hidden-line.d.ts.map +1 -0
- package/dist/hidden-line.js +318 -0
- package/dist/hidden-line.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- package/dist/line-merger.d.ts +35 -0
- package/dist/line-merger.d.ts.map +1 -0
- package/dist/line-merger.js +265 -0
- package/dist/line-merger.js.map +1 -0
- package/dist/math.d.ts +90 -0
- package/dist/math.d.ts.map +1 -0
- package/dist/math.js +284 -0
- package/dist/math.js.map +1 -0
- package/dist/openings/index.d.ts +7 -0
- package/dist/openings/index.d.ts.map +1 -0
- package/dist/openings/index.js +10 -0
- package/dist/openings/index.js.map +1 -0
- package/dist/openings/opening-filter.d.ts +61 -0
- package/dist/openings/opening-filter.d.ts.map +1 -0
- package/dist/openings/opening-filter.js +244 -0
- package/dist/openings/opening-filter.js.map +1 -0
- package/dist/openings/opening-relationship-builder.d.ts +35 -0
- package/dist/openings/opening-relationship-builder.d.ts.map +1 -0
- package/dist/openings/opening-relationship-builder.js +121 -0
- package/dist/openings/opening-relationship-builder.js.map +1 -0
- package/dist/openings/opening-utils.d.ts +55 -0
- package/dist/openings/opening-utils.d.ts.map +1 -0
- package/dist/openings/opening-utils.js +128 -0
- package/dist/openings/opening-utils.js.map +1 -0
- package/dist/polygon-builder.d.ts +62 -0
- package/dist/polygon-builder.d.ts.map +1 -0
- package/dist/polygon-builder.js +261 -0
- package/dist/polygon-builder.js.map +1 -0
- package/dist/section-cutter.d.ts +49 -0
- package/dist/section-cutter.d.ts.map +1 -0
- package/dist/section-cutter.js +220 -0
- package/dist/section-cutter.js.map +1 -0
- package/dist/sheet/frame-renderer.d.ts +28 -0
- package/dist/sheet/frame-renderer.d.ts.map +1 -0
- package/dist/sheet/frame-renderer.js +199 -0
- package/dist/sheet/frame-renderer.js.map +1 -0
- package/dist/sheet/frame-types.d.ts +57 -0
- package/dist/sheet/frame-types.d.ts.map +1 -0
- package/dist/sheet/frame-types.js +88 -0
- package/dist/sheet/frame-types.js.map +1 -0
- package/dist/sheet/index.d.ts +26 -0
- package/dist/sheet/index.d.ts.map +1 -0
- package/dist/sheet/index.js +12 -0
- package/dist/sheet/index.js.map +1 -0
- package/dist/sheet/paper-sizes.d.ts +36 -0
- package/dist/sheet/paper-sizes.d.ts.map +1 -0
- package/dist/sheet/paper-sizes.js +252 -0
- package/dist/sheet/paper-sizes.js.map +1 -0
- package/dist/sheet/scale-bar-renderer.d.ts +29 -0
- package/dist/sheet/scale-bar-renderer.d.ts.map +1 -0
- package/dist/sheet/scale-bar-renderer.js +287 -0
- package/dist/sheet/scale-bar-renderer.js.map +1 -0
- package/dist/sheet/scale-bar-types.d.ts +82 -0
- package/dist/sheet/scale-bar-types.d.ts.map +1 -0
- package/dist/sheet/scale-bar-types.js +66 -0
- package/dist/sheet/scale-bar-types.js.map +1 -0
- package/dist/sheet/sheet-types.d.ts +84 -0
- package/dist/sheet/sheet-types.d.ts.map +1 -0
- package/dist/sheet/sheet-types.js +77 -0
- package/dist/sheet/sheet-types.js.map +1 -0
- package/dist/sheet/title-block-renderer.d.ts +44 -0
- package/dist/sheet/title-block-renderer.d.ts.map +1 -0
- package/dist/sheet/title-block-renderer.js +335 -0
- package/dist/sheet/title-block-renderer.js.map +1 -0
- package/dist/sheet/title-block-types.d.ts +100 -0
- package/dist/sheet/title-block-types.d.ts.map +1 -0
- package/dist/sheet/title-block-types.js +174 -0
- package/dist/sheet/title-block-types.js.map +1 -0
- package/dist/styles.d.ts +77 -0
- package/dist/styles.d.ts.map +1 -0
- package/dist/styles.js +347 -0
- package/dist/styles.js.map +1 -0
- package/dist/styling/index.d.ts +7 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +10 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/layer-mapping.d.ts +57 -0
- package/dist/styling/layer-mapping.d.ts.map +1 -0
- package/dist/styling/layer-mapping.js +303 -0
- package/dist/styling/layer-mapping.js.map +1 -0
- package/dist/styling/line-styles.d.ts +49 -0
- package/dist/styling/line-styles.d.ts.map +1 -0
- package/dist/styling/line-styles.js +123 -0
- package/dist/styling/line-styles.js.map +1 -0
- package/dist/styling/line-weights.d.ts +61 -0
- package/dist/styling/line-weights.d.ts.map +1 -0
- package/dist/styling/line-weights.js +183 -0
- package/dist/styling/line-weights.js.map +1 -0
- package/dist/svg-exporter.d.ts +63 -0
- package/dist/svg-exporter.d.ts.map +1 -0
- package/dist/svg-exporter.js +278 -0
- package/dist/svg-exporter.js.map +1 -0
- package/dist/symbols/door-symbol.d.ts +82 -0
- package/dist/symbols/door-symbol.d.ts.map +1 -0
- package/dist/symbols/door-symbol.js +390 -0
- package/dist/symbols/door-symbol.js.map +1 -0
- package/dist/symbols/index.d.ts +8 -0
- package/dist/symbols/index.d.ts.map +1 -0
- package/dist/symbols/index.js +11 -0
- package/dist/symbols/index.js.map +1 -0
- package/dist/symbols/symbol-renderer.d.ts +29 -0
- package/dist/symbols/symbol-renderer.d.ts.map +1 -0
- package/dist/symbols/symbol-renderer.js +173 -0
- package/dist/symbols/symbol-renderer.js.map +1 -0
- package/dist/symbols/symbol-utils.d.ts +48 -0
- package/dist/symbols/symbol-utils.d.ts.map +1 -0
- package/dist/symbols/symbol-utils.js +129 -0
- package/dist/symbols/symbol-utils.js.map +1 -0
- package/dist/symbols/window-symbol.d.ts +57 -0
- package/dist/symbols/window-symbol.d.ts.map +1 -0
- package/dist/symbols/window-symbol.js +209 -0
- package/dist/symbols/window-symbol.js.map +1 -0
- package/dist/types.d.ts +443 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,303 @@
|
|
|
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
|
+
* Default layer definitions following AIA CAD Layer Guidelines
|
|
6
|
+
*/
|
|
7
|
+
export const DEFAULT_LAYERS = [
|
|
8
|
+
{
|
|
9
|
+
id: 'walls',
|
|
10
|
+
aiaCode: 'A-WALL',
|
|
11
|
+
label: 'Walls',
|
|
12
|
+
visible: true,
|
|
13
|
+
defaultWeight: 'heavy',
|
|
14
|
+
color: '#000000',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'walls-full',
|
|
18
|
+
aiaCode: 'A-WALL-FULL',
|
|
19
|
+
label: 'Full Height Walls',
|
|
20
|
+
visible: true,
|
|
21
|
+
defaultWeight: 'heavy',
|
|
22
|
+
color: '#000000',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 'columns',
|
|
26
|
+
aiaCode: 'A-COLS',
|
|
27
|
+
label: 'Columns',
|
|
28
|
+
visible: true,
|
|
29
|
+
defaultWeight: 'heavy',
|
|
30
|
+
color: '#000000',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'doors',
|
|
34
|
+
aiaCode: 'A-DOOR',
|
|
35
|
+
label: 'Doors',
|
|
36
|
+
visible: true,
|
|
37
|
+
defaultWeight: 'medium',
|
|
38
|
+
color: '#000000',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'glazing',
|
|
42
|
+
aiaCode: 'A-GLAZ',
|
|
43
|
+
label: 'Windows/Glazing',
|
|
44
|
+
visible: true,
|
|
45
|
+
defaultWeight: 'medium',
|
|
46
|
+
color: '#000000',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'stairs',
|
|
50
|
+
aiaCode: 'A-STRS',
|
|
51
|
+
label: 'Stairs',
|
|
52
|
+
visible: true,
|
|
53
|
+
defaultWeight: 'medium',
|
|
54
|
+
color: '#000000',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'floor',
|
|
58
|
+
aiaCode: 'A-FLOR',
|
|
59
|
+
label: 'Floor',
|
|
60
|
+
visible: true,
|
|
61
|
+
defaultWeight: 'heavy',
|
|
62
|
+
color: '#000000',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'ceiling',
|
|
66
|
+
aiaCode: 'A-CLNG',
|
|
67
|
+
label: 'Ceiling',
|
|
68
|
+
visible: true,
|
|
69
|
+
defaultWeight: 'light',
|
|
70
|
+
color: '#666666',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'roof',
|
|
74
|
+
aiaCode: 'A-ROOF',
|
|
75
|
+
label: 'Roof',
|
|
76
|
+
visible: true,
|
|
77
|
+
defaultWeight: 'heavy',
|
|
78
|
+
color: '#000000',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'furniture',
|
|
82
|
+
aiaCode: 'A-FURN',
|
|
83
|
+
label: 'Furniture',
|
|
84
|
+
visible: true,
|
|
85
|
+
defaultWeight: 'light',
|
|
86
|
+
color: '#333333',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'equipment',
|
|
90
|
+
aiaCode: 'A-EQPM',
|
|
91
|
+
label: 'Equipment',
|
|
92
|
+
visible: true,
|
|
93
|
+
defaultWeight: 'light',
|
|
94
|
+
color: '#333333',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: 'hatching',
|
|
98
|
+
aiaCode: 'A-PATT',
|
|
99
|
+
label: 'Hatching Patterns',
|
|
100
|
+
visible: true,
|
|
101
|
+
defaultWeight: 'hairline',
|
|
102
|
+
color: '#808080',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'annotations',
|
|
106
|
+
aiaCode: 'A-ANNO',
|
|
107
|
+
label: 'Annotations',
|
|
108
|
+
visible: true,
|
|
109
|
+
defaultWeight: 'hairline',
|
|
110
|
+
color: '#000000',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: 'dimensions',
|
|
114
|
+
aiaCode: 'A-DIMS',
|
|
115
|
+
label: 'Dimensions',
|
|
116
|
+
visible: true,
|
|
117
|
+
defaultWeight: 'hairline',
|
|
118
|
+
color: '#000000',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'symbols',
|
|
122
|
+
aiaCode: 'A-SYMB',
|
|
123
|
+
label: 'Symbols',
|
|
124
|
+
visible: true,
|
|
125
|
+
defaultWeight: 'hairline',
|
|
126
|
+
color: '#000000',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'hidden',
|
|
130
|
+
aiaCode: 'A-HIDN',
|
|
131
|
+
label: 'Hidden Lines',
|
|
132
|
+
visible: true,
|
|
133
|
+
defaultWeight: 'hairline',
|
|
134
|
+
color: '#808080',
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
/**
|
|
138
|
+
* IFC type to AIA layer code mapping
|
|
139
|
+
*/
|
|
140
|
+
const IFC_TYPE_TO_LAYER = {
|
|
141
|
+
// Walls
|
|
142
|
+
IfcWall: 'A-WALL',
|
|
143
|
+
IfcWallStandardCase: 'A-WALL',
|
|
144
|
+
IfcCurtainWall: 'A-WALL',
|
|
145
|
+
// Columns
|
|
146
|
+
IfcColumn: 'A-COLS',
|
|
147
|
+
IfcColumnStandardCase: 'A-COLS',
|
|
148
|
+
// Doors
|
|
149
|
+
IfcDoor: 'A-DOOR',
|
|
150
|
+
IfcDoorStandardCase: 'A-DOOR',
|
|
151
|
+
// Windows
|
|
152
|
+
IfcWindow: 'A-GLAZ',
|
|
153
|
+
IfcWindowStandardCase: 'A-GLAZ',
|
|
154
|
+
// Stairs
|
|
155
|
+
IfcStair: 'A-STRS',
|
|
156
|
+
IfcStairFlight: 'A-STRS',
|
|
157
|
+
IfcRamp: 'A-STRS',
|
|
158
|
+
IfcRampFlight: 'A-STRS',
|
|
159
|
+
IfcRailing: 'A-STRS',
|
|
160
|
+
// Floor/Slab
|
|
161
|
+
IfcSlab: 'A-FLOR',
|
|
162
|
+
IfcFloor: 'A-FLOR',
|
|
163
|
+
// Ceiling
|
|
164
|
+
IfcCovering: 'A-CLNG',
|
|
165
|
+
IfcCeiling: 'A-CLNG',
|
|
166
|
+
// Roof
|
|
167
|
+
IfcRoof: 'A-ROOF',
|
|
168
|
+
IfcRoofSlab: 'A-ROOF',
|
|
169
|
+
// Furniture
|
|
170
|
+
IfcFurnishingElement: 'A-FURN',
|
|
171
|
+
IfcFurniture: 'A-FURN',
|
|
172
|
+
// Equipment
|
|
173
|
+
IfcDistributionElement: 'A-EQPM',
|
|
174
|
+
IfcFlowTerminal: 'A-EQPM',
|
|
175
|
+
IfcFlowSegment: 'A-EQPM',
|
|
176
|
+
IfcBuildingElementProxy: 'A-EQPM',
|
|
177
|
+
// Openings (typically hidden or special handling)
|
|
178
|
+
IfcOpeningElement: 'A-HIDN',
|
|
179
|
+
// Spaces
|
|
180
|
+
IfcSpace: 'A-ANNO',
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* Semantic line type to AIA layer code mapping
|
|
184
|
+
*/
|
|
185
|
+
const SEMANTIC_TYPE_TO_LAYER = {
|
|
186
|
+
'wall-cut': 'A-WALL',
|
|
187
|
+
'wall-projection': 'A-WALL',
|
|
188
|
+
'column-cut': 'A-COLS',
|
|
189
|
+
'slab-cut': 'A-FLOR',
|
|
190
|
+
'opening-frame': 'A-DOOR',
|
|
191
|
+
'door-swing': 'A-SYMB',
|
|
192
|
+
'door-leaf': 'A-DOOR',
|
|
193
|
+
'window-frame': 'A-GLAZ',
|
|
194
|
+
'window-mullion': 'A-GLAZ',
|
|
195
|
+
'stair-cut': 'A-STRS',
|
|
196
|
+
'stair-nosing': 'A-STRS',
|
|
197
|
+
furniture: 'A-FURN',
|
|
198
|
+
equipment: 'A-EQPM',
|
|
199
|
+
annotation: 'A-ANNO',
|
|
200
|
+
dimension: 'A-DIMS',
|
|
201
|
+
hidden: 'A-HIDN',
|
|
202
|
+
centerline: 'A-ANNO',
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Layer mapper for organizing lines by layer
|
|
206
|
+
*/
|
|
207
|
+
export class LayerMapper {
|
|
208
|
+
layers;
|
|
209
|
+
layerById;
|
|
210
|
+
layerByCode;
|
|
211
|
+
constructor(layers = DEFAULT_LAYERS) {
|
|
212
|
+
this.layers = layers;
|
|
213
|
+
this.layerById = new Map(layers.map((l) => [l.id, l]));
|
|
214
|
+
this.layerByCode = new Map(layers.map((l) => [l.aiaCode, l]));
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Get layer for an IFC type
|
|
218
|
+
*/
|
|
219
|
+
getLayerForIfcType(ifcType) {
|
|
220
|
+
const code = IFC_TYPE_TO_LAYER[ifcType];
|
|
221
|
+
if (code) {
|
|
222
|
+
return this.layerByCode.get(code);
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Get layer for a semantic line type
|
|
228
|
+
*/
|
|
229
|
+
getLayerForSemanticType(semanticType) {
|
|
230
|
+
const code = SEMANTIC_TYPE_TO_LAYER[semanticType];
|
|
231
|
+
if (code) {
|
|
232
|
+
return this.layerByCode.get(code);
|
|
233
|
+
}
|
|
234
|
+
return undefined;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get layer for an architectural line
|
|
238
|
+
*/
|
|
239
|
+
getLayerForLine(line) {
|
|
240
|
+
// Hidden lines always go to hidden layer
|
|
241
|
+
if (line.visibility === 'hidden' || line.lineStyle === 'dashed') {
|
|
242
|
+
return this.layerByCode.get('A-HIDN') ?? this.layers[0];
|
|
243
|
+
}
|
|
244
|
+
// Try semantic type first
|
|
245
|
+
const semanticLayer = this.getLayerForSemanticType(line.semanticType);
|
|
246
|
+
if (semanticLayer)
|
|
247
|
+
return semanticLayer;
|
|
248
|
+
// Fall back to IFC type
|
|
249
|
+
const ifcLayer = this.getLayerForIfcType(line.ifcType);
|
|
250
|
+
if (ifcLayer)
|
|
251
|
+
return ifcLayer;
|
|
252
|
+
// Default to walls
|
|
253
|
+
return this.layerByCode.get('A-WALL') ?? this.layers[0];
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Group lines by layer
|
|
257
|
+
*/
|
|
258
|
+
groupLinesByLayer(lines) {
|
|
259
|
+
const grouped = new Map();
|
|
260
|
+
for (const line of lines) {
|
|
261
|
+
const layer = this.getLayerForLine(line);
|
|
262
|
+
const existing = grouped.get(layer);
|
|
263
|
+
if (existing) {
|
|
264
|
+
existing.push(line);
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
grouped.set(layer, [line]);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return grouped;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Get all layer definitions
|
|
274
|
+
*/
|
|
275
|
+
getLayers() {
|
|
276
|
+
return this.layers;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Get layer by ID
|
|
280
|
+
*/
|
|
281
|
+
getLayerById(id) {
|
|
282
|
+
return this.layerById.get(id);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Get layer by AIA code
|
|
286
|
+
*/
|
|
287
|
+
getLayerByCode(code) {
|
|
288
|
+
return this.layerByCode.get(code);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Get AIA layer code for an IFC type
|
|
293
|
+
*/
|
|
294
|
+
export function getLayerForIfcType(ifcType) {
|
|
295
|
+
return IFC_TYPE_TO_LAYER[ifcType] ?? 'A-WALL';
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Create a default layer mapper
|
|
299
|
+
*/
|
|
300
|
+
export function createLayerMapper(customLayers) {
|
|
301
|
+
return new LayerMapper(customLayers ?? DEFAULT_LAYERS);
|
|
302
|
+
}
|
|
303
|
+
//# sourceMappingURL=layer-mapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-mapping.js","sourceRoot":"","sources":["../../src/styling/layer-mapping.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C;QACE,EAAE,EAAE,OAAO;QACX,OAAO,EAAE,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C,EAAE,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,IAAkB;QAC/B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,iBAAiB,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAgC;IAEhC,OAAO,IAAI,WAAW,CAAC,YAAY,IAAI,cAAc,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line style definitions for architectural drawings
|
|
3
|
+
*
|
|
4
|
+
* Standard architectural line styles:
|
|
5
|
+
* - Solid: Cut lines, visible edges
|
|
6
|
+
* - Dashed: Hidden lines (behind other objects)
|
|
7
|
+
* - Centerline: Center lines, axes
|
|
8
|
+
* - Phantom: Alternate positions, removed parts
|
|
9
|
+
*/
|
|
10
|
+
import type { LineStyle, ArchitecturalLine } from '../types';
|
|
11
|
+
/**
|
|
12
|
+
* Dash pattern definitions (as SVG stroke-dasharray values)
|
|
13
|
+
* Units are relative to line width
|
|
14
|
+
*/
|
|
15
|
+
export declare const DASH_PATTERNS: Record<LineStyle, string | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Line styler for generating SVG style attributes
|
|
18
|
+
*/
|
|
19
|
+
export declare class LineStyler {
|
|
20
|
+
/**
|
|
21
|
+
* Get SVG stroke-dasharray for a line
|
|
22
|
+
*/
|
|
23
|
+
getDashArray(line: ArchitecturalLine, scale?: number): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get SVG stroke-width for a line
|
|
26
|
+
*/
|
|
27
|
+
getStrokeWidth(line: ArchitecturalLine, scale?: number): number;
|
|
28
|
+
/**
|
|
29
|
+
* Get complete SVG style string for a line
|
|
30
|
+
*/
|
|
31
|
+
getSVGStyle(line: ArchitecturalLine, scale?: number, color?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get CSS class name for a line based on its properties
|
|
34
|
+
*/
|
|
35
|
+
getCSSClass(line: ArchitecturalLine): string;
|
|
36
|
+
/**
|
|
37
|
+
* Generate CSS rules for all line styles
|
|
38
|
+
*/
|
|
39
|
+
generateCSSRules(scale?: number): string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a default line styler
|
|
43
|
+
*/
|
|
44
|
+
export declare function createLineStyler(): LineStyler;
|
|
45
|
+
/**
|
|
46
|
+
* Apply hidden line style (for lines marked as hidden)
|
|
47
|
+
*/
|
|
48
|
+
export declare function applyHiddenStyle(line: ArchitecturalLine): ArchitecturalLine;
|
|
49
|
+
//# sourceMappingURL=line-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-styles.d.ts","sourceRoot":"","sources":["../../src/styling/line-styles.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAM1D,CAAC;AAYF;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM,GAAG,SAAS;IAc5E;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM;IAUlE;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,GAAE,MAAU,EAAE,KAAK,GAAE,MAAkB,GAAG,MAAM;IAa1F;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM;IAc5C;;OAEG;IACH,gBAAgB,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM;CAwB5C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,iBAAiB,CAO3E"}
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
* Dash pattern definitions (as SVG stroke-dasharray values)
|
|
6
|
+
* Units are relative to line width
|
|
7
|
+
*/
|
|
8
|
+
export const DASH_PATTERNS = {
|
|
9
|
+
solid: null,
|
|
10
|
+
dashed: '4 2', // Standard hidden line
|
|
11
|
+
dotted: '1 2', // Fine dotted
|
|
12
|
+
centerline: '10 3 2 3', // Long-short-long pattern
|
|
13
|
+
phantom: '8 3 2 3 2 3', // Double short dash pattern
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Scale factor for dash patterns based on line weight
|
|
17
|
+
*/
|
|
18
|
+
const DASH_SCALE_FACTORS = {
|
|
19
|
+
heavy: 1.2,
|
|
20
|
+
medium: 1.0,
|
|
21
|
+
light: 0.8,
|
|
22
|
+
hairline: 0.6,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Line styler for generating SVG style attributes
|
|
26
|
+
*/
|
|
27
|
+
export class LineStyler {
|
|
28
|
+
/**
|
|
29
|
+
* Get SVG stroke-dasharray for a line
|
|
30
|
+
*/
|
|
31
|
+
getDashArray(line, scale = 1) {
|
|
32
|
+
const pattern = DASH_PATTERNS[line.lineStyle];
|
|
33
|
+
if (!pattern)
|
|
34
|
+
return undefined;
|
|
35
|
+
// Scale pattern based on line weight and drawing scale
|
|
36
|
+
const weightScale = DASH_SCALE_FACTORS[line.lineWeight] ?? 1.0;
|
|
37
|
+
const scaledPattern = pattern
|
|
38
|
+
.split(' ')
|
|
39
|
+
.map((v) => (parseFloat(v) * weightScale * scale).toFixed(2))
|
|
40
|
+
.join(' ');
|
|
41
|
+
return scaledPattern;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get SVG stroke-width for a line
|
|
45
|
+
*/
|
|
46
|
+
getStrokeWidth(line, scale = 1) {
|
|
47
|
+
const widths = {
|
|
48
|
+
heavy: 0.5,
|
|
49
|
+
medium: 0.35,
|
|
50
|
+
light: 0.25,
|
|
51
|
+
hairline: 0.18,
|
|
52
|
+
};
|
|
53
|
+
return (widths[line.lineWeight] ?? 0.25) * scale;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get complete SVG style string for a line
|
|
57
|
+
*/
|
|
58
|
+
getSVGStyle(line, scale = 1, color = '#000000') {
|
|
59
|
+
const strokeWidth = this.getStrokeWidth(line, scale);
|
|
60
|
+
const dashArray = this.getDashArray(line, scale);
|
|
61
|
+
let style = `stroke="${color}" stroke-width="${strokeWidth}" fill="none"`;
|
|
62
|
+
if (dashArray) {
|
|
63
|
+
style += ` stroke-dasharray="${dashArray}"`;
|
|
64
|
+
}
|
|
65
|
+
style += ' stroke-linecap="round" stroke-linejoin="round"';
|
|
66
|
+
return style;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get CSS class name for a line based on its properties
|
|
70
|
+
*/
|
|
71
|
+
getCSSClass(line) {
|
|
72
|
+
const classes = [
|
|
73
|
+
`line-${line.category}`,
|
|
74
|
+
`weight-${line.lineWeight}`,
|
|
75
|
+
`style-${line.lineStyle}`,
|
|
76
|
+
];
|
|
77
|
+
if (line.visibility === 'hidden') {
|
|
78
|
+
classes.push('hidden-line');
|
|
79
|
+
}
|
|
80
|
+
return classes.join(' ');
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Generate CSS rules for all line styles
|
|
84
|
+
*/
|
|
85
|
+
generateCSSRules(scale = 1) {
|
|
86
|
+
const rules = [];
|
|
87
|
+
// Weight-based widths
|
|
88
|
+
rules.push(`.weight-heavy { stroke-width: ${0.5 * scale}mm; }`);
|
|
89
|
+
rules.push(`.weight-medium { stroke-width: ${0.35 * scale}mm; }`);
|
|
90
|
+
rules.push(`.weight-light { stroke-width: ${0.25 * scale}mm; }`);
|
|
91
|
+
rules.push(`.weight-hairline { stroke-width: ${0.18 * scale}mm; }`);
|
|
92
|
+
// Style-based patterns
|
|
93
|
+
rules.push(`.style-solid { stroke-dasharray: none; }`);
|
|
94
|
+
rules.push(`.style-dashed { stroke-dasharray: 4 2; }`);
|
|
95
|
+
rules.push(`.style-dotted { stroke-dasharray: 1 2; }`);
|
|
96
|
+
rules.push(`.style-centerline { stroke-dasharray: 10 3 2 3; }`);
|
|
97
|
+
rules.push(`.style-phantom { stroke-dasharray: 8 3 2 3 2 3; }`);
|
|
98
|
+
// Category colors (optional, usually all black)
|
|
99
|
+
rules.push(`.line-cut { stroke: #000000; }`);
|
|
100
|
+
rules.push(`.line-projection { stroke: #333333; }`);
|
|
101
|
+
rules.push(`.line-hidden { stroke: #666666; }`);
|
|
102
|
+
rules.push(`.line-annotation { stroke: #000000; }`);
|
|
103
|
+
return rules.join('\n');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Create a default line styler
|
|
108
|
+
*/
|
|
109
|
+
export function createLineStyler() {
|
|
110
|
+
return new LineStyler();
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Apply hidden line style (for lines marked as hidden)
|
|
114
|
+
*/
|
|
115
|
+
export function applyHiddenStyle(line) {
|
|
116
|
+
return {
|
|
117
|
+
...line,
|
|
118
|
+
lineStyle: 'dashed',
|
|
119
|
+
lineWeight: 'hairline',
|
|
120
|
+
semanticType: 'hidden',
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=line-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-styles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ACjE,KAAK,CAAC,IAAI,CAAC,oCAAoC,IAAI,GAAG,KAAK,OAAO,CAAC,CAAC;QAEpE,uBAAuB;QACvB,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QAChE,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;QAEhE,gDAAgD;QAChD,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QAEpD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,IAAI,UAAU,EAAE,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAuB;IACtD,OAAO;QACL,GAAG,IAAI;QACP,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,UAAU;QACtB,YAAY,EAAE,QAAQ;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Line weight assignment for architectural drawings
|
|
3
|
+
*
|
|
4
|
+
* Implements standard architectural line weight hierarchy:
|
|
5
|
+
* - Heavy: Cut lines through structural elements (walls, columns, slabs)
|
|
6
|
+
* - Medium: Cut lines through non-structural, opening frames
|
|
7
|
+
* - Light: Projection lines, furniture
|
|
8
|
+
* - Hairline: Symbols, annotations, hidden lines
|
|
9
|
+
*/
|
|
10
|
+
import type { DrawingLine, ArchitecturalLine, LineWeight } from '../types';
|
|
11
|
+
/**
|
|
12
|
+
* Line weight configuration with actual widths
|
|
13
|
+
*/
|
|
14
|
+
export declare const LINE_WEIGHT_CONFIG: Record<LineWeight, {
|
|
15
|
+
widthMm: number;
|
|
16
|
+
widthPx: number;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* IFC type to line weight mapping for cut lines
|
|
20
|
+
*/
|
|
21
|
+
export declare const IFC_TYPE_WEIGHTS: Record<string, LineWeight>;
|
|
22
|
+
/**
|
|
23
|
+
* Assigns line weights and styles to drawing lines
|
|
24
|
+
*/
|
|
25
|
+
export declare class LineWeightAssigner {
|
|
26
|
+
private ifcTypeWeights;
|
|
27
|
+
constructor(customWeights?: Record<string, LineWeight>);
|
|
28
|
+
/**
|
|
29
|
+
* Assign weight and style to a drawing line
|
|
30
|
+
*/
|
|
31
|
+
assignWeight(line: DrawingLine): ArchitecturalLine;
|
|
32
|
+
/**
|
|
33
|
+
* Process all lines in a drawing
|
|
34
|
+
*/
|
|
35
|
+
processLines(lines: DrawingLine[]): ArchitecturalLine[];
|
|
36
|
+
/**
|
|
37
|
+
* Get the base weight for a line
|
|
38
|
+
*/
|
|
39
|
+
private getBaseWeight;
|
|
40
|
+
/**
|
|
41
|
+
* Get the line style
|
|
42
|
+
*/
|
|
43
|
+
private getLineStyle;
|
|
44
|
+
/**
|
|
45
|
+
* Determine semantic type for layer assignment
|
|
46
|
+
*/
|
|
47
|
+
private getSemanticType;
|
|
48
|
+
/**
|
|
49
|
+
* Get the actual width in mm for a weight
|
|
50
|
+
*/
|
|
51
|
+
getWidthMm(weight: LineWeight): number;
|
|
52
|
+
/**
|
|
53
|
+
* Get the actual width in pixels for a weight (at 96 DPI)
|
|
54
|
+
*/
|
|
55
|
+
getWidthPx(weight: LineWeight): number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a default line weight assigner
|
|
59
|
+
*/
|
|
60
|
+
export declare function createLineWeightAssigner(customWeights?: Record<string, LineWeight>): LineWeightAssigner;
|
|
61
|
+
//# sourceMappingURL=line-weights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-weights.d.ts","sourceRoot":"","sources":["../../src/styling/line-weights.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,UAAU,EAIX,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,UAAU,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAKvF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAoCvD,CAAC;AA4BF;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,cAAc,CAA6B;gBAEvC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC;IAItD;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,iBAAiB;IAalD;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,iBAAiB,EAAE;IAIvD;;OAEG;IACH,OAAO,CAAC,aAAa;IAerB;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,eAAe;IAiCvB;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IAItC;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;CAGvC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GACzC,kBAAkB,CAEpB"}
|