Command ids are SolveCraft's own: 173 ids that were another product's internal command ids become dotted, lower-case ids (<area>.<thing>[.<variant>]: solid.extrude, sketch.rectangle.two_point, sheet.flange, joint.drive, ...), in the registry, toolbar, dialogs, shortcuts, palette, control channel, MCP, examples, scenarios and docs
The old ids live only in crates/engine/src/legacy_ids.rs (the legacy migration table): find_command maps them, so old scripts, recipes and control calls keep working, and saved shortcuts, recent and pinned commands are migrated on load (designs store no command ids). Parity maps the observed catalog ids to ours through xtask/data/fusion-ids.tsv. The agent rule now reads: our own dotted id, never another product's. Cargo.toml's repository points at github.com/bherbruck/solvecraft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
740360d7c3
commit
d10312b7fd
158 files changed
+3611
-3205
No files matched your search
@@ -0,0 +1,181 @@
|
||||
# Fusion catalog command id -> SolveCraft command id, for `cargo xtask parity` only (observation data).
|
||||
# A catalog command is live when its SolveCraft command is registered.
|
||||
SketchCreate sketch.create
|
||||
Extrude solid.extrude
|
||||
Revolve solid.revolve
|
||||
Sweep solid.sweep
|
||||
SolidLoft solid.loft
|
||||
FusionRibCommand solid.rib
|
||||
FusionWebCommand solid.web
|
||||
EmbossCmd solid.emboss
|
||||
FusionHoleCommand solid.hole
|
||||
FusionThreadCommand solid.thread
|
||||
PrimitiveBox solid.box
|
||||
PrimitiveCylinder solid.cylinder
|
||||
PrimitiveSphere solid.sphere
|
||||
PrimitiveTorus solid.torus
|
||||
PrimitiveCoil solid.coil
|
||||
PrimitivePipe solid.pipe
|
||||
StockModelCommand solid.bounding_solid
|
||||
PatternRectangular solid.pattern.rectangular
|
||||
PatternCircular solid.pattern.circular
|
||||
PatternOnPath solid.pattern.path
|
||||
MirrorCommand solid.mirror
|
||||
FusionSurfaceThickenCommand surface.thicken
|
||||
JointOrigin joint.origin
|
||||
FusionPressPullCommand solid.press_pull
|
||||
FusionFilletEdgesCommand solid.fillet
|
||||
FusionChamferCommand solid.chamfer
|
||||
FusionShellBodyCommand solid.shell
|
||||
FusionDraftCommand solid.draft
|
||||
ModifyScale solid.scale
|
||||
FusionCombineCommand solid.combine
|
||||
FusionOffsetFacesCommand solid.offset_face
|
||||
FusionReplaceFaceCommand solid.replace_face
|
||||
FusionSplitFaceCommand solid.split_face
|
||||
FusionSplitBodyCommand solid.split_body
|
||||
FusionMoveCommand solid.move
|
||||
AlignCmd solid.align
|
||||
FusionDeleteCommand timeline.delete
|
||||
SoftDeleteCommand solid.remove
|
||||
PhysicalMaterialCommand material.assign
|
||||
AppearanceCommand appearance.assign
|
||||
ChangeParameterCommand parameters.change
|
||||
FusionComputeAllCommand timeline.compute_all
|
||||
FusionImportCommandFromToolbar file.insert_step
|
||||
FusionCreateNewComponentCommand component.create
|
||||
JointAssembleCmdNew joint.create
|
||||
JointAsBuiltCmd joint.as_built
|
||||
RigidGroupCmd joint.rigid_group
|
||||
FusionMoveJointsCommand joint.drive
|
||||
FusionMotionRelationshipCommand joint.motion_link
|
||||
FusionMotionStudyCommand motion.study
|
||||
EnableContactSetsCmd contact.enable_sets
|
||||
EnableAllContactCmd contact.enable_all
|
||||
DisableAllContactCmd contact.disable_all
|
||||
ContactSetCmd contact.create
|
||||
FusionStartDesignConfigModeCmd config.configure
|
||||
FusionShowDesignConfigPanelCmd config.table
|
||||
ConstructionPlaneOffsetFromPlaneCommand construct.plane.offset
|
||||
ConstructionPlaneAtAngleCommand construct.plane.at_angle
|
||||
ConstructionTangentPlaneCommand construct.plane.tangent
|
||||
ConstructionMidPlaneCommand construct.plane.midplane
|
||||
ConstructionPlaneFromTwoEdgesCommand construct.plane.two_edges
|
||||
ConstructionPlaneFromThreePointsCommand construct.plane.three_points
|
||||
ConstructionPlaneAlongPathCommand construct.plane.along_path
|
||||
ConstructionAxisThroughCylinderCommand construct.axis.through_cylinder
|
||||
ConstructionAxisNormalToFaceCommand construct.axis.normal_to_face
|
||||
ConstructionAxisFromTwoPlanesCommand construct.axis.two_planes
|
||||
ConstructionAxisThroughTwoPointsCommand construct.axis.two_points
|
||||
ConstructionAxisThroughEdgeCommand construct.axis.edge
|
||||
ConstructionPointFromPointCommand construct.point.vertex
|
||||
ConstructionPointThroughTwoEdgesCommand construct.point.two_edges
|
||||
ConstructionPointFromThreePlanesCommand construct.point.three_planes
|
||||
ConstructionPointFromCircleOrSphereCommand construct.point.center
|
||||
ConstructionPointAtEdgeAndPlaneCommand construct.point.edge_plane
|
||||
ConstructionPointAlongPathCommand construct.point.along_path
|
||||
MeasureCommand inspect.measure
|
||||
InterferenceCheckCommand inspect.interference
|
||||
FusionHalfSectionViewCommand inspect.section
|
||||
FusionCurvatureCombAnalysisCommand inspect.curvature_comb
|
||||
FusionCurvatureMapAnalysisCommand inspect.curvature_map
|
||||
FusionDraftAnalysisCommand inspect.draft
|
||||
FusionEnvironmentMapAnalysisCommand inspect.environment_map
|
||||
FusionIsoCurveAnalysisCommand inspect.isocurve
|
||||
FusionZebraAnalysisCommand inspect.zebra
|
||||
FusionAccessibilityAnalysisCommand inspect.accessibility
|
||||
FusionCenterOfMassCommand inspect.center_of_mass
|
||||
FusionMinimumRadiusAnalysisCommand inspect.minimum_radius
|
||||
FusionAddEditDecalCommand canvas.decal
|
||||
FusionAddCanvasCommand canvas.insert
|
||||
SketchImportSVG sketch.insert_svg
|
||||
ImportDxfFileCommand sketch.insert_dxf
|
||||
ParaMeshInsertAlignCommand file.insert_mesh
|
||||
FusionFastenersCommand parts.fastener
|
||||
SnapshotCmd component.capture_position
|
||||
AsBuiltPositionsCmd component.revert_position
|
||||
DrawPolyline sketch.line
|
||||
SketchMidpointLine sketch.line.midpoint
|
||||
SketchConstrainer sketch.constrainer
|
||||
ShapeRectangleTwoPoint sketch.rectangle.two_point
|
||||
ShapeRectangleThreePoint sketch.rectangle.three_point
|
||||
ShapeRectangleCenter sketch.rectangle.center
|
||||
CircleCenterRadius sketch.circle.center
|
||||
CircleTwoPoint sketch.circle.two_point
|
||||
CircleThreePoint sketch.circle.three_point
|
||||
CircleTanTanRadius sketch.circle.two_tangent
|
||||
CircleThreeTangent sketch.circle.three_tangent
|
||||
ArcThreePoint sketch.arc.three_point
|
||||
ArcCenterTwoPoint sketch.arc.center_point
|
||||
ArcTangent sketch.arc.tangent
|
||||
ShapePolygonCircumscribed sketch.polygon.circumscribed
|
||||
ShapePolygonInscribed sketch.polygon.inscribed
|
||||
ShapePolygonEdge sketch.polygon.edge
|
||||
CircleElipse sketch.ellipse
|
||||
ShapeSlotCenterToCenter sketch.slot.center_to_center
|
||||
ShapeSlotOverall sketch.slot.overall
|
||||
ShapeSlotCenterPoint sketch.slot.center_point
|
||||
ShapeArcSlotThreePoint sketch.slot.arc_three_point
|
||||
ShapeArcSlotCenterTwoPoint sketch.slot.arc_center
|
||||
DrawSpline sketch.spline.fit_point
|
||||
DrawCVMSpline3D sketch.spline.control_point
|
||||
DrawCVMSpline5D sketch.spline.control_point_5
|
||||
ConicCurveCmd sketch.conic
|
||||
DrawPoint sketch.point
|
||||
MTextCmd sketch.text
|
||||
FitCurvesToSectionCommand sketch.fit_curves_to_section
|
||||
MirrorSketchCommand sketch.mirror
|
||||
CircularSketchPatternCommand sketch.pattern.circular
|
||||
RectangularSketchPatternCommand sketch.pattern.rectangular
|
||||
ProjectNewCmd sketch.project
|
||||
IntersectCmd sketch.intersect
|
||||
SpunProfileCmd sketch.spun_profile
|
||||
Include3DGeometry sketch.include_3d
|
||||
ProjectToSurface sketch.project_to_surface
|
||||
IntersectionCurve sketch.intersection_curve
|
||||
SketchIsoparametricCurve sketch.isoparametric_curve
|
||||
SketchDimension sketch.dimension
|
||||
FilletSketchCmd sketch.fillet
|
||||
ChamferSketchEqualDistance sketch.chamfer.equal_distance
|
||||
ChamferSketchDistanceAngle sketch.chamfer.distance_angle
|
||||
ChamferSketchDistanceDistance sketch.chamfer.two_distance
|
||||
BlendG1CurveSketchCmd sketch.blend_curve
|
||||
Offset sketch.offset
|
||||
TrimSketchCmd sketch.trim
|
||||
ExtendSketchCmd sketch.extend
|
||||
BreakSketchCmd sketch.break
|
||||
SketchScaleCmd sketch.scale
|
||||
SketchAutoConstraintAndDimCmd sketch.auto_constrain
|
||||
SketchAutoConstraintAndDimFromDatumCmd sketch.auto_constrain_from_datum
|
||||
ConstraintHorizontalVertical sketch.constraint.horizontal_vertical
|
||||
ConstraintCoincident sketch.constraint.coincident
|
||||
ConstraintTangent sketch.constraint.tangent
|
||||
ConstraintEqual sketch.constraint.equal
|
||||
ConstraintParallel sketch.constraint.parallel
|
||||
ConstraintPerpendicular sketch.constraint.perpendicular
|
||||
ConstraintFix sketch.constraint.fix
|
||||
ConstraintMidPoint sketch.constraint.midpoint
|
||||
ConstraintConcentric sketch.constraint.concentric
|
||||
ConstraintCollinear sketch.constraint.collinear
|
||||
ConstraintSymmetry sketch.constraint.symmetry
|
||||
ConstraintSmooth sketch.constraint.curvature
|
||||
SketchPolygonConstraintCmd sketch.constraint.polygon
|
||||
SketchStop sketch.finish
|
||||
SketchAutoConstrainAndFinish sketch.finish_auto_constrain
|
||||
FusionSurfacePatchCommand surface.patch
|
||||
FusionSurfaceTrimCommand surface.trim
|
||||
FusionExtendCommand surface.extend
|
||||
FusionSurfaceStitchCommand surface.stitch
|
||||
FusionSheetMetalFlangeCommand sheet.flange
|
||||
FusionSheetMetalHemFlangeCommand sheet.hem
|
||||
SheetMetalFoldCmd sheet.fold
|
||||
ConvertToSheetMetalCmd sheet.convert
|
||||
FusionSheetMetalFlatPatternCmd sheet.flat_pattern
|
||||
FusionSheetmetalUnfoldCommand sheet.unfold
|
||||
FusionSheetMetalRulesCommand sheet.manage_rules
|
||||
FusionAssignPlasticRuleCommand plastic.assign_rule
|
||||
FusionManagePlasticRuleCommand plastic.manage_rules
|
||||
FusionBossCommand plastic.boss
|
||||
FusionSnapFitCommand plastic.snap_fit
|
||||
FusionLipCommand plastic.lip
|
||||
FusionRestCommand plastic.rest
|
||||
|
+2
-2
@@ -239,7 +239,7 @@ timeline: it holds the file's B-rep (the STEP text is kept in the design, so the
|
||||
later features — fillets, holes, cuts sketched on its faces, shells — build on its bodies.\n\n\
|
||||
- **Open**: File → Open (`doc.open`) accepts `.step`/`.stp` in any case and starts a new design; `solvecraft part.step`; \
|
||||
`solvecraft-cli eval part.step`, `solvecraft-cli run script.json --in part.step`; the MCP `open` tool.\n\
|
||||
- **Insert** into the current design: File → Insert STEP… or SOLID → INSERT (`FusionImportCommandFromToolbar {{path}}`).\n\
|
||||
- **Insert** into the current design: File → Insert STEP… or SOLID → INSERT (`file.insert_step {{path}}`).\n\
|
||||
- **Drag and drop** a STEP file on the window: inserted when the design has features, opened otherwise.\n\n\
|
||||
Read: manifold solid breps (with voids), faceted breps, shell-based surface models; planes, cylinders, cones, spheres, \
|
||||
tori, B-spline and rational B-spline surfaces (with knots, Bézier, uniform, quasi-uniform), surfaces of revolution and \
|
||||
@@ -257,7 +257,7 @@ surfaces, and bare B-spline patches, sewn into a solid by their shared edges (an
|
||||
lines, circular arcs, ellipses, composite curves, rational B-spline curves; planes (108, 190), cylinders, cones, \
|
||||
spheres, tori, rational B-spline surfaces, surfaces of revolution and tabulated cylinders; transformation matrices; \
|
||||
units; colours (314 and the predefined numbers); body names (name properties, else labels). Not read yet: ruled and \
|
||||
offset surfaces, curves on surfaces given only in parameter space. Export (`ExportCommand` to `.igs`) writes each body as \
|
||||
offset surfaces, curves on surfaces given only in parameter space. Export (`file.export` to `.igs`) writes each body as \
|
||||
a manifold solid B-rep on the same surfaces a STEP export uses, with its name and colour.\n\n\
|
||||
## Fusion corpus\n\nGenerated by `cargo xtask step-corpus`. Each case is a part exported from Fusion as STEP (AP214; kept locally in `plan/fusion/oracle/`, never committed). SolveCraft opens `part.step` exactly as File → Open does (an Import base feature) and compares with Fusion's own measurements: body count, volume and area (relative tolerance 1e-3) and the number of faces read from the file.\n\n**{pass} / {} files pass.**\n\n| Case | Result | Bodies | Volume mm³ (got / Fusion) | Area mm² (got / Fusion) | Faces (got / Fusion) | ms | Notes |\n|---|---|---|---|---|---|---|---|\n",
|
||||
list.len()
|
||||
|
||||
+21
-8
@@ -3,7 +3,8 @@
|
||||
//! `xtask/data/fusion-catalog.tsv` lists the toolbar commands of Fusion's Design workspace as
|
||||
//! `tab \t panel \t command id \t command name` (ids and names only, nothing else). It is
|
||||
//! derived from the local, uncommitted `plan/fusion/menu-tree.json` with `--refresh`. A catalog
|
||||
//! entry is live when SolveCraft registers a command with the same id.
|
||||
//! entry is live when SolveCraft registers the command `xtask/data/fusion-ids.tsv` maps its id to
|
||||
//! (SolveCraft uses its own ids).
|
||||
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
@@ -31,10 +32,19 @@ const HEADLINE: &[&str] = &["SOLID", "SKETCH"];
|
||||
/// figure; the rest of Fusion is deferred and listed separately.
|
||||
const IN_SCOPE_TABS: &[&str] = &["SOLID", "SKETCH", "ASSEMBLY", "SHEET METAL"];
|
||||
/// The PLASTIC commands in scope (enclosure features).
|
||||
const PLASTIC_SUBSET: &[&str] = &["FusionBossCommand", "FusionRibCommand", "FusionWebCommand", "FusionLipCommand", "FusionSnapFitCommand"];
|
||||
/// (SolveCraft ids, matched through the catalog-id map.)
|
||||
const PLASTIC_SUBSET: &[&str] = &["plastic.boss", "solid.rib", "solid.web", "plastic.lip", "plastic.snap_fit"];
|
||||
|
||||
fn in_scope(e: &Entry) -> bool {
|
||||
IN_SCOPE_TABS.contains(&e.tab.as_str()) || (e.tab == "PLASTIC" && PLASTIC_SUBSET.contains(&e.id.as_str()))
|
||||
/// Catalog id → SolveCraft id.
|
||||
fn id_map(s: &str) -> std::collections::HashMap<String, String> {
|
||||
s.lines()
|
||||
.filter(|l| !l.starts_with('#') && !l.trim().is_empty())
|
||||
.filter_map(|l| l.split_once('\t').map(|(a, b)| (a.trim().to_string(), b.trim().to_string())))
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn in_plastic_subset(e: &Entry, map: &std::collections::HashMap<String, String>) -> bool {
|
||||
e.tab == "PLASTIC" && map.get(&e.id).is_some_and(|ours| PLASTIC_SUBSET.contains(&ours.as_str()))
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -121,7 +131,10 @@ pub fn run(root: &Path, refresh: bool) -> Result<(), String> {
|
||||
.map_err(|e| format!("solvecraft-cli: {e}"))?;
|
||||
let cmds: Value = serde_json::from_slice(&out.stdout).map_err(|e| format!("commands JSON: {e}"))?;
|
||||
let ids: Vec<String> = cmds.as_array().into_iter().flatten().filter_map(|c| c["id"].as_str().map(str::to_string)).collect();
|
||||
let live = |e: &Entry| ids.contains(&e.id);
|
||||
let map_path = root.join("xtask/data/fusion-ids.tsv");
|
||||
let map = id_map(&std::fs::read_to_string(&map_path).map_err(|e| format!("{}: {e}", map_path.display()))?);
|
||||
let live = |e: &Entry| map.get(&e.id).is_some_and(|ours| ids.contains(ours));
|
||||
let in_scope = |e: &Entry| IN_SCOPE_TABS.contains(&e.tab.as_str()) || in_plastic_subset(e, &map);
|
||||
let pct = |a: usize, b: usize| if b == 0 { 0.0 } else { 100.0 * a as f64 / b as f64 };
|
||||
|
||||
let head: Vec<&Entry> = catalog.iter().filter(|e| HEADLINE.contains(&e.tab.as_str())).collect();
|
||||
@@ -153,7 +166,7 @@ pub fn run(root: &Path, refresh: bool) -> Result<(), String> {
|
||||
for (t, p, l, n) in groups.iter().filter(|g| IN_SCOPE_TABS.contains(&g.0.as_str())) {
|
||||
md += &format!("| {t} | {p} | {l} | {n} | {:.0}% |\n", pct(*l, *n));
|
||||
}
|
||||
let plastic: Vec<&Entry> = catalog.iter().filter(|e| e.tab == "PLASTIC" && PLASTIC_SUBSET.contains(&e.id.as_str())).collect();
|
||||
let plastic: Vec<&Entry> = catalog.iter().filter(|e| in_plastic_subset(e, &map)).collect();
|
||||
md += &format!(
|
||||
"| PLASTIC | enclosure subset | {} | {} | {:.0}% |\n",
|
||||
plastic.iter().filter(|e| live(e)).count(),
|
||||
@@ -166,11 +179,11 @@ pub fn run(root: &Path, refresh: bool) -> Result<(), String> {
|
||||
}
|
||||
md += "\n## Live (SOLID, SKETCH)\n\n";
|
||||
for e in head.iter().filter(|e| live(e)) {
|
||||
md += &format!("- {} › {} › {} (`{}`)\n", e.tab, e.panel, e.name, e.id);
|
||||
md += &format!("- {} › {} › {}\n", e.tab, e.panel, e.name);
|
||||
}
|
||||
md += "\n## Not yet (SOLID, SKETCH)\n\n";
|
||||
for e in head.iter().filter(|e| !live(e)) {
|
||||
md += &format!("- {} › {} › {} (`{}`)\n", e.tab, e.panel, e.name, e.id);
|
||||
md += &format!("- {} › {} › {}\n", e.tab, e.panel, e.name);
|
||||
}
|
||||
std::fs::write(root.join("docs/parity.md"), md).map_err(|e| format!("docs/parity.md: {e}"))?;
|
||||
println!(
|
||||
|
||||
Reference in new issue
Block a user