You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Intersection at the back side happens when the curvature is positive, i.e. curved in the back direction and the y coordinate of the back is larger or equal to the radius of curvature
67
67
// Intersection at the belly side happens when the curvature is negative, i.e. curved in the belly direction and the y coordinate of the belly is larger or equal to the radius of curvature
@@ -181,22 +176,29 @@ impl From<version3::BowModel> for BowModel {
181
176
handle_offset: model.dimensions.handle_setback,
182
177
};
183
178
184
-
let materials = model.materials.iter().map(|material| Material{
185
-
name: material.name.clone(),
186
-
color: material.color.clone(),
187
-
density: material.rho,
188
-
youngs_modulus: material.E,
189
-
shear_modulus: material.E/(2.0*(1.0 + 0.4)),// Shear modulus was newly added. Estimate for poisson ratio v = 0.4.
190
-
tensile_strength:0.0,// Field was newly introduced, value unknown.
191
-
compressive_strength:0.0,// Field was newly introduced, value unknown.
192
-
safety_margin:0.0// Field was newly introduced, value unknown.
179
+
let materials = model.materials.iter().map(|material| {
180
+
letmut shear_modulus = material.E/(2.0*(1.0 + 0.4));// Shear modulus was newly added. Estimate for poisson ratio v = 0.4
181
+
let factor = 0.1*material.E;
182
+
shear_modulus = (shear_modulus/factor).round()*factor;// Round to precision based on E
183
+
shear_modulus = f64::max(shear_modulus, factor);// Minimum if rounded to zero
184
+
185
+
Material{
186
+
name: material.name.clone(),
187
+
color: material.color.clone(),
188
+
density: material.rho,
189
+
youngs_modulus: material.E,
190
+
shear_modulus,
191
+
tensile_strength:0.0,// Field was newly introduced, value unknown.
192
+
compressive_strength:0.0,// Field was newly introduced, value unknown.
193
+
safety_margin:0.0// Field was newly introduced, value unknown.
194
+
}
193
195
}).collect_vec();
194
196
195
197
let layers = model.layers.iter().map(|layer| Layer{
196
198
name: layer.name.clone(),
197
199
material: materials[layer.material].name.clone(),
198
200
height: layer.height.clone(),
199
-
}).rev().collect_vec();// Layers were previously defined from back to belly, but are now from belly to back (direction of the y axis), so the old layers have to be reversed
201
+
}).collect_vec();
200
202
201
203
let section = Section{
202
204
alignment:LayerAlignment::SectionBack,// Field was newly introduced. Previously the profile curve was always aligned with the cross section's back.
0 commit comments