mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-06 20:02:16 +00:00
#6376 (a standard part's sketches are fully defined) reads the sketch being drawn straight from the document's features, after this branch's base. `fix_all` now takes it from `sketch_store::active` and `sketch_store::read`, as the store's scan requires, with the same result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -272,10 +272,7 @@ fn revolve(s: &mut Session, pts: &[(f64, f64)], op: &str) -> Result<()> {
|
||||
/// Fix every point and curve of the sketch being drawn: a standard part's outline is its size, so
|
||||
/// its sketches are fully defined and a check of the design finds nothing left free in them.
|
||||
fn fix_all(s: &mut Session) -> Result<()> {
|
||||
let sketch = s.active_sketch.and_then(|id| s.doc.features.iter().find(|f| f.id == id)).and_then(|f| match &f.kind {
|
||||
solidcraft_doc::FeatureKind::Sketch { sketch, .. } => Some(sketch),
|
||||
_ => None,
|
||||
});
|
||||
let sketch = super::sketch_store::active(s).and_then(|id| super::sketch_store::read(&s.doc, id).ok());
|
||||
let entities: Vec<String> =
|
||||
sketch.map(|sk| sk.points.iter().map(|p| p.id.clone()).chain(sk.curves.iter().map(|c| c.id.clone())).collect()).unwrap_or_default();
|
||||
if !entities.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user