forked from 1b-agent/opencadstudio-upstream
Polish automatic constraint integration
This commit is contained in:
1 parent
c9eeb6f66e
commit
f61174eaad
3 files changed
+20
-11
No files matched your search
+2
-4
@@ -67,10 +67,8 @@ impl Default for AutoConstrainSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
priority: AutoConstraintKind::ALL.to_vec(),
|
||||
// Equal remains available in the priority list, but the reference
|
||||
// application does not enable it in a fresh profile. Enabling it
|
||||
// by default adds a redundant relation between equal-length line
|
||||
// segments (including adjacent polyline segments).
|
||||
// Keep Equal available without creating redundant relations
|
||||
// between equal-length segments by default.
|
||||
enabled: AutoConstraintKind::ALL
|
||||
.into_iter()
|
||||
.filter(|kind| *kind != AutoConstraintKind::Equal)
|
||||
|
||||
+1
-1
@@ -12591,7 +12591,7 @@ mod layout_cache_tests {
|
||||
let mut arc = acadrust::entities::Arc::default();
|
||||
arc.radius = 25.0;
|
||||
arc.start_angle = 0.0;
|
||||
arc.end_angle = 3.14159;
|
||||
arc.end_angle = std::f64::consts::PI;
|
||||
let a_h = s.add_entity(EntityType::Arc(arc));
|
||||
|
||||
let line = acadrust::entities::Line::from_points(
|
||||
|
||||
@@ -1356,9 +1356,18 @@ mod tests {
|
||||
std::f64::consts::PI,
|
||||
));
|
||||
|
||||
assert_eq!(driven_ref_for_grip(&arc, handle, 0), Some(ParametricRef::center(handle)));
|
||||
assert_eq!(driven_ref_for_grip(&arc, handle, 1), Some(ParametricRef::point(handle, 0)));
|
||||
assert_eq!(driven_ref_for_grip(&arc, handle, 2), Some(ParametricRef::point(handle, 1)));
|
||||
assert_eq!(
|
||||
driven_ref_for_grip(&arc, handle, 0),
|
||||
Some(ParametricRef::center(handle))
|
||||
);
|
||||
assert_eq!(
|
||||
driven_ref_for_grip(&arc, handle, 1),
|
||||
Some(ParametricRef::point(handle, 0))
|
||||
);
|
||||
assert_eq!(
|
||||
driven_ref_for_grip(&arc, handle, 2),
|
||||
Some(ParametricRef::point(handle, 1))
|
||||
);
|
||||
assert_eq!(driven_ref_for_grip(&arc, handle, 3), None);
|
||||
}
|
||||
|
||||
@@ -1528,9 +1537,11 @@ mod tests {
|
||||
fn hidden_constraint_stays_hidden_when_related_entity_is_selected() {
|
||||
let mut scene = super::super::Scene::new();
|
||||
let scope = ParametricScope::ModelSpace;
|
||||
let id = scene
|
||||
.parametric_constraint_set_mut(scope)
|
||||
.add(ConstraintKind::Horizontal, vec![ParametricRef::whole(h(1))], None);
|
||||
let id = scene.parametric_constraint_set_mut(scope).add(
|
||||
ConstraintKind::Horizontal,
|
||||
vec![ParametricRef::whole(h(1))],
|
||||
None,
|
||||
);
|
||||
scene.hidden_parametric_constraints.insert((scope, id));
|
||||
|
||||
assert!(!scene.should_display_parametric_constraint(scope, id, true, 2));
|
||||
|
||||
Reference in new issue
Block a user