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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
//! The sweeps whose record depends on the model's declared release.
//!
//! `StartParam`/`EndParam` of the directrix-driven sweeps are
//! `IfcParameterValue` in IFC2X3 and IFC4 (written bare) and the SELECT
//! `IfcCurveMeasureSelect` in IFC4X3 (written `IFCPARAMETERVALUE(..)`), so a
//! writer without a model cannot be right in every release (#200). The swept
//! disk's trim keeps its form but not its optionality: IFC2X3 requires it,
//! later releases do not (#210). These writers take the model and write what
//! its release declares; see `release.rs` for the evidence and the binding
//! rule. They are the only writers of these three entities.
use ;
use crateGeometryError;
use cratedirectrix_slot;
use bind;
use ;
/// Stage an `IfcSurfaceCurveSweptAreaSolid` in `model`'s declared release.
///
/// The profile is swept along `directrix` while staying on
/// `reference_surface`, which is what fixes its orientation. The trim
/// parameters take the form the release declares:
///
/// ```text
/// IFC2X3 StartParam : IfcParameterValue 0.5 (required)
/// IFC4 StartParam : OPTIONAL IfcParameterValue 0.5
/// IFC4X3 StartParam : OPTIONAL IfcCurveMeasureSelect
/// IFCPARAMETERVALUE(0.5)
/// ```
///
/// A model without `FILE_SCHEMA` binds IFC4.
///
/// # Errors
///
/// [`GeometryError::InvalidAuthoredValue`] for a non-finite trim parameter,
/// or an attribute the release requires left unset (in IFC2X3, `Position`,
/// `StartParam` and `EndParam`).
/// [`GeometryError::AuthoringSchemaUnbound`] if `FILE_SCHEMA` names an
/// unknown release or several. Nothing is staged on error.
/// Stage an `IfcFixedReferenceSweptAreaSolid` in `model`'s declared release.
///
/// Like the surface-curve sweep, but the profile's orientation is fixed by a
/// direction rather than by a surface. The trim parameters are bare in IFC4
/// and `IFCPARAMETERVALUE(..)` in IFC4X3. IFC2X3 does not declare the
/// entity. A model without `FILE_SCHEMA` binds IFC4.
///
/// # Errors
///
/// [`GeometryError::InvalidAuthoredValue`] for a non-finite trim parameter.
/// [`GeometryError::AuthoringEntityNotInSchema`] in IFC2X3.
/// [`GeometryError::AuthoringSchemaUnbound`] if `FILE_SCHEMA` names an
/// unknown release or several. Nothing is staged on error.
/// Stage an `IfcSweptDiskSolid` in `model`'s declared release: a disk swept
/// along a curve.
///
/// Note the slot layout: this subtypes `IfcSolidModel` directly, so
/// `Directrix` is slot 0 and there is no `SweptArea` or `Position`.
///
/// The trim parameters are `IfcParameterValue`, written bare, in every
/// release; what changes is whether they may be left out:
///
/// ```text
/// IFC2X3 StartParam : IfcParameterValue (required)
/// IFC4 StartParam : OPTIONAL IfcParameterValue
/// IFC4X3 StartParam : OPTIONAL IfcParameterValue
/// ```
///
/// An IFC2X3 swept disk therefore needs both trim values; the writer does
/// not invent the directrix's full range, which only an evaluator knows. A
/// model without `FILE_SCHEMA` binds IFC4.
///
/// # Errors
///
/// [`GeometryError::InvalidAuthoredValue`] for a non-positive radius or
/// inner radius, an inner radius that is not smaller than the outer one (a
/// bore wider than its tube leaves no solid), a non-finite trim parameter,
/// or, in IFC2X3, an unset `StartParam` or `EndParam`.
/// [`GeometryError::AuthoringSchemaUnbound`] if `FILE_SCHEMA` names an
/// unknown release or several. Nothing is staged on error.