@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
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for 2D architectural drawing generation
|
|
3
|
+
*/
|
|
4
|
+
export interface Vec2 {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Vec3 {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
z: number;
|
|
12
|
+
}
|
|
13
|
+
export type SectionAxis = 'x' | 'y' | 'z';
|
|
14
|
+
export interface SectionPlaneConfig {
|
|
15
|
+
/** Axis perpendicular to the section plane */
|
|
16
|
+
axis: SectionAxis;
|
|
17
|
+
/** Position along the axis in world units */
|
|
18
|
+
position: number;
|
|
19
|
+
/** Whether to flip the view direction */
|
|
20
|
+
flipped: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SectionConfig {
|
|
23
|
+
/** Section plane definition */
|
|
24
|
+
plane: SectionPlaneConfig;
|
|
25
|
+
/** Depth range beyond cut plane to include for projection lines (world units) */
|
|
26
|
+
projectionDepth: number;
|
|
27
|
+
/** Whether to compute hidden lines */
|
|
28
|
+
includeHiddenLines: boolean;
|
|
29
|
+
/** Crease angle threshold in degrees (edges sharper than this are feature edges) */
|
|
30
|
+
creaseAngle: number;
|
|
31
|
+
/** Scale factor for output (e.g., 100 for 1:100) */
|
|
32
|
+
scale: number;
|
|
33
|
+
}
|
|
34
|
+
export declare const DEFAULT_SECTION_CONFIG: Omit<SectionConfig, 'plane'>;
|
|
35
|
+
export interface Point2D {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}
|
|
39
|
+
export interface Line2D {
|
|
40
|
+
start: Point2D;
|
|
41
|
+
end: Point2D;
|
|
42
|
+
}
|
|
43
|
+
export interface Polyline2D {
|
|
44
|
+
points: Point2D[];
|
|
45
|
+
closed: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface Polygon2D {
|
|
48
|
+
/** Outer boundary (counter-clockwise winding) */
|
|
49
|
+
outer: Point2D[];
|
|
50
|
+
/** Inner holes (clockwise winding) */
|
|
51
|
+
holes: Point2D[][];
|
|
52
|
+
}
|
|
53
|
+
export interface Bounds2D {
|
|
54
|
+
min: Point2D;
|
|
55
|
+
max: Point2D;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Category of line in architectural drawing
|
|
59
|
+
*/
|
|
60
|
+
export type LineCategory = 'cut' | 'projection' | 'hidden' | 'silhouette' | 'crease' | 'boundary' | 'annotation';
|
|
61
|
+
/**
|
|
62
|
+
* Visibility state for hidden line removal
|
|
63
|
+
*/
|
|
64
|
+
export type VisibilityState = 'visible' | 'hidden' | 'partial';
|
|
65
|
+
/**
|
|
66
|
+
* A classified line segment in the 2D drawing
|
|
67
|
+
*/
|
|
68
|
+
export interface DrawingLine {
|
|
69
|
+
/** 2D line geometry */
|
|
70
|
+
line: Line2D;
|
|
71
|
+
/** Line classification */
|
|
72
|
+
category: LineCategory;
|
|
73
|
+
/** Visibility after hidden line removal */
|
|
74
|
+
visibility: VisibilityState;
|
|
75
|
+
/** Source IFC entity expressId */
|
|
76
|
+
entityId: number;
|
|
77
|
+
/** IFC type name (e.g., "IfcWall") */
|
|
78
|
+
ifcType: string;
|
|
79
|
+
/** Model index for multi-model federation */
|
|
80
|
+
modelIndex: number;
|
|
81
|
+
/** Distance from section plane (for depth sorting) */
|
|
82
|
+
depth: number;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* A polygon from section cut (used for hatching)
|
|
86
|
+
*/
|
|
87
|
+
export interface DrawingPolygon {
|
|
88
|
+
/** 2D polygon geometry */
|
|
89
|
+
polygon: Polygon2D;
|
|
90
|
+
/** Source IFC entity expressId */
|
|
91
|
+
entityId: number;
|
|
92
|
+
/** IFC type name */
|
|
93
|
+
ifcType: string;
|
|
94
|
+
/** Model index for multi-model federation */
|
|
95
|
+
modelIndex: number;
|
|
96
|
+
/** True if from section cut, false if projection */
|
|
97
|
+
isCut: boolean;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Raw cut segment before classification
|
|
101
|
+
*/
|
|
102
|
+
export interface CutSegment {
|
|
103
|
+
/** 3D start point of cut */
|
|
104
|
+
p0: Vec3;
|
|
105
|
+
/** 3D end point of cut */
|
|
106
|
+
p1: Vec3;
|
|
107
|
+
/** 2D projected start point */
|
|
108
|
+
p0_2d: Point2D;
|
|
109
|
+
/** 2D projected end point */
|
|
110
|
+
p1_2d: Point2D;
|
|
111
|
+
/** Source entity ID */
|
|
112
|
+
entityId: number;
|
|
113
|
+
/** IFC type */
|
|
114
|
+
ifcType: string;
|
|
115
|
+
/** Model index */
|
|
116
|
+
modelIndex: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Result from section cutting a single mesh
|
|
120
|
+
*/
|
|
121
|
+
export interface MeshCutResult {
|
|
122
|
+
/** Cut line segments */
|
|
123
|
+
segments: CutSegment[];
|
|
124
|
+
/** Number of triangles processed */
|
|
125
|
+
trianglesProcessed: number;
|
|
126
|
+
/** Number of triangles that intersected the plane */
|
|
127
|
+
trianglesIntersected: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Result from cutting all meshes
|
|
131
|
+
*/
|
|
132
|
+
export interface SectionCutResult {
|
|
133
|
+
/** All cut segments */
|
|
134
|
+
segments: CutSegment[];
|
|
135
|
+
/** Reconstructed polygons per entity */
|
|
136
|
+
polygons: DrawingPolygon[];
|
|
137
|
+
/** Processing statistics */
|
|
138
|
+
stats: {
|
|
139
|
+
totalTriangles: number;
|
|
140
|
+
intersectedTriangles: number;
|
|
141
|
+
segmentCount: number;
|
|
142
|
+
polygonCount: number;
|
|
143
|
+
processingTimeMs: number;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Complete 2D drawing result
|
|
148
|
+
*/
|
|
149
|
+
export interface Drawing2D {
|
|
150
|
+
/** Section configuration used */
|
|
151
|
+
config: SectionConfig;
|
|
152
|
+
/** All classified lines */
|
|
153
|
+
lines: DrawingLine[];
|
|
154
|
+
/** Cut polygons (for hatching) */
|
|
155
|
+
cutPolygons: DrawingPolygon[];
|
|
156
|
+
/** Projection polygons (visible surfaces beyond cut) */
|
|
157
|
+
projectionPolygons: DrawingPolygon[];
|
|
158
|
+
/** Bounding box in 2D drawing space */
|
|
159
|
+
bounds: Bounds2D;
|
|
160
|
+
/** Processing statistics */
|
|
161
|
+
stats: {
|
|
162
|
+
cutLineCount: number;
|
|
163
|
+
projectionLineCount: number;
|
|
164
|
+
hiddenLineCount: number;
|
|
165
|
+
silhouetteLineCount: number;
|
|
166
|
+
polygonCount: number;
|
|
167
|
+
totalTriangles: number;
|
|
168
|
+
processingTimeMs: number;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Edge data with adjacency information
|
|
173
|
+
*/
|
|
174
|
+
export interface EdgeData {
|
|
175
|
+
/** First vertex */
|
|
176
|
+
v0: Vec3;
|
|
177
|
+
/** Second vertex */
|
|
178
|
+
v1: Vec3;
|
|
179
|
+
/** Normal of first adjacent face (null if boundary) */
|
|
180
|
+
face0Normal: Vec3 | null;
|
|
181
|
+
/** Normal of second adjacent face (null if boundary) */
|
|
182
|
+
face1Normal: Vec3 | null;
|
|
183
|
+
/** Dihedral angle between faces (radians) */
|
|
184
|
+
dihedralAngle: number;
|
|
185
|
+
/** Edge classification */
|
|
186
|
+
type: 'crease' | 'boundary' | 'smooth';
|
|
187
|
+
/** Source entity ID */
|
|
188
|
+
entityId: number;
|
|
189
|
+
/** IFC type */
|
|
190
|
+
ifcType: string;
|
|
191
|
+
/** Model index */
|
|
192
|
+
modelIndex: number;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Entity key for grouping geometry
|
|
196
|
+
*/
|
|
197
|
+
export type EntityKey = `${number}:${number}`;
|
|
198
|
+
/**
|
|
199
|
+
* Create entity key from components
|
|
200
|
+
*/
|
|
201
|
+
export declare function makeEntityKey(modelIndex: number, entityId: number): EntityKey;
|
|
202
|
+
/**
|
|
203
|
+
* Parse entity key back to components
|
|
204
|
+
*/
|
|
205
|
+
export declare function parseEntityKey(key: EntityKey): {
|
|
206
|
+
modelIndex: number;
|
|
207
|
+
entityId: number;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Door operation type (from IFC IfcDoorTypeOperationEnum)
|
|
211
|
+
*/
|
|
212
|
+
export type DoorOperationType = 'SINGLE_SWING_LEFT' | 'SINGLE_SWING_RIGHT' | 'DOUBLE_DOOR_SINGLE_SWING' | 'DOUBLE_DOOR_DOUBLE_SWING' | 'DOUBLE_SWING_LEFT' | 'DOUBLE_SWING_RIGHT' | 'SLIDING_TO_LEFT' | 'SLIDING_TO_RIGHT' | 'DOUBLE_DOOR_SLIDING' | 'FOLDING_TO_LEFT' | 'FOLDING_TO_RIGHT' | 'DOUBLE_DOOR_FOLDING' | 'REVOLVING' | 'ROLLINGUP' | 'SWING_FIXED_LEFT' | 'SWING_FIXED_RIGHT' | 'USERDEFINED' | 'NOTDEFINED';
|
|
213
|
+
/**
|
|
214
|
+
* Window operation type (from IFC IfcWindowTypePartitioningEnum)
|
|
215
|
+
*/
|
|
216
|
+
export type WindowPartitioningType = 'SINGLE_PANEL' | 'DOUBLE_PANEL_VERTICAL' | 'DOUBLE_PANEL_HORIZONTAL' | 'TRIPLE_PANEL_VERTICAL' | 'TRIPLE_PANEL_HORIZONTAL' | 'TRIPLE_PANEL_BOTTOM' | 'TRIPLE_PANEL_TOP' | 'TRIPLE_PANEL_LEFT' | 'TRIPLE_PANEL_RIGHT' | 'USERDEFINED' | 'NOTDEFINED';
|
|
217
|
+
/**
|
|
218
|
+
* Information about an opening (door, window, or void)
|
|
219
|
+
*/
|
|
220
|
+
export interface OpeningInfo {
|
|
221
|
+
/** Type of opening */
|
|
222
|
+
type: 'door' | 'window' | 'opening';
|
|
223
|
+
/** Express ID of the opening element */
|
|
224
|
+
openingId: number;
|
|
225
|
+
/** Express ID of the host element (wall, slab, etc.) */
|
|
226
|
+
hostElementId: number;
|
|
227
|
+
/** Express ID of the filling element (door/window), if any */
|
|
228
|
+
fillingElementId?: number;
|
|
229
|
+
/** IFC type of the filling element */
|
|
230
|
+
fillingType?: string;
|
|
231
|
+
/** Opening width in world units */
|
|
232
|
+
width: number;
|
|
233
|
+
/** Opening height in world units */
|
|
234
|
+
height: number;
|
|
235
|
+
/** 3D bounding box of the opening */
|
|
236
|
+
bounds3D: {
|
|
237
|
+
min: Vec3;
|
|
238
|
+
max: Vec3;
|
|
239
|
+
};
|
|
240
|
+
/** Door operation type (for doors) */
|
|
241
|
+
doorOperation?: DoorOperationType;
|
|
242
|
+
/** Window partitioning type (for windows) */
|
|
243
|
+
windowPartitioning?: WindowPartitioningType;
|
|
244
|
+
/** Model index for multi-model federation */
|
|
245
|
+
modelIndex: number;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Relationship data for opening-aware drawing generation
|
|
249
|
+
*/
|
|
250
|
+
export interface OpeningRelationships {
|
|
251
|
+
/** Map of host element ID to opening IDs that void it */
|
|
252
|
+
voidedBy: Map<number, number[]>;
|
|
253
|
+
/** Map of opening ID to filling element ID (door/window) */
|
|
254
|
+
filledBy: Map<number, number>;
|
|
255
|
+
/** Map of opening/filling element ID to opening info */
|
|
256
|
+
openingInfo: Map<number, OpeningInfo>;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Void relationship from IfcRelVoidsElement
|
|
260
|
+
*/
|
|
261
|
+
export interface VoidRelationship {
|
|
262
|
+
/** Host element express ID (wall, slab, etc.) */
|
|
263
|
+
hostId: number;
|
|
264
|
+
/** Opening element express ID */
|
|
265
|
+
openingId: number;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Fill relationship from IfcRelFillsElement
|
|
269
|
+
*/
|
|
270
|
+
export interface FillRelationship {
|
|
271
|
+
/** Opening element express ID */
|
|
272
|
+
openingId: number;
|
|
273
|
+
/** Filling element express ID (door, window) */
|
|
274
|
+
elementId: number;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Line weight classification for architectural drawings
|
|
278
|
+
*/
|
|
279
|
+
export type LineWeight = 'heavy' | 'medium' | 'light' | 'hairline';
|
|
280
|
+
/**
|
|
281
|
+
* Line style for different element types
|
|
282
|
+
*/
|
|
283
|
+
export type LineStyle = 'solid' | 'dashed' | 'dotted' | 'centerline' | 'phantom';
|
|
284
|
+
/**
|
|
285
|
+
* Semantic line type for architectural categorization
|
|
286
|
+
*/
|
|
287
|
+
export type SemanticLineType = 'wall-cut' | 'wall-projection' | 'column-cut' | 'slab-cut' | 'opening-frame' | 'door-swing' | 'door-leaf' | 'window-frame' | 'window-mullion' | 'stair-cut' | 'stair-nosing' | 'furniture' | 'equipment' | 'annotation' | 'dimension' | 'hidden' | 'centerline';
|
|
288
|
+
/**
|
|
289
|
+
* Line weight configuration
|
|
290
|
+
*/
|
|
291
|
+
export interface LineWeightConfig {
|
|
292
|
+
weight: LineWeight;
|
|
293
|
+
/** Width in mm for SVG output */
|
|
294
|
+
widthMm: number;
|
|
295
|
+
style: LineStyle;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Extended drawing line with architectural styling
|
|
299
|
+
*/
|
|
300
|
+
export interface ArchitecturalLine extends DrawingLine {
|
|
301
|
+
/** Line weight for rendering */
|
|
302
|
+
lineWeight: LineWeight;
|
|
303
|
+
/** Line style (solid, dashed, etc.) */
|
|
304
|
+
lineStyle: LineStyle;
|
|
305
|
+
/** Semantic type for layer assignment */
|
|
306
|
+
semanticType: SemanticLineType;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Type of architectural symbol
|
|
310
|
+
*/
|
|
311
|
+
export type SymbolType = 'door-swing' | 'door-sliding' | 'door-folding' | 'door-revolving' | 'window-frame' | 'stair-arrow' | 'north-arrow' | 'section-mark' | 'level-mark';
|
|
312
|
+
/**
|
|
313
|
+
* Architectural symbol for 2D drawings
|
|
314
|
+
*/
|
|
315
|
+
export interface ArchitecturalSymbol {
|
|
316
|
+
/** Symbol type */
|
|
317
|
+
type: SymbolType;
|
|
318
|
+
/** Position in 2D drawing space */
|
|
319
|
+
position: Point2D;
|
|
320
|
+
/** Rotation angle in radians */
|
|
321
|
+
rotation: number;
|
|
322
|
+
/** Scale factor */
|
|
323
|
+
scale: number;
|
|
324
|
+
/** Symbol-specific parameters */
|
|
325
|
+
parameters: SymbolParameters;
|
|
326
|
+
/** Associated entity ID (if any) */
|
|
327
|
+
entityId?: number;
|
|
328
|
+
/** Model index */
|
|
329
|
+
modelIndex?: number;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Parameters for door swing symbol
|
|
333
|
+
*/
|
|
334
|
+
export interface DoorSwingParameters {
|
|
335
|
+
/** Door leaf width */
|
|
336
|
+
width: number;
|
|
337
|
+
/** Swing direction: 1 = counter-clockwise, -1 = clockwise */
|
|
338
|
+
swingDirection: 1 | -1;
|
|
339
|
+
/** Swing angle in radians (typically π/2) */
|
|
340
|
+
swingAngle: number;
|
|
341
|
+
/** Hinge position */
|
|
342
|
+
hingePoint: Point2D;
|
|
343
|
+
/** Whether this is a double door */
|
|
344
|
+
isDouble: boolean;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Parameters for sliding door symbol
|
|
348
|
+
*/
|
|
349
|
+
export interface SlidingDoorParameters {
|
|
350
|
+
/** Door panel width */
|
|
351
|
+
width: number;
|
|
352
|
+
/** Slide direction: 1 = positive, -1 = negative */
|
|
353
|
+
slideDirection: 1 | -1;
|
|
354
|
+
/** Number of panels */
|
|
355
|
+
panelCount: number;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Parameters for window frame symbol
|
|
359
|
+
*/
|
|
360
|
+
export interface WindowFrameParameters {
|
|
361
|
+
/** Window width */
|
|
362
|
+
width: number;
|
|
363
|
+
/** Frame depth (thickness shown in plan) */
|
|
364
|
+
frameDepth: number;
|
|
365
|
+
/** Number of mullions */
|
|
366
|
+
mullionCount: number;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Parameters for stair arrow symbol
|
|
370
|
+
*/
|
|
371
|
+
export interface StairArrowParameters {
|
|
372
|
+
/** Direction: 'up' or 'down' */
|
|
373
|
+
direction: 'up' | 'down';
|
|
374
|
+
/** Arrow length */
|
|
375
|
+
length: number;
|
|
376
|
+
/** Number of risers to label */
|
|
377
|
+
riserCount?: number;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Union type for all symbol parameters
|
|
381
|
+
*/
|
|
382
|
+
export type SymbolParameters = DoorSwingParameters | SlidingDoorParameters | WindowFrameParameters | StairArrowParameters | Record<string, number | string | boolean>;
|
|
383
|
+
/**
|
|
384
|
+
* AIA layer naming convention codes
|
|
385
|
+
*/
|
|
386
|
+
export type AIALayerCode = 'A-WALL' | 'A-WALL-FULL' | 'A-WALL-PRHT' | 'A-DOOR' | 'A-GLAZ' | 'A-COLS' | 'A-FLOR' | 'A-CLNG' | 'A-ROOF' | 'A-STRS' | 'A-FURN' | 'A-EQPM' | 'A-PATT' | 'A-ANNO' | 'A-DIMS' | 'A-SYMB' | 'A-DETL' | 'A-ELEV' | 'A-SECT' | 'A-HIDN';
|
|
387
|
+
/**
|
|
388
|
+
* Layer definition for SVG export
|
|
389
|
+
*/
|
|
390
|
+
export interface LayerDefinition {
|
|
391
|
+
/** Layer ID (for SVG) */
|
|
392
|
+
id: string;
|
|
393
|
+
/** AIA layer code */
|
|
394
|
+
aiaCode: AIALayerCode;
|
|
395
|
+
/** Human-readable label */
|
|
396
|
+
label: string;
|
|
397
|
+
/** Default visibility */
|
|
398
|
+
visible: boolean;
|
|
399
|
+
/** Default line weight for layer */
|
|
400
|
+
defaultWeight: LineWeight;
|
|
401
|
+
/** Layer color (CSS color string) */
|
|
402
|
+
color: string;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Drawing context with relationships for architectural generation
|
|
406
|
+
*/
|
|
407
|
+
export interface DrawingContext {
|
|
408
|
+
/** Relationship data for openings */
|
|
409
|
+
relationships?: {
|
|
410
|
+
voids: VoidRelationship[];
|
|
411
|
+
fills: FillRelationship[];
|
|
412
|
+
};
|
|
413
|
+
/** Entity metadata (bounding boxes, properties) */
|
|
414
|
+
entityMetadata?: Map<number, EntityMetadata>;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Metadata for an IFC entity
|
|
418
|
+
*/
|
|
419
|
+
export interface EntityMetadata {
|
|
420
|
+
/** IFC type name */
|
|
421
|
+
ifcType: string;
|
|
422
|
+
/** 3D bounding box */
|
|
423
|
+
bounds?: {
|
|
424
|
+
min: Vec3;
|
|
425
|
+
max: Vec3;
|
|
426
|
+
};
|
|
427
|
+
/** Property set values (for door operation, etc.) */
|
|
428
|
+
properties?: Record<string, unknown>;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Enhanced 2D drawing with architectural features
|
|
432
|
+
*/
|
|
433
|
+
export interface ArchitecturalDrawing2D extends Drawing2D {
|
|
434
|
+
/** Architectural symbols (door swings, etc.) */
|
|
435
|
+
symbols: ArchitecturalSymbol[];
|
|
436
|
+
/** Layer definitions */
|
|
437
|
+
layers: LayerDefinition[];
|
|
438
|
+
/** Lines with architectural styling */
|
|
439
|
+
architecturalLines: ArchitecturalLine[];
|
|
440
|
+
/** Opening relationships used */
|
|
441
|
+
openings: OpeningInfo[];
|
|
442
|
+
}
|
|
443
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAMD,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,IAAI,EAAE,WAAW,CAAC;IAClB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,KAAK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C3B,CAAC;IACF,mDAAmD;IACnD,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE;QACP,GAAG,EAAE,IAAI,CAAC;QACV,GAAG,EAAE,IAAI,CAAC;KACX,CAAC;IACF,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,gDAAgD;IAChD,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,wBAAwB;IACxB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,uCAAuC;IACvC,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,iCAAiC;IACjC,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
export const DEFAULT_SECTION_CONFIG = {
|
|
5
|
+
projectionDepth: 10,
|
|
6
|
+
includeHiddenLines: true,
|
|
7
|
+
creaseAngle: 30,
|
|
8
|
+
scale: 100,
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Create entity key from components
|
|
12
|
+
*/
|
|
13
|
+
export function makeEntityKey(modelIndex, entityId) {
|
|
14
|
+
return `${modelIndex}:${entityId}`;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse entity key back to components
|
|
18
|
+
*/
|
|
19
|
+
export function parseEntityKey(key) {
|
|
20
|
+
const parts = key.split(':');
|
|
21
|
+
if (parts.length !== 2) {
|
|
22
|
+
throw new Error(`Invalid entity key format: "${key}". Expected "modelIndex:entityId"`);
|
|
23
|
+
}
|
|
24
|
+
const modelIndex = Number(parts[0]);
|
|
25
|
+
const entityId = Number(parts[1]);
|
|
26
|
+
if (!Number.isFinite(modelIndex) || !Number.isFinite(entityId)) {
|
|
27
|
+
throw new Error(`Invalid entity key values: "${key}". Both modelIndex and entityId must be valid numbers`);
|
|
28
|
+
}
|
|
29
|
+
return { modelIndex, entityId };
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiD/D,MAAM,CAAC,MAAM,sBAAsB,GAAiC;IAClE,eAAe,EAAE,EAAE;IACnB,kBAAkB,EAAE,IAAI;IACxB,WAAW,EAAE,EAAE;IACf,KAAK,EAAE,GAAG;CACX,CAAC;AA4NF;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,UAAkB,EAAE,QAAgB;IAChE,OAAO,GAAG,UAAU,IAAI,QAAQ,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAc;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,mCAAmC,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,uDAAuD,CAAC,CAAC;IAC7G,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAClC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ifc-lite/drawing-2d",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "2D architectural drawing generation from IFC models - section cuts, floor plans, and elevations",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@ifc-lite/geometry": "^1.3.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@webgpu/types": "^0.1.69",
|
|
19
|
+
"typescript": "^5.3.0",
|
|
20
|
+
"vitest": "^1.6.0"
|
|
21
|
+
},
|
|
22
|
+
"license": "MPL-2.0",
|
|
23
|
+
"author": "Louis True",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/louistrue/ifc-lite.git",
|
|
27
|
+
"directory": "packages/drawing-2d"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://louistrue.github.io/ifc-lite/",
|
|
30
|
+
"bugs": "https://github.com/louistrue/ifc-lite/issues",
|
|
31
|
+
"keywords": [
|
|
32
|
+
"ifc",
|
|
33
|
+
"bim",
|
|
34
|
+
"2d",
|
|
35
|
+
"drawing",
|
|
36
|
+
"section",
|
|
37
|
+
"floorplan",
|
|
38
|
+
"cad",
|
|
39
|
+
"aec"
|
|
40
|
+
],
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsc",
|
|
50
|
+
"dev": "tsc --watch",
|
|
51
|
+
"test": "vitest run --passWithNoTests"
|
|
52
|
+
}
|
|
53
|
+
}
|