3D sketch: with 3D Sketch on, the Line, Spline and Point tools take points off the sketch plane, snapping to model vertices, edges and faces and to drawn 3D points (segments that stay on the plane are ordinary sketch lines); drawn 3D curves are wires with fit points (sketch.line3d, sketch.spline3d: centripetal Catmull-Rom, sketch.point3d), a clicked 3D point gets a move triad (drag along X/Y/Z or parallel to the sketch plane: sketch.move3d, joined ends move together), Delete removes it; sweep and pipe paths may mix 3D curves with sketch curves; control: ui.triad, ui.worldToScreen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
1 parent
d2068e07a3
commit
d40ef5bbdc
14 files changed
+755
-10
No files matched your search
@@ -100,6 +100,7 @@ fn xy(p: &(Vec2, Option<String>)) -> Value {
|
||||
}
|
||||
|
||||
pub fn on_hover(app: &mut SolveApp, proj: &Proj, pos: Pos2) {
|
||||
crate::sketch3d::on_hover(app, proj, pos);
|
||||
let h = sketch_point_at(app, proj, pos);
|
||||
if let Some(t) = app.tool.as_mut() {
|
||||
t.hover = h;
|
||||
@@ -108,6 +109,11 @@ pub fn on_hover(app: &mut SolveApp, proj: &Proj, pos: Pos2) {
|
||||
|
||||
pub fn on_click(app: &mut SolveApp, proj: &Proj, pos: Pos2) {
|
||||
let Some(mut tool) = app.tool.take() else { return };
|
||||
// In a 3D sketch the drawing tools take points off the plane.
|
||||
if crate::sketch3d::on_click(app, &mut tool, proj, pos) {
|
||||
app.tool = Some(tool);
|
||||
return;
|
||||
}
|
||||
match tool.kind {
|
||||
Kind::Draw(_) => {
|
||||
if let Some(mut p) = sketch_point_at(app, proj, pos) {
|
||||
@@ -252,6 +258,9 @@ fn run_pick(app: &mut SolveApp, t: &Tool) {
|
||||
|
||||
/// Right click / Esc: end the current chain (line) or cancel the tool.
|
||||
pub fn finish(app: &mut SolveApp) {
|
||||
if crate::sketch3d::finish(app) {
|
||||
return;
|
||||
}
|
||||
if let Some(mut t) = app.tool.take_if(|t| t.kind == Kind::Ext) {
|
||||
if crate::sketch_tools::finish(app, &mut t) {
|
||||
app.tool = Some(t);
|
||||
@@ -270,6 +279,9 @@ pub fn finish(app: &mut SolveApp) {
|
||||
|
||||
/// Rubber-band preview of the shape being drawn.
|
||||
pub fn preview(app: &SolveApp, t: &Tool, painter: &egui::Painter, proj: &Proj) {
|
||||
if crate::sketch3d::preview(app, t, painter, proj) {
|
||||
return;
|
||||
}
|
||||
if t.kind == Kind::Ext {
|
||||
return crate::sketch_tools::preview(app, t, painter, proj);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user