forked from 1b-agent/opencadstudio-upstream
Merge pull request #1679 from ramox81/codex/surface-associativity-sources
Associative extruded, revolved and lofted surfaces; spline and ellipse sources # Conflicts: # src/app/command_driver/solid3d.rs # src/scene/dwg_native_constraints.rs # src/scene/model/mod.rs # src/scene/model/sweep_command_model.rs # src/scene/model/sweep_model.rs # src/scene/modify.rs
This commit is contained in:
commit
5bb0efd93e
12 files changed
+1106
-228
No files matched your search
@@ -1131,6 +1131,7 @@ pub struct RevolveCommand {
|
||||
handles: Vec<Handle>,
|
||||
preview_profiles: Vec<(Handle, EntityType)>,
|
||||
injected_axis: Option<EntityType>,
|
||||
axis_object: Option<Handle>,
|
||||
axis_start: DVec3,
|
||||
axis_end: DVec3,
|
||||
working_plane: WorkingPlane,
|
||||
@@ -1183,6 +1184,7 @@ impl RevolveCommand {
|
||||
handles: Vec::new(),
|
||||
preview_profiles: Vec::new(),
|
||||
injected_axis: None,
|
||||
axis_object: None,
|
||||
axis_start: DVec3::ZERO,
|
||||
axis_end: DVec3::new(0.0, 0.0, 1.0),
|
||||
working_plane: WorkingPlane::default(),
|
||||
@@ -1319,6 +1321,7 @@ impl RevolveCommand {
|
||||
};
|
||||
self.axis_start = self.working_plane.origin;
|
||||
self.axis_end = self.axis_start + direction;
|
||||
self.axis_object = None;
|
||||
self.step = RevolveStep::Angle;
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
@@ -1337,6 +1340,7 @@ impl RevolveCommand {
|
||||
handles: self.handles.clone(),
|
||||
axis_start: self.axis_start,
|
||||
axis_end: self.axis_end,
|
||||
axis_object: self.axis_object,
|
||||
angle,
|
||||
start_angle: self.start_angle,
|
||||
mode: self.mode,
|
||||
@@ -1430,12 +1434,13 @@ impl CadCommand for RevolveCommand {
|
||||
}
|
||||
match self.step {
|
||||
RevolveStep::AxisObject => {
|
||||
let Some((start, end)) = self.injected_axis.take().as_ref().and_then(revolve_axis)
|
||||
else {
|
||||
let axis = self.injected_axis.take();
|
||||
let Some((start, end)) = axis.as_ref().and_then(revolve_axis) else {
|
||||
return CmdResult::NeedPoint;
|
||||
};
|
||||
self.axis_start = start;
|
||||
self.axis_end = end;
|
||||
self.axis_object = matches!(axis, Some(EntityType::Line(_))).then_some(handle);
|
||||
self.step = RevolveStep::Angle;
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
@@ -1446,6 +1451,7 @@ impl CadCommand for RevolveCommand {
|
||||
match self.step {
|
||||
RevolveStep::AxisStart => {
|
||||
self.axis_start = pt;
|
||||
self.axis_object = None;
|
||||
self.step = RevolveStep::AxisEnd;
|
||||
CmdResult::NeedPoint
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user