Commit 7d3a40b
authored
feat(geometry): honor IfcSweptDiskSolid StartParam/EndParam (#606)
The swept-disk solid processor read attribute 1 (Radius) but ignored
attributes 3 (StartParam) and 4 (EndParam) entirely. Files where the
directrix is an IfcCompositeCurve or IfcPolyline and the trim params
restrict the sweep to a sub-range of the curve rendered the whole
curve instead — most visibly in rebar models from Revit/Tekla, where
a 2 m bar declared as IFCSWEPTDISKSOLID(#dir, r, $, 0., 1.) over a
3-segment composite curve rendered as 12 m with all the end-hooks
unfolded into the bar.
Dispatch now honors trim parameters for the two directrix types
whose IFC parameterisation is unambiguous from the entity:
- IfcCompositeCurve (and subtypes via is_subtype_of): segment-
index based, each segment contributes 1.0 to the parameter.
- IfcPolyline: point-index based, each segment between consecutive
points contributes 1.0.
Boundary segments are truncated by linear interpolation along the
sampled polyline — exact for piecewise-linear input, an approximation
for curved parents (acceptable for rebar). Out-of-range params clamp;
inverted (start >= end) ranges return an empty mesh. Other directrix
types (IfcLine, IfcCircle, IfcTrimmedCurve, IfcBSplineCurve) still
ignore trim — their parameterisations are length / angle / knot-based
and need separate handling — flagged as a known limitation.
Adds 11 unit tests in profiles::tests covering: full-range identity,
exact-half boundaries, strict-interior comparisons, two-point partial
trim, fractional multi-segment trim with dedup, out-of-range clamping,
inverted ranges, SameSense=F reverse-then-trim semantics, and direct-
polyline-directrix paths.1 parent cf77e6a commit 7d3a40b
3 files changed
Lines changed: 494 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
60 | 91 | | |
61 | 92 | | |
62 | 93 | | |
| |||
0 commit comments