Commit 5439cce
authored
Render IfcExtrudedAreaSolidTapered (tapered extrusions) (#630)
* geometry: render IfcExtrudedAreaSolidTapered (#628)
Tapered extrusions were skipped by the geometry engine even though the
parser already recognised the entity. Add a dedicated processor that
lofts between SweptArea and EndSweptArea, register it on the router,
and accept the subtype in the profile extractor and IfcMappedItem
dispatcher so the elements show up in 2D projection too. Falls back to
a uniform extrusion when EndSweptArea is missing so malformed files
still render.
* geometry: address review feedback on tapered extrusion (#630)
- Don't route IfcExtrudedAreaSolidTapered through the constant-profile 2D
drawing extractor. extract_extruded_solid only stores SweptArea, so
emitting tapered solids there silently under-reports footprints.
Tracked as a follow-up; the 3D path still renders them.
- Reject zero-length ExtrudedDirection vectors instead of normalizing to
NaNs, which would propagate into the transform and mesh.
- Treat EndSweptArea profile-processing errors as a fallback to uniform
extrusion (matching the existing null/empty handling) rather than
aborting the whole solid.
- Build filtered Profile2D copies so cap triangulation only includes the
hole pairs we actually loft. With the previous code, an extra hole on
one profile would leave an opening in the cap with no matching side
wall, producing a non-manifold mesh.
Regenerates packages/wasm/pkg via scripts/build-wasm.sh so the Vercel
preview and downstream packages pick up the geometry fix.
* geometry: fix stale doc on extrude_profile_lofted hole handling
The previous wording said mismatched-count hole pairs were dropped; the
implementation actually resamples them via match_loop_lengths, only
dropping pairs where one side has fewer than 3 vertices.
* geometry: fix inverted side-wall normals on tapered extrusions
`edge_a.cross(edge_b)` collapses to the negative of the normal that
`create_side_walls` produces in the untapered limit, so tapered faces
shaded inward relative to regular extrusions. Switch to
`edge_b.cross(edge_a)` (tangent rotated +90° CCW around +Z, matching
the existing convention) and document the assumption.
Adds a regression test that lofts identical profiles and asserts the
side-wall normal direction agrees with `extrude_profile`.
Also documents in the doc comment that we trust IFC WR2 to mean shared
winding direction and corresponding start vertex; orientation
detection / cyclic offset alignment is intentionally not added (would
be defensive coding for malformed input that the spec forbids).
Two related CodeRabbit comments not addressed in this commit:
- README absolute-link suggestion targets pre-existing language in
the root README, unrelated to #628.
- Winding/cyclic-offset alignment in match_loop_lengths is the
defensive coding above.
Regenerates packages/wasm/pkg1 parent 94b4df3 commit 5439cce
16 files changed
Lines changed: 630 additions & 34 deletions
File tree
- .changeset
- packages/wasm/pkg
- rust/geometry/src
- processors
- router
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
252 | 258 | | |
253 | 259 | | |
254 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
1197 | | - | |
1198 | | - | |
1199 | | - | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
| 215 | + | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
220 | | - | |
| 219 | + | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
3093 | 3093 | | |
3094 | 3094 | | |
3095 | 3095 | | |
3096 | | - | |
| 3096 | + | |
3097 | 3097 | | |
3098 | 3098 | | |
3099 | 3099 | | |
| |||
3205 | 3205 | | |
3206 | 3206 | | |
3207 | 3207 | | |
3208 | | - | |
3209 | | - | |
3210 | | - | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
3211 | 3211 | | |
3212 | 3212 | | |
3213 | 3213 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
219 | | - | |
220 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
0 commit comments