Accessibility Analysis: faces a tool coming along a direction reaches (facing it, nothing above: a depth map of the model seen from that direction, tested per pixel on the GPU) shade green, the rest red; the analyses (zebra, draft, curvature map, environment map, accessibility, minimum radius, isocurves, curvature comb, center of mass) also on SOLID INSPECT, and Interference on sketch INSPECT; path patterns follow 3D sketch curves through the same path chain as sweeps (path_segments_3d folded into path_points)
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
a7fc1fe532
commit
940c425316
10 files changed
+316
-65
No files matched your search
@@ -24,6 +24,11 @@ pub static COMMANDS: &[CommandSpec] = &[
|
||||
.icon("environment_map")
|
||||
.noundo()
|
||||
.params("clear?: true turns the analysis off"),
|
||||
CommandSpec::new("FusionAccessibilityAnalysisCommand", "Accessibility Analysis", accessibility)
|
||||
.at("SKETCH", "INSPECT")
|
||||
.icon("accessibility")
|
||||
.noundo()
|
||||
.params("direction?: [x,y,z] the tool comes from (default Z, from above); clear?: true turns the analysis off"),
|
||||
CommandSpec::new("FusionCurvatureMapAnalysisCommand", "Curvature Map Analysis", curvature_map)
|
||||
.at("SKETCH", "INSPECT")
|
||||
.icon("curvature_map")
|
||||
@@ -62,6 +67,16 @@ fn draft(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
set(s, p, SurfaceAnalysis::Draft { pull, angle })
|
||||
}
|
||||
|
||||
fn accessibility(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let dir = match p.get("direction") {
|
||||
Some(v) => {
|
||||
vec3(v).and_then(Vec3::normalized).ok_or_else(|| bad("FusionAccessibilityAnalysisCommand", "`direction` must be a non-zero [x,y,z]"))?
|
||||
}
|
||||
None => Vec3::Z,
|
||||
};
|
||||
set(s, p, SurfaceAnalysis::Access { dir })
|
||||
}
|
||||
|
||||
fn curvature_map(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let cmd = "FusionCurvatureMapAnalysisCommand";
|
||||
let radius = match num(p, "radius") {
|
||||
@@ -95,6 +110,8 @@ mod tests {
|
||||
assert!(matches!(s.analysis, Some(SurfaceAnalysis::Curvature { radius }) if (radius - 300f64.sqrt() / 10.0).abs() < 1e-6));
|
||||
s.execute("FusionEnvironmentMapAnalysisCommand", &json!({})).unwrap();
|
||||
assert_eq!(s.analysis, Some(SurfaceAnalysis::Environment));
|
||||
s.execute("FusionAccessibilityAnalysisCommand", &json!({"direction": [0, 0, -3]})).unwrap();
|
||||
assert_eq!(s.analysis, Some(SurfaceAnalysis::Access { dir: solvecraft_geom::Vec3::new(0.0, 0.0, -1.0) }));
|
||||
s.execute("FusionCurvatureMapAnalysisCommand", &json!({"clear": true})).unwrap();
|
||||
assert_eq!(s.analysis, None);
|
||||
assert_eq!(s.undo.len(), undo, "no undo steps");
|
||||
|
||||
Reference in new issue
Block a user