Merge develop 322ac259 into solidcore
# Conflicts: # xtask/src/kernel_cases.rs # xtask/src/main.rs
This commit is contained in:
commit
ec423291b2
800 files changed
+38571
-654
No files matched your search
@@ -31,6 +31,8 @@
|
||||
# `ci` job still runs and reports the commit's real result (see the `ci` job): the merge queue
|
||||
# reads `ci` from the newest run of a commit, so a run without it would block a PR that passed.
|
||||
# Cross-compilation is opt-in through Run workflow; release builds remain in release.yml.
|
||||
# The release gate (release-gate.yml) calls this workflow (workflow_call) as a Run workflow with
|
||||
# cross-compilation on.
|
||||
# Every Linux job runs on Blacksmith's Ubuntu 24.04 runners (blacksmith-<N>vcpu-ubuntu-2404), sized
|
||||
# per job: 32 vCPU for the tests, 16 for Clippy, the GPU path tests, the archive build (nightly) and the merge queue's, 8 for compiles, doc and reference tests, 4 for the light checks, 2 for Select checks and ci.
|
||||
# The Windows shader job runs on Blacksmith's Windows Server 2025 runners (blacksmith-8vcpu-windows-2025);
|
||||
@@ -64,6 +66,14 @@ on:
|
||||
description: "Also check WebAssembly and RISC-V (before a release)"
|
||||
type: boolean
|
||||
default: false
|
||||
# The release gate (release-gate.yml): the event stays the caller's (workflow_dispatch), so a
|
||||
# call runs exactly what Run workflow runs.
|
||||
workflow_call:
|
||||
inputs:
|
||||
cross_compile:
|
||||
description: "Also check WebAssembly and RISC-V (before a release)"
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
# The kernel rig and the complexity ladder as a regression gate. A plan job maps a pull request's
|
||||
# changed files to the rig areas they can affect (scripts/ci/kernel_rig_plan.py): an area runs
|
||||
# when a file its tests/kernel-cases/<area>/PATHS lists changes, or one of its cases; every area
|
||||
# runs when the shared core in tests/kernel-cases/PATHS-ALL changes; the ladder runs whenever any
|
||||
# area does. One job then builds solidcraft-cli once (release, SMLib prebuilt), checks that every
|
||||
# registry command has a case or an exemption (tests/kernel-cases/EXEMPT), and hands the CLI to a
|
||||
# matrix of shards as an artifact, one per selected area plus the ladder, in parallel, so the
|
||||
# wall time is the build plus the slowest shard. See tests/kernel-cases/README.md.
|
||||
#
|
||||
# - An area fails on a regression (a case that fails and its tests/kernel-cases/<area>/KNOWN_FAILING
|
||||
# does not list) or on a listed case that passes (it is fixed: remove its line in the same pull
|
||||
# request, so the list only shrinks).
|
||||
# - The ladder fails on any case whose status or counts differ from
|
||||
# tests/kernel-cases/ladder/golden.json; a right change is re-recorded (`--record "why"`).
|
||||
#
|
||||
# The trigger paths are whole folders that hold every area's PATHS (a self-test,
|
||||
# scripts/ci/test_kernel_rig_plan.py, checks they do), so a pull request that touches none of
|
||||
# them (the UI, docs, packaging) starts no runner at all, and a new area needs no edit here: the
|
||||
# plan finds the areas from the folders. Pushes to main and develop on the same paths, merge groups
|
||||
# (once the queue is on), the release gate (release-gate.yml, workflow_call) and a run by hand run
|
||||
# every area; those pushes also commit the compiler cache (a Blacksmith sticky disk) that every
|
||||
# other run mounts read-only.
|
||||
name: Kernel rig
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
paths:
|
||||
- "crates/kernel/**"
|
||||
- "crates/geom/**"
|
||||
- "crates/smlib/**"
|
||||
- "crates/step/**"
|
||||
- "crates/io/src/**"
|
||||
- "crates/doc/src/**"
|
||||
- "crates/engine/src/**"
|
||||
- "tests/kernel-cases/**"
|
||||
# The rig itself: the grading, the runner, the selection and this workflow.
|
||||
- "apps/solidcraft-cli/src/kernel_cases.rs"
|
||||
- "xtask/src/kernel_cases.rs"
|
||||
- "xtask/src/kernel_ladder.rs"
|
||||
- "scripts/fetch-smlib.sh"
|
||||
- "scripts/ci/kernel_rig_plan.py"
|
||||
- "scripts/ci/test_kernel_rig_plan.py"
|
||||
- ".github/workflows/kernel-rig.yml"
|
||||
push:
|
||||
branches: [main, develop]
|
||||
# The same paths as pull_request.
|
||||
paths:
|
||||
- "crates/kernel/**"
|
||||
- "crates/geom/**"
|
||||
- "crates/smlib/**"
|
||||
- "crates/step/**"
|
||||
- "crates/io/src/**"
|
||||
- "crates/doc/src/**"
|
||||
- "crates/engine/src/**"
|
||||
- "tests/kernel-cases/**"
|
||||
# The rig itself: the grading, the runner, the selection and this workflow.
|
||||
- "apps/solidcraft-cli/src/kernel_cases.rs"
|
||||
- "xtask/src/kernel_cases.rs"
|
||||
- "xtask/src/kernel_ladder.rs"
|
||||
- "scripts/fetch-smlib.sh"
|
||||
- "scripts/ci/kernel_rig_plan.py"
|
||||
- "scripts/ci/test_kernel_rig_plan.py"
|
||||
- ".github/workflows/kernel-rig.yml"
|
||||
merge_group:
|
||||
workflow_call:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
# A new push to a pull request replaces its old run.
|
||||
group: kernel-rig-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
plan:
|
||||
name: Select the rig areas
|
||||
# Draft pull requests run no CI, as in ci.yml.
|
||||
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
# The shard matrix (JSON list of areas and the ladder; [] when nothing is selected).
|
||||
shards: ${{ steps.plan.outputs.shards }}
|
||||
# Whether the build job, and with it the coverage check, runs.
|
||||
build: ${{ steps.plan.outputs.build }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
# A pull request's diff needs its base's history.
|
||||
fetch-depth: ${{ github.event_name == 'pull_request' && '0' || '1' }}
|
||||
- name: Selection self-test
|
||||
run: python3 -I scripts/ci/test_kernel_rig_plan.py
|
||||
- id: plan
|
||||
name: Map the changed files to areas
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
run: |
|
||||
# Pull requests run the areas their diff reaches; pushes, merge groups, the release
|
||||
# gate and a run by hand run every area.
|
||||
if [ "$EVENT_NAME" = pull_request ]; then
|
||||
git diff --no-renames --name-only -z "$BASE_SHA...$HEAD_SHA" > "$RUNNER_TEMP/rig-paths"
|
||||
python3 -I scripts/ci/kernel_rig_plan.py --paths "$RUNNER_TEMP/rig-paths" --github-output "$GITHUB_OUTPUT"
|
||||
else
|
||||
python3 -I scripts/ci/kernel_rig_plan.py --all --github-output "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
build:
|
||||
name: Build the CLI
|
||||
needs: plan
|
||||
if: needs.plan.outputs.build == 'true'
|
||||
runs-on: blacksmith-8vcpu-ubuntu-2404
|
||||
timeout-minutes: 60
|
||||
env:
|
||||
CARGO_INCREMENTAL: "0"
|
||||
RUSTC_WRAPPER: sccache
|
||||
SCCACHE_DIR: /home/runner/.cache/sccache
|
||||
SCCACHE_CACHE_SIZE: 10G
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Size parallel compiles to the job's memory
|
||||
run: scripts/ci/build-jobs.sh
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
# Only pushes to main and develop commit the cache; pull requests, merge groups and forks
|
||||
# mount a clone and never write back.
|
||||
- name: Mount the compiler cache
|
||||
uses: useblacksmith/stickydisk@3f6be1451e3cad893b778bc93495c80452a5da26 # v1.7.2
|
||||
continue-on-error: true
|
||||
with:
|
||||
key: ${{ github.repository }}-sccache-kernel-rig
|
||||
path: /home/runner/.cache/sccache
|
||||
commit: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && 'on-change' || 'false' }}
|
||||
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
||||
with:
|
||||
key: kernel-rig
|
||||
save-if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') }}
|
||||
- name: Fetch SMLib (crates/smlib/SMLIB_REV)
|
||||
shell: bash
|
||||
run: scripts/fetch-smlib.sh
|
||||
- name: Set up compiler cache
|
||||
uses: mozilla-actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11
|
||||
with:
|
||||
version: v0.16.0
|
||||
- name: Build the CLI (release, SMLib) and the rig's runner
|
||||
run: |
|
||||
cargo build --release --locked -p solidcraft-cli --features smlib
|
||||
cargo build --locked -p xtask
|
||||
# A tar keeps the executable bits, which an artifact drops. xtask finds the repository from
|
||||
# the path it was built in (CARGO_MANIFEST_DIR), which is the same checkout path in every
|
||||
# job of this workflow.
|
||||
# Every registry command is used by a case or listed in tests/kernel-cases/EXEMPT.
|
||||
- name: Every command has a case
|
||||
run: target/debug/xtask kernel-cases --coverage --cli target/release/solidcraft-cli
|
||||
# A coverage-only run (the registry or the cases changed, no area selected) runs no shard.
|
||||
- name: Pack the binaries
|
||||
if: needs.plan.outputs.shards != '[]'
|
||||
run: tar -cf "$RUNNER_TEMP/kernel-rig-bin.tar" -C target release/solidcraft-cli debug/xtask
|
||||
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
if: needs.plan.outputs.shards != '[]'
|
||||
with:
|
||||
name: kernel-rig-bin
|
||||
path: ${{ runner.temp }}/kernel-rig-bin.tar
|
||||
retention-days: 1
|
||||
- name: Compiler cache statistics
|
||||
if: always()
|
||||
run: sccache --show-stats
|
||||
|
||||
shard:
|
||||
name: Kernel rig (${{ matrix.shard }})
|
||||
needs: [plan, build]
|
||||
if: needs.plan.outputs.shards != '[]'
|
||||
runs-on: blacksmith-4vcpu-ubuntu-2404
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# The areas of tests/kernel-cases/ the plan selected, and the ladder. On the build box
|
||||
# (aarch64, 4 cases at a time) the slowest areas took about 1 minute (booleans, 212 s of
|
||||
# cases with one of 84 s; threads, 161 s) and the ladder, one case at a time, 92 s: no area
|
||||
# needs splitting.
|
||||
shard: ${{ fromJSON(needs.plan.outputs.shards) }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
||||
with:
|
||||
name: kernel-rig-bin
|
||||
path: ${{ runner.temp }}
|
||||
- name: Unpack the binaries
|
||||
run: mkdir -p target && tar -xf "$RUNNER_TEMP/kernel-rig-bin.tar" -C target
|
||||
- name: Run the cases against the known-failing list (the ladder against its golden)
|
||||
env:
|
||||
SHARD: ${{ matrix.shard }}
|
||||
run: |
|
||||
if [ "$SHARD" = ladder ]; then
|
||||
set -- --ladder --gate
|
||||
else
|
||||
set -- --area "$SHARD" --known-failing "tests/kernel-cases/$SHARD/KNOWN_FAILING"
|
||||
fi
|
||||
target/debug/xtask kernel-cases "$@" --cli target/release/solidcraft-cli --out "$RUNNER_TEMP/kernel-rig"
|
||||
- name: Keep the results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
||||
with:
|
||||
name: kernel-rig-results-${{ matrix.shard }}
|
||||
path: ${{ runner.temp }}/kernel-rig/results.json
|
||||
if-no-files-found: ignore
|
||||
|
||||
# One check for the whole gate, for branch protection and the merge queue.
|
||||
kernel-rig:
|
||||
name: kernel-rig
|
||||
needs: [plan, build, shard]
|
||||
if: always() && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
steps:
|
||||
# A skipped build or shard counts as passed only when the plan selected none.
|
||||
- name: Every selected job passed
|
||||
env:
|
||||
PLAN: ${{ needs.plan.result }}
|
||||
WANT_BUILD: ${{ needs.plan.outputs.build }}
|
||||
WANT_SHARDS: ${{ needs.plan.outputs.shards }}
|
||||
BUILD: ${{ needs.build.result }}
|
||||
SHARDS: ${{ needs.shard.result }}
|
||||
run: |
|
||||
echo "plan=$PLAN build=$BUILD shards=$SHARDS selected=$WANT_SHARDS"
|
||||
test "$PLAN" = success
|
||||
if [ "$WANT_BUILD" = true ]; then test "$BUILD" = success; else test "$BUILD" = skipped; fi
|
||||
if [ "$WANT_SHARDS" != '[]' ]; then test "$SHARDS" = success; else test "$SHARDS" = skipped; fi
|
||||
@@ -0,0 +1,74 @@
|
||||
# The release gate: everything, in full and in parallel, on one branch's head, before that branch
|
||||
# replaces main as a release (develop, rebased onto main). Run it by hand:
|
||||
# gh workflow run release-gate.yml --ref develop
|
||||
# It calls the workflows that own each check instead of copying their jobs:
|
||||
# - ci.yml as Run workflow with cross-compilation: every native suite in full (not scoped), the
|
||||
# reference tests, the doc tests, the GPU path tests, the action matrix (all 16 shards) and its
|
||||
# determinism check, the property tests, the repository checks (web-offline among them),
|
||||
# WebAssembly and RISC-V, Windows D3D12 FXC and Windows app startup;
|
||||
# - kernel-rig.yml: every rig area against its KNOWN_FAILING and the ladder against its golden;
|
||||
# - release.yml as a dry run (draft false, packages_only): the Linux, Flatpak, Snap, FreeBSD,
|
||||
# macOS, Windows and web packages with their smoke tests and package checks, unsigned (no
|
||||
# secrets are passed, so no signing secret or SignPath quota is used) and without the release
|
||||
# job (checksums, update signing, publishing).
|
||||
# The gate passes only when all three pass. Before main is replaced, tag the old main
|
||||
# (main-before-develop-<date>) and push the tag.
|
||||
name: Release gate
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: release-gate-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: CI
|
||||
uses: ./.github/workflows/ci.yml
|
||||
permissions:
|
||||
contents: read
|
||||
# Select checks reads this commit's other runs.
|
||||
actions: read
|
||||
with:
|
||||
cross_compile: true
|
||||
|
||||
kernel-rig:
|
||||
name: Kernel rig
|
||||
uses: ./.github/workflows/kernel-rig.yml
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
packages:
|
||||
name: Packages
|
||||
uses: ./.github/workflows/release.yml
|
||||
# No secrets: the signing steps skip without them. GitHub checks a called workflow's job
|
||||
# permissions before the run, skipped jobs included, so the release job's contents: write must
|
||||
# be granted here; packages_only skips that job, and no step that runs writes to the
|
||||
# repository. actions: read is the Windows job's.
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
with:
|
||||
draft: false
|
||||
packages_only: true
|
||||
|
||||
release-gate:
|
||||
name: release-gate
|
||||
needs: [ci, kernel-rig, packages]
|
||||
if: always()
|
||||
runs-on: blacksmith-2vcpu-ubuntu-2404
|
||||
steps:
|
||||
- name: Every part passed
|
||||
env:
|
||||
CI: ${{ needs.ci.result }}
|
||||
KERNEL_RIG: ${{ needs.kernel-rig.result }}
|
||||
PACKAGES: ${{ needs.packages.result }}
|
||||
run: |
|
||||
echo "ci=$CI kernel-rig=$KERNEL_RIG packages=$PACKAGES"
|
||||
test "$CI" = success
|
||||
test "$KERNEL_RIG" = success
|
||||
test "$PACKAGES" = success
|
||||
@@ -20,6 +20,8 @@
|
||||
# releases/latest/download/<name> links in the README keep working across releases.
|
||||
#
|
||||
# A dry run: dispatch with draft=false (the default). Only the release branch may create drafts.
|
||||
# The release gate (release-gate.yml) calls it as such a dry run, without secrets (unsigned) and
|
||||
# without the release job (packages_only).
|
||||
# A dry run from any branch also test-signs the Windows files when SIGNPATH_API_TOKEN exists:
|
||||
# gh workflow run release.yml --ref <branch> -f draft=false [-f signpath_signing_policy=test-signing]
|
||||
name: Release
|
||||
@@ -40,6 +42,25 @@ on:
|
||||
description: "SignPath signing policy for the Windows files (empty: the repository variable, else test-signing)"
|
||||
type: string
|
||||
default: ""
|
||||
# The release gate (release-gate.yml): a dry run (draft false) of every package and its checks.
|
||||
# The event stays the caller's (workflow_dispatch), so a call runs as a dispatched dry run does.
|
||||
# The gate passes no secrets, so nothing is signed (the signing steps skip without their
|
||||
# secrets, as on a fork), and packages_only skips the release job (checksums, update signing,
|
||||
# publishing).
|
||||
workflow_call:
|
||||
inputs:
|
||||
packages_only:
|
||||
description: "Build and check every package only: no release job"
|
||||
type: boolean
|
||||
default: false
|
||||
draft:
|
||||
description: "Create/update a draft (release branch only; off: build artifacts only)"
|
||||
type: boolean
|
||||
default: false
|
||||
signpath_signing_policy:
|
||||
description: "SignPath signing policy for the Windows files (empty: the repository variable, else test-signing)"
|
||||
type: string
|
||||
default: ""
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -587,7 +608,8 @@ jobs:
|
||||
release:
|
||||
name: GitHub Release or dry-run artifacts
|
||||
needs: [version, linux, flatpak, snap, freebsd, macos, windows, web]
|
||||
if: needs.version.outputs.build == 'true'
|
||||
# Not for the release gate (packages_only): it builds and checks the packages, nothing more.
|
||||
if: needs.version.outputs.build == 'true' && !inputs.packages_only
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
+2
-1
@@ -241,7 +241,8 @@ the surface itself). Expected values are either worked out in closed form
|
||||
(`tools/oracle-analytic/`) or computed by building the same recipe in FreeCAD, run as a separate
|
||||
program (`tools/freecad-oracle/`); each file says which. The generated
|
||||
[reference test report](docs/oracle.md) has the current case count and results. The reference-test
|
||||
CI job runs `cargo xtask oracle` during full validation; pull-request runs skip it. A case that
|
||||
CI job runs `cargo xtask oracle` during full validation, and on pull requests that reach
|
||||
`solidcraft-cli`. A case that
|
||||
fails because of a known bug names its issue in `expected.json` (`"known_failure": "#123"`);
|
||||
never change an expected value to match SolidCraft's output.
|
||||
|
||||
|
||||
@@ -258,6 +258,316 @@ fn continuity_order(
|
||||
Ok((got, ok))
|
||||
}
|
||||
|
||||
/// Where `got` differs from `want`, a part of it: every key of a `want` object in `got` and
|
||||
/// matching, an array element by element and as long, a whole number exactly, any other number
|
||||
/// within `rel` of it (relative, at least 1 absolute), anything else equal. `None` where it
|
||||
/// matches; else the path to the first difference with both values.
|
||||
fn json_mismatch(got: &Value, want: &Value, rel: f64, abs: f64, path: &str) -> Option<String> {
|
||||
let differ = || Some(format!("{path}: got {got}, want {want}"));
|
||||
match (got, want) {
|
||||
(_, Value::Object(w)) => {
|
||||
let Value::Object(g) = got else { return differ() };
|
||||
w.iter().find_map(|(k, wv)| match g.get(k) {
|
||||
Some(gv) => json_mismatch(gv, wv, rel, abs, &format!("{path}.{k}")),
|
||||
None => Some(format!("{path}.{k}: missing, want {wv}")),
|
||||
})
|
||||
}
|
||||
(_, Value::Array(w)) => {
|
||||
let Value::Array(g) = got else { return differ() };
|
||||
if g.len() != w.len() {
|
||||
return Some(format!("{path}: {} items, want {}", g.len(), w.len()));
|
||||
}
|
||||
g.iter().zip(w).enumerate().find_map(|(i, (gv, wv))| json_mismatch(gv, wv, rel, abs, &format!("{path}[{i}]")))
|
||||
}
|
||||
(_, Value::Number(w)) if w.is_i64() || w.is_u64() => (got.as_f64() != w.as_f64()).then(differ).flatten(),
|
||||
(_, Value::Number(w)) => {
|
||||
let (g, w) = (got.as_f64(), w.as_f64().unwrap_or(f64::NAN));
|
||||
(!g.is_some_and(|g| g.is_finite() && (g - w).abs() <= (rel * w.abs().max(1.0)).max(abs))).then(differ).flatten()
|
||||
}
|
||||
_ => (got != want).then(differ).flatten(),
|
||||
}
|
||||
}
|
||||
|
||||
/// The rows of a CSV text (RFC 4180: quoted fields may hold commas, quotes and line breaks) as
|
||||
/// objects keyed by the header row; a field that reads as a number is one.
|
||||
fn csv_rows(text: &str) -> Vec<Value> {
|
||||
let mut records: Vec<Vec<String>> = Vec::new();
|
||||
let (mut row, mut field, mut quoted, mut chars) = (Vec::new(), String::new(), false, text.chars().peekable());
|
||||
while let Some(c) = chars.next() {
|
||||
match (c, quoted) {
|
||||
('"', true) if chars.peek() == Some(&'"') => {
|
||||
chars.next();
|
||||
field.push('"');
|
||||
}
|
||||
('"', _) => quoted = !quoted,
|
||||
(',', false) => row.push(std::mem::take(&mut field)),
|
||||
('\r', false) => {}
|
||||
('\n', false) => {
|
||||
row.push(std::mem::take(&mut field));
|
||||
records.push(std::mem::take(&mut row));
|
||||
}
|
||||
_ => field.push(c),
|
||||
}
|
||||
}
|
||||
if !field.is_empty() || !row.is_empty() {
|
||||
row.push(field);
|
||||
records.push(row);
|
||||
}
|
||||
let Some((head, rows)) = records.split_first() else { return Vec::new() };
|
||||
rows.iter()
|
||||
.map(|r| {
|
||||
let cell = |v: &String| v.parse::<f64>().ok().filter(|x| x.is_finite()).map_or_else(|| json!(v), |x| json!(x));
|
||||
Value::Object(head.iter().cloned().zip(r.iter().map(cell)).collect())
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Per layer of a DXF text's ENTITIES section, how many of each entity it has and the total
|
||||
/// length of its curves (`length_mm`: lines, arcs, circles, ellipses and polylines; a spline makes
|
||||
/// the layer's length null, as not measured): `{layer: {"LINE": n, …, "length_mm": l}}`.
|
||||
fn dxf_layers(text: &str) -> Value {
|
||||
let lines: Vec<&str> = text.lines().map(str::trim).collect();
|
||||
let pairs: Vec<(&str, &str)> = lines.chunks(2).filter_map(|p| Some((*p.first()?, *p.get(1)?))).collect();
|
||||
let start = pairs.windows(2).position(|w| w[0] == ("0", "SECTION") && w[1] == ("2", "ENTITIES")).map_or(pairs.len(), |i| i + 2);
|
||||
let mut layers = serde_json::Map::new();
|
||||
let mut i = start;
|
||||
while let Some(&(code, kind)) = pairs.get(i) {
|
||||
if code != "0" || kind == "ENDSEC" {
|
||||
break;
|
||||
}
|
||||
let end = pairs.get(i + 1..).and_then(|r| r.iter().position(|p| p.0 == "0")).map_or(pairs.len(), |k| i + 1 + k);
|
||||
let group = pairs.get(i + 1..end).unwrap_or(&[]);
|
||||
let num = |c: &str| group.iter().find(|p| p.0 == c).and_then(|p| p.1.parse::<f64>().ok()).unwrap_or(0.0);
|
||||
let all = |c: &str| group.iter().filter(|p| p.0 == c).filter_map(|p| p.1.parse::<f64>().ok()).collect::<Vec<_>>();
|
||||
let layer = group.iter().find(|p| p.0 == "8").map_or("0", |p| p.1);
|
||||
let length = match kind {
|
||||
"LINE" => Some((num("11") - num("10")).hypot(num("21") - num("20"))),
|
||||
"CIRCLE" => Some(std::f64::consts::TAU * num("40")),
|
||||
"ARC" => Some(num("40") * (num("51") - num("50")).rem_euclid(360.0).to_radians()),
|
||||
"LWPOLYLINE" => {
|
||||
let mut pts: Vec<(f64, f64)> = all("10").into_iter().zip(all("20")).collect();
|
||||
if (num("70") as i64) & 1 == 1
|
||||
&& let Some(&p) = pts.first()
|
||||
{
|
||||
pts.push(p);
|
||||
}
|
||||
Some(pts.windows(2).map(|w| (w[1].0 - w[0].0).hypot(w[1].1 - w[0].1)).sum())
|
||||
}
|
||||
"ELLIPSE" => {
|
||||
// Arc length of c + cos t·major + sin t·ratio·minor, t from 41 to 42, by Simpson's rule.
|
||||
let (a, b) = (num("11").hypot(num("21")), num("11").hypot(num("21")) * num("40"));
|
||||
let (t0, t1) = (num("41"), num("42"));
|
||||
let sweep = if t1 > t0 { t1 - t0 } else { t1 - t0 + std::f64::consts::TAU };
|
||||
let n = 4096;
|
||||
let speed = |t: f64| (a * t.sin()).hypot(b * t.cos());
|
||||
let h = sweep / n as f64;
|
||||
let weight = |k: usize| match k {
|
||||
0 => 1.0,
|
||||
k if k == n => 1.0,
|
||||
k if k % 2 == 1 => 4.0,
|
||||
_ => 2.0,
|
||||
};
|
||||
let sum: f64 = (0..=n).map(|k| speed(t0 + k as f64 * h) * weight(k)).sum();
|
||||
Some(sum * h / 3.0)
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
let entry = layers.entry(layer.to_string()).or_insert_with(|| json!({"length_mm": 0.0}));
|
||||
entry[kind] = json!(entry[kind].as_u64().unwrap_or(0) + 1);
|
||||
entry["length_mm"] = match (entry["length_mm"].as_f64(), length) {
|
||||
(Some(l), Some(more)) => json!(l + more),
|
||||
_ => Value::Null,
|
||||
};
|
||||
i = end;
|
||||
}
|
||||
Value::Object(layers)
|
||||
}
|
||||
|
||||
/// The `files` check of the files a case wrote to `$OUT` (`out`): each `{path, json | csv | dxf}`
|
||||
/// read and matched as [`json_mismatch`] does: `json` against the file's JSON, `csv` against its
|
||||
/// rows ([`csv_rows`]), `dxf` against its layers ([`dxf_layers`]), a count there exact or an
|
||||
/// inclusive range `[min, max]`. And the `results` check of the commands' own answers: each
|
||||
/// `{step, pointer?, json, rel?, abs_mm?}`, the answer of the `step`th command (from 1, base
|
||||
/// commands included), or its part at the JSON `pointer` (RFC 6901), matched against `json`,
|
||||
/// a number within the entry's `rel` (or the case's) or its `abs_mm`.
|
||||
fn output_checks(c: &mut Checks, want: &Value, out: &str, results: &[Value], rel: f64) {
|
||||
for f in want["files"].as_array().into_iter().flatten() {
|
||||
let path = f["path"].as_str().unwrap_or_default();
|
||||
let what = format!("file {path}");
|
||||
let text = match std::fs::read_to_string(std::path::Path::new(out).join(path)) {
|
||||
Ok(t) => t,
|
||||
Err(e) => {
|
||||
c.push(&what, json!(e.to_string()), json!("written"), false);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let (got, wanted) = if let Some(w) = f.get("json") {
|
||||
(serde_json::from_str::<Value>(&text).unwrap_or_else(|e| json!(format!("not JSON: {e}"))), w.clone())
|
||||
} else if let Some(w) = f.get("csv") {
|
||||
(Value::Array(csv_rows(&text)), w.clone())
|
||||
} else if let Some(w) = f.get("dxf") {
|
||||
let layers = dxf_layers(&text);
|
||||
// A count given as a range is in it: compare the count itself with the range's bounds.
|
||||
let mut w = w.clone();
|
||||
let mut ranged = Vec::new();
|
||||
for (layer, kinds) in w.as_object_mut().into_iter().flatten() {
|
||||
for (kind, n) in kinds.as_object_mut().into_iter().flatten() {
|
||||
if let Some([lo, hi]) = n.as_array().and_then(|r| <[Value; 2]>::try_from(r.clone()).ok()) {
|
||||
let g = layers[layer.as_str()][kind.as_str()].as_u64().unwrap_or(0);
|
||||
ranged.push((format!("{layer}.{kind}"), g, lo.clone(), hi.clone()));
|
||||
*n = json!(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (k, g, lo, hi) in ranged {
|
||||
let ok = lo.as_u64().is_some_and(|lo| g >= lo) && hi.as_u64().is_some_and(|hi| g <= hi);
|
||||
c.push(&format!("{what} {k}"), json!(g), json!([lo, hi]), ok);
|
||||
}
|
||||
// An entity the case names but the layer lacks counts 0.
|
||||
let mut got = layers;
|
||||
for (layer, kinds) in w.as_object().into_iter().flatten() {
|
||||
for kind in kinds.as_object().into_iter().flatten().map(|(k, _)| k) {
|
||||
if got[layer.as_str()].get(kind.as_str()).is_none() && kind != "length_mm" {
|
||||
got[layer.as_str()][kind.as_str()] = json!(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
(got, w)
|
||||
} else {
|
||||
c.push(&what, json!(f), json!("json, csv or dxf"), false);
|
||||
continue;
|
||||
};
|
||||
let miss = json_mismatch(&got, &wanted, rel, 0.0, "");
|
||||
c.push(&what, json!(miss.clone().unwrap_or_else(|| "matches".into())), wanted, miss.is_none());
|
||||
}
|
||||
for r in want["results"].as_array().into_iter().flatten() {
|
||||
let step = r["step"].as_u64().unwrap_or(0);
|
||||
let pointer = r["pointer"].as_str().unwrap_or("");
|
||||
let what = format!("result of step {step}{pointer}");
|
||||
let (rel, abs) = (r["rel"].as_f64().unwrap_or(rel), r["abs_mm"].as_f64().unwrap_or(0.0));
|
||||
let got = step.checked_sub(1).and_then(|i| results.get(i as usize));
|
||||
let miss = match got.map(|g| g.pointer(pointer)) {
|
||||
Some(Some(g)) => json_mismatch(g, &r["json"], rel, abs, ""),
|
||||
Some(None) => Some(format!("no {pointer} in step {step}'s answer")),
|
||||
None => Some(format!("no step {step} of {}", results.len())),
|
||||
};
|
||||
c.push(&what, json!(miss.clone().unwrap_or_else(|| "matches".into())), r["json"].clone(), miss.is_none());
|
||||
}
|
||||
}
|
||||
|
||||
/// The word a `surface_types` check names a face's surface by, as the record holds it: an
|
||||
/// analytic kind, `bspline` (a B-spline or NURBS surface) or `revolution` (a revolved curve).
|
||||
fn surface_word(s: &solidcraft_engine::geom::brep::Surface) -> &'static str {
|
||||
use solidcraft_engine::geom::brep::Surface as S;
|
||||
match s {
|
||||
S::Plane { .. } | S::PlaneThrough { .. } => "plane",
|
||||
S::Cylinder { .. } => "cylinder",
|
||||
S::Cone { .. } => "cone",
|
||||
S::Sphere { .. } => "sphere",
|
||||
S::Torus { .. } => "torus",
|
||||
S::Spline { .. } | S::RationalSpline { .. } => "bspline",
|
||||
S::PlacedRevolution { .. } => "revolution",
|
||||
}
|
||||
}
|
||||
|
||||
/// A B-spline face's two directions as `[degree, spans]` (spans: the distinct knot intervals of
|
||||
/// the modelled range), the lower first, so a surface parameterised the other way round reads the
|
||||
/// same. `None` for a surface that is not a B-spline.
|
||||
fn spline_shape(s: &solidcraft_engine::geom::brep::Surface) -> Option<[[u64; 2]; 2]> {
|
||||
use solidcraft_engine::geom::brep::Surface as S;
|
||||
let (u, v, nu, nv) = match s {
|
||||
S::Spline { u_knots, v_knots, points } => (u_knots, v_knots, points.len(), points.first().map_or(0, Vec::len)),
|
||||
S::RationalSpline { u_knots, v_knots, homogeneous } => (u_knots, v_knots, homogeneous.len(), homogeneous.first().map_or(0, Vec::len)),
|
||||
_ => return None,
|
||||
};
|
||||
let dir = |k: &[f64], n: usize| -> Option<[u64; 2]> {
|
||||
let p = k.len().checked_sub(n + 1)?;
|
||||
let inner = k.get(p..=n)?;
|
||||
let spans = inner.windows(2).filter(|w| w[1] > w[0]).count();
|
||||
Some([p as u64, spans as u64])
|
||||
};
|
||||
let (a, b) = (dir(u, nu)?, dir(v, nv)?);
|
||||
Some(if a <= b { [a, b] } else { [b, a] })
|
||||
}
|
||||
|
||||
/// The `splines` check: every B-spline face of the bodies matches one entry of `want` and every
|
||||
/// entry one face (`{degree: [p, q], spans?: [m, n]}`, in either order of directions; without
|
||||
/// `spans` only the degrees are graded). `Ok(got)` with what the faces are, `ok` when they match.
|
||||
fn splines_match(faces: &[[[u64; 2]; 2]], want: &Value) -> Result<(Value, bool), String> {
|
||||
let list = want.as_array().ok_or("`splines` must be a list of {degree: [p, q], spans?: [m, n]}")?;
|
||||
let pair = |v: &Value| -> Option<[u64; 2]> { Some([v.get(0)?.as_u64()?, v.get(1)?.as_u64()?]) };
|
||||
let mut left: Vec<[[u64; 2]; 2]> = faces.to_vec();
|
||||
let mut ok = true;
|
||||
for w in list {
|
||||
let degree = w.get("degree").and_then(pair).ok_or("each `splines` entry needs `degree: [p, q]`")?;
|
||||
let spans = match w.get("spans").filter(|s| !s.is_null()) {
|
||||
Some(s) => Some(pair(s).ok_or("`spans` must be [m, n]")?),
|
||||
None => None,
|
||||
};
|
||||
let fits = |f: &[[u64; 2]; 2]| {
|
||||
let mine = |d: [u64; 2], s: Option<[u64; 2]>| f[0][0] == d[0] && f[1][0] == d[1] && s.is_none_or(|s| f[0][1] == s[0] && f[1][1] == s[1]);
|
||||
mine(degree, spans) || mine([degree[1], degree[0]], spans.map(|s| [s[1], s[0]]))
|
||||
};
|
||||
match left.iter().position(fits) {
|
||||
Some(i) => {
|
||||
left.remove(i);
|
||||
}
|
||||
None => ok = false,
|
||||
}
|
||||
}
|
||||
let got: Vec<Value> = faces.iter().map(|f| json!({"degree": [f[0][0], f[1][0]], "spans": [f[0][1], f[1][1]]})).collect();
|
||||
Ok((json!(got), ok && left.is_empty()))
|
||||
}
|
||||
|
||||
/// Largest sine of the angle between a construction's direction (an axis's, a plane's normal)
|
||||
/// and the case's: either way along it.
|
||||
const CONSTRUCT_DIR_TOL: f64 = 1e-6;
|
||||
|
||||
/// The `construction` check: each named construction plane, axis or point, as the timeline
|
||||
/// evaluated it, is the case's: a point within `tol` (mm); an axis whose direction is parallel to
|
||||
/// `dir` (either way) and whose line passes within `tol` of `through`; a plane whose normal is
|
||||
/// parallel to `normal` (either way) and which passes within `tol` of `through`. An axis or plane
|
||||
/// is graded as the line or plane it is, never by the origin it happens to keep.
|
||||
fn check_construction(s: &solidcraft_engine::Session, want: &Value, tol: f64, c: &mut Checks) {
|
||||
use solidcraft_engine::geom::Vec3;
|
||||
use solidcraft_engine::view::{construction_axes, construction_planes, construction_points};
|
||||
let Some(named) = want.as_object() else {
|
||||
c.push("construction", json!("`construction` must map names to {point} | {axis} | {plane}"), json!("an object"), false);
|
||||
return;
|
||||
};
|
||||
let vec = |v: &Value| v3(v).map(Vec3::from);
|
||||
let parallel = |a: Vec3, b: Vec3| a.normalized().zip(b.normalized()).is_some_and(|(a, b)| a.cross(b).len() <= CONSTRUCT_DIR_TOL);
|
||||
for (name, w) in named {
|
||||
let what = format!("construction {name}");
|
||||
let (got, ok) = if let Some(p) = w.get("point").and_then(vec) {
|
||||
match construction_points(s).into_iter().find(|x| &x.1 == name) {
|
||||
Some((_, _, q)) => (json!({"point": q}), q.dist(p) <= tol),
|
||||
None => (json!("no such construction point"), false),
|
||||
}
|
||||
} else if let Some((through, dir)) = w.get("axis").and_then(|a| vec(&a["through"]).zip(vec(&a["dir"]))) {
|
||||
match construction_axes(s).into_iter().find(|x| &x.1 == name) {
|
||||
Some((_, _, o, d)) => {
|
||||
let off = d.normalized().map(|u| (through - o) - u * (through - o).dot(u)).map_or(f64::INFINITY, Vec3::len);
|
||||
(json!({"axis": {"origin": o, "dir": d, "through_off_mm": off}}), parallel(d, dir) && off <= tol)
|
||||
}
|
||||
None => (json!("no such construction axis"), false),
|
||||
}
|
||||
} else if let Some((through, normal)) = w.get("plane").and_then(|p| vec(&p["through"]).zip(vec(&p["normal"]))) {
|
||||
match construction_planes(s).into_iter().find(|x| &x.1 == name) {
|
||||
Some((_, _, pl)) => {
|
||||
let n = pl.normal();
|
||||
let off = n.normalized().map_or(f64::INFINITY, |u| (through - pl.origin).dot(u).abs());
|
||||
(json!({"plane": {"origin": pl.origin, "normal": n, "through_off_mm": off}}), parallel(n, normal) && off <= tol)
|
||||
}
|
||||
None => (json!("no such construction plane"), false),
|
||||
}
|
||||
} else {
|
||||
(json!("give {point: [x,y,z]}, {axis: {through, dir}} or {plane: {through, normal}}"), false)
|
||||
};
|
||||
c.push(&what, got, w.clone(), ok);
|
||||
}
|
||||
}
|
||||
|
||||
fn unsupported(e: &str) -> bool {
|
||||
e.contains("not supported yet")
|
||||
}
|
||||
@@ -273,6 +583,56 @@ fn case_name(dir: &str) -> (String, String) {
|
||||
(name(p.parent()), name(Some(p)))
|
||||
}
|
||||
|
||||
/// The area a polygon of `[x, y]` points encloses (shoelace), unsigned.
|
||||
fn polygon_area(points: &Value) -> f64 {
|
||||
let pts: Vec<(f64, f64)> = points.as_array().into_iter().flatten().filter_map(|p| Some((p.get(0)?.as_f64()?, p.get(1)?.as_f64()?))).collect();
|
||||
pts.iter().zip(pts.iter().cycle().skip(1)).map(|(a, b)| a.0 * b.1 - b.0 * a.1).sum::<f64>().abs() / 2.0
|
||||
}
|
||||
|
||||
/// The `flat_pattern` check, against the script's last `sheet.flat_pattern` result: `size_mm`
|
||||
/// ([w, h] of the outline), `area_mm2` (the outline loops' area less the cut-outs') and
|
||||
/// `bend_lines` ([[x, y], [x, y]] each, the bends' centre lines in flat coordinates, every one
|
||||
/// matched to its own one of the result's, either way round, and as many of them).
|
||||
fn flat_pattern_checks(c: &mut Checks, want: &Value, results: &[Value], rel: f64, abs: f64) {
|
||||
let Some(got) = results.iter().rev().find(|r| r.get("flat_size_mm").is_some()) else {
|
||||
c.push("flat_pattern", json!("no sheet.flat_pattern result"), want.clone(), false);
|
||||
return;
|
||||
};
|
||||
if let Some(w) = want.get("size_mm").and_then(Value::as_array) {
|
||||
let g = &got["flat_size_mm"];
|
||||
let ok = w.len() == 2
|
||||
&& (0..2).all(|k| match (g.get(k).and_then(Value::as_f64), w.get(k).and_then(Value::as_f64)) {
|
||||
(Some(g), Some(w)) => (g - w).abs() <= abs,
|
||||
_ => false,
|
||||
});
|
||||
c.push("flat_pattern.size_mm", json!([g.get(0), g.get(1)]), json!(w), ok);
|
||||
}
|
||||
if let Some(w) = want.get("area_mm2").and_then(Value::as_f64) {
|
||||
let loops = |k: &str| got[k].as_array().into_iter().flatten().map(polygon_area).sum::<f64>();
|
||||
c.rel("flat_pattern.area_mm2", loops("outline") - loops("cutouts"), Some(w), rel);
|
||||
}
|
||||
if let Some(w) = want.get("bend_lines").and_then(Value::as_array) {
|
||||
let line = |v: &Value| -> Option<[f64; 4]> {
|
||||
let (a, b) = (v.get(0)?, v.get(1)?);
|
||||
Some([a.get(0)?.as_f64()?, a.get(1)?.as_f64()?, b.get(0)?.as_f64()?, b.get(1)?.as_f64()?])
|
||||
};
|
||||
let mut left: Vec<[f64; 4]> = got["bends"].as_array().into_iter().flatten().filter_map(|b| line(&json!([b["start"], b["end"]]))).collect();
|
||||
let got_lines = json!(left.iter().map(|l| [[l[0], l[1]], [l[2], l[3]]]).collect::<Vec<_>>());
|
||||
let near = |p: [f64; 4], q: [f64; 4]| (0..4).all(|k| (p[k] - q[k]).abs() <= abs);
|
||||
let mut ok = left.len() == w.len();
|
||||
for l in w.iter().map(line) {
|
||||
let found = l.and_then(|l| left.iter().position(|g| near(*g, l) || near(*g, [l[2], l[3], l[0], l[1]])));
|
||||
match found {
|
||||
Some(i) => {
|
||||
left.swap_remove(i);
|
||||
}
|
||||
None => ok = false,
|
||||
}
|
||||
}
|
||||
c.push("flat_pattern.bend_lines", got_lines, json!(w), ok);
|
||||
}
|
||||
}
|
||||
|
||||
fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
let (area, name) = case_name(dir);
|
||||
let mut out = json!({"case": name, "area": area, "kernel": kernel()});
|
||||
@@ -292,7 +652,15 @@ fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
out["error"] = json!(missing);
|
||||
return out;
|
||||
}
|
||||
let commands = match scratch(&area, &name).and_then(|o| read_json(&format!("{dir}/recipe.json")).and_then(|r| script(dir, &o, &r))) {
|
||||
let scratch_dir = match scratch(&area, &name) {
|
||||
Ok(o) => o,
|
||||
Err(e) => {
|
||||
out["status"] = json!("fail");
|
||||
out["error"] = json!(e);
|
||||
return out;
|
||||
}
|
||||
};
|
||||
let commands = match read_json(&format!("{dir}/recipe.json")).and_then(|r| script(dir, &scratch_dir, &r)) {
|
||||
Ok(s) => s,
|
||||
Err(e) => {
|
||||
out["status"] = json!("fail");
|
||||
@@ -328,7 +696,7 @@ fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
let ran = s.run_script(&commands);
|
||||
// The commands' own time, without process start or grading: the ladder's timing golden.
|
||||
out["seconds"] = json!(clock.elapsed().as_secs_f64());
|
||||
match (ran, may_refuse) {
|
||||
let answers = match (ran, may_refuse) {
|
||||
(Err(e), _) if crashed(&e.to_string()) => {
|
||||
out["status"] = json!("crash");
|
||||
out["error"] = json!(e.to_string());
|
||||
@@ -364,8 +732,8 @@ fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
out["error"] = json!("succeeded where the case expects a refusal");
|
||||
return out;
|
||||
}
|
||||
(Ok(_), _) => {}
|
||||
}
|
||||
(Ok(r), _) => r,
|
||||
};
|
||||
|
||||
// Every body in the world, imported components included.
|
||||
let world = match s.world_state() {
|
||||
@@ -383,6 +751,17 @@ fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
// body), else one per body.
|
||||
let want_shells = want["shells"].as_u64();
|
||||
let mut shells = 0u64;
|
||||
// What the faces lie on and the edges only one face uses, over every body, as the records
|
||||
// hold them: for `surface_types`, `splines` and `boundary_edges`.
|
||||
let (mut kinds, mut spline_faces, mut boundary) = (std::collections::BTreeSet::new(), Vec::new(), 0u64);
|
||||
for b in &world.bodies {
|
||||
let record = b.body.record();
|
||||
for f in &record.faces {
|
||||
kinds.insert(surface_word(&f.surface));
|
||||
spline_faces.extend(spline_shape(&f.surface));
|
||||
}
|
||||
boundary += record.edges.iter().filter(|e| e.uses.len() == 1).count() as u64;
|
||||
}
|
||||
for b in &world.bodies {
|
||||
let m = match solidcraft_engine::kernel::measure(&b.body) {
|
||||
Ok(m) => m,
|
||||
@@ -504,6 +883,28 @@ fn check_case(dir: &str, dumps: Option<&std::path::Path>) -> Value {
|
||||
c.vec("bbox.min", got.bbox.0, want_bbox.map(|b| b.0), abs);
|
||||
c.vec("bbox.max", got.bbox.1, want_bbox.map(|b| b.1), abs);
|
||||
}
|
||||
output_checks(&mut c, &want, &scratch_dir, &answers, rel);
|
||||
count(&mut c, "boundary_edges", boundary);
|
||||
if has("surface_types") {
|
||||
// The set of surface kinds the faces lie on, exactly: none missing, none extra.
|
||||
let want_kinds: std::collections::BTreeSet<&str> = want["surface_types"].as_array().into_iter().flatten().filter_map(Value::as_str).collect();
|
||||
let ok = want_kinds == kinds.iter().copied().collect();
|
||||
c.push("surface_types", json!(kinds), want["surface_types"].clone(), ok);
|
||||
}
|
||||
if has("splines") {
|
||||
match splines_match(&spline_faces, &want["splines"]) {
|
||||
Ok((got, ok)) => c.push("splines", got, want["splines"].clone(), ok),
|
||||
Err(e) => c.push("splines", json!(e), want["splines"].clone(), false),
|
||||
}
|
||||
}
|
||||
// With no body and no `bbox` the diagonal is not finite: positions then take ABS_FRAC of 1 mm.
|
||||
let pos_tol = if abs.is_finite() { abs } else { ABS_FRAC };
|
||||
if has("construction") {
|
||||
check_construction(&s, &want["construction"], pos_tol, &mut c);
|
||||
}
|
||||
if has("flat_pattern") {
|
||||
flat_pattern_checks(&mut c, &want["flat_pattern"], &answers, rel, abs);
|
||||
}
|
||||
out["status"] = json!(if c.pass { "pass" } else { "fail" });
|
||||
out["checks"] = json!(c.list);
|
||||
out
|
||||
@@ -555,6 +956,8 @@ pub fn run(args: &[String]) -> Result<(), String> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::f64::consts::PI;
|
||||
|
||||
use super::*;
|
||||
|
||||
fn case_dir(root: &std::path::Path, name: &str, recipe: &Value) -> String {
|
||||
@@ -581,6 +984,177 @@ mod tests {
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
}
|
||||
|
||||
/// A bicubic face of 4 × 3 spans and a bilinear one of one span: degrees and spans graded in
|
||||
/// either order of directions, spans only where given, and every face must be accounted for.
|
||||
#[test]
|
||||
fn splines_match_degrees_and_spans_in_either_order() {
|
||||
use solidcraft_engine::geom::brep::Surface;
|
||||
let knots = |p: usize, spans: usize| -> Vec<f64> {
|
||||
let mut k = vec![0.0; p + 1];
|
||||
k.extend((1..spans).map(|i| i as f64));
|
||||
k.extend(vec![spans as f64; p + 1]);
|
||||
k
|
||||
};
|
||||
let face = |pu: usize, su: usize, pv: usize, sv: usize| Surface::Spline {
|
||||
u_knots: knots(pu, su),
|
||||
v_knots: knots(pv, sv),
|
||||
points: vec![vec![[0.0; 3]; pv + sv]; pu + su],
|
||||
};
|
||||
let faces: Vec<_> = [face(3, 4, 3, 3), face(1, 1, 1, 1)].iter().filter_map(spline_shape).collect();
|
||||
assert_eq!(faces[0], [[3, 3], [3, 4]]);
|
||||
let ok = |w: Value| splines_match(&faces, &w).unwrap().1;
|
||||
assert!(ok(json!([{"degree": [1, 1], "spans": [1, 1]}, {"degree": [3, 3], "spans": [4, 3]}])));
|
||||
assert!(ok(json!([{"degree": [3, 3]}, {"degree": [1, 1]}])));
|
||||
assert!(!ok(json!([{"degree": [3, 3], "spans": [4, 4]}, {"degree": [1, 1]}])), "wrong spans");
|
||||
assert!(!ok(json!([{"degree": [3, 3]}])), "a face left over");
|
||||
assert!(!ok(json!([{"degree": [3, 3]}, {"degree": [1, 1]}, {"degree": [1, 1]}])), "an entry with no face");
|
||||
assert!(splines_match(&faces, &json!([{"spans": [1, 1]}])).is_err());
|
||||
assert_eq!(spline_shape(&Surface::Plane { origin: [0.0; 3], u_axis: [1.0, 0.0, 0.0], v_axis: [0.0, 1.0, 0.0] }), None);
|
||||
assert_eq!(surface_word(&face(1, 1, 1, 1)), "bspline");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn json_parts_match_within_tolerance_and_whole_numbers_exactly() {
|
||||
let got = json!({"bends": [{"angle_deg": 90.00001, "direction": "up", "count": 3}], "extra": 1});
|
||||
assert_eq!(json_mismatch(&got, &json!({"bends": [{"angle_deg": 90.0, "direction": "up"}]}), 1e-3, 0.0, ""), None);
|
||||
assert!(json_mismatch(&got, &json!({"bends": [{"count": 4}]}), 1e-3, 0.0, "").is_some_and(|m| m.contains(".bends[0].count")));
|
||||
assert!(json_mismatch(&got, &json!({"bends": []}), 1e-3, 0.0, "").is_some_and(|m| m.contains("1 items, want 0")));
|
||||
assert!(json_mismatch(&got, &json!({"missing": 1}), 1e-3, 0.0, "").is_some_and(|m| m.contains("missing")));
|
||||
assert!(json_mismatch(&got, &json!({"bends": [{"direction": "down"}]}), 1e-3, 0.0, "").is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn csv_rows_are_keyed_by_the_header_and_read_quoted_fields() {
|
||||
let rows = csv_rows("body,angle_deg,note\r\n\"a, \"\"b\"\"\",90.5,x\r\n\"c\",180,\r\n");
|
||||
assert_eq!(rows, vec![json!({"body": "a, \"b\"", "angle_deg": 90.5, "note": "x"}), json!({"body": "c", "angle_deg": 180.0, "note": ""})]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dxf_layers_count_entities_and_measure_their_length() {
|
||||
let pair = |c: &str, v: &str| format!("{c}\n{v}\n");
|
||||
let mut t = String::new();
|
||||
// A circle in the BLOCKS section is not an entity of the drawing.
|
||||
for (c, v) in [("0", "SECTION"), ("2", "BLOCKS"), ("0", "CIRCLE"), ("8", "CUT"), ("40", "9"), ("0", "ENDSEC")] {
|
||||
t += &pair(c, v);
|
||||
}
|
||||
t += &pair("0", "SECTION");
|
||||
t += &pair("2", "ENTITIES");
|
||||
for e in [
|
||||
vec![("0", "LINE"), ("8", "OUTLINE"), ("10", "0"), ("20", "0"), ("11", "3"), ("21", "4")],
|
||||
vec![("0", "ARC"), ("8", "OUTLINE"), ("10", "0"), ("20", "0"), ("40", "2"), ("50", "270"), ("51", "0")],
|
||||
vec![("0", "CIRCLE"), ("8", "CUT"), ("10", "5"), ("20", "5"), ("40", "1")],
|
||||
vec![("0", "LWPOLYLINE"), ("8", "BEND_UP"), ("90", "2"), ("70", "128"), ("10", "0"), ("20", "1"), ("10", "10"), ("20", "1")],
|
||||
vec![
|
||||
("0", "ELLIPSE"),
|
||||
("8", "CUT"),
|
||||
("10", "0"),
|
||||
("20", "0"),
|
||||
("11", "10"),
|
||||
("21", "0"),
|
||||
("40", "1"),
|
||||
("41", "0"),
|
||||
("42", "6.283185307179586"),
|
||||
],
|
||||
] {
|
||||
for (c, v) in e {
|
||||
t += &pair(c, v);
|
||||
}
|
||||
}
|
||||
t += &pair("0", "ENDSEC");
|
||||
t += &pair("0", "EOF");
|
||||
let l = dxf_layers(&t);
|
||||
assert_eq!(l["OUTLINE"]["LINE"], 1);
|
||||
assert_eq!(l["OUTLINE"]["ARC"], 1);
|
||||
assert!((l["OUTLINE"]["length_mm"].as_f64().unwrap() - (5.0 + PI)).abs() < 1e-9, "{l}");
|
||||
assert_eq!(l["CUT"]["CIRCLE"], 1);
|
||||
assert_eq!(l["CUT"]["ELLIPSE"], 1);
|
||||
// A circle of radius 1 and an ellipse of ratio 1 (a circle of radius 10).
|
||||
assert!((l["CUT"]["length_mm"].as_f64().unwrap() - 22.0 * PI).abs() < 1e-6, "{l}");
|
||||
assert!((l["BEND_UP"]["length_mm"].as_f64().unwrap() - 10.0).abs() < 1e-9, "{l}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn output_checks_read_the_files_and_answers_a_case_names() {
|
||||
let out = std::env::temp_dir().join(format!("kernel-cases-files-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&out).unwrap();
|
||||
std::fs::write(out.join("t.json"), r#"{"bends": [{"angle_deg": 90}]}"#).unwrap();
|
||||
std::fs::write(out.join("t.csv"), "bend,angle_deg\r\n1,90\r\n").unwrap();
|
||||
std::fs::write(out.join("t.dxf"), "0\nSECTION\n2\nENTITIES\n0\nLINE\n8\nOUTLINE\n10\n0\n20\n0\n11\n1\n21\n0\n0\nENDSEC\n").unwrap();
|
||||
let dir = out.to_string_lossy().to_string();
|
||||
let run = |want: Value| {
|
||||
let mut c = Checks { list: Vec::new(), pass: true };
|
||||
output_checks(&mut c, &want, &dir, &[json!({"count": 3})], 1e-3);
|
||||
c.pass
|
||||
};
|
||||
assert!(run(json!({"files": [{"path": "t.json", "json": {"bends": [{"angle_deg": 90.0}]}}]})));
|
||||
assert!(run(json!({"files": [{"path": "t.csv", "csv": [{"bend": 1, "angle_deg": 90.0}]}]})));
|
||||
assert!(run(json!({"files": [{"path": "t.dxf", "dxf": {"OUTLINE": {"LINE": [1, 8], "ARC": 0, "length_mm": 1.0}}}]})));
|
||||
assert!(!run(json!({"files": [{"path": "t.dxf", "dxf": {"OUTLINE": {"LINE": [2, 8]}}}]})));
|
||||
assert!(!run(json!({"files": [{"path": "t.dxf", "dxf": {"CUT": {"CIRCLE": 1}}}]})));
|
||||
assert!(!run(json!({"files": [{"path": "none.json", "json": {}}]})));
|
||||
assert!(run(json!({"results": [{"step": 1, "json": {"count": 3}}]})));
|
||||
assert!(!run(json!({"results": [{"step": 2, "json": {}}]})));
|
||||
let _ = std::fs::remove_dir_all(&out);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn construction_is_graded_as_the_point_line_or_plane_it_is() {
|
||||
let mut s = solidcraft_engine::Session::default();
|
||||
let script = json!({"commands": [
|
||||
{"command": "construct.point.three_planes", "params": {"a": "XY", "b": "XZ", "c": "YZ", "name": "Pin"}},
|
||||
{"command": "construct.axis.two_planes", "params": {"a": "XZ", "b": "YZ", "name": "Spine"}},
|
||||
{"command": "construct.plane.offset", "params": {"base": "XY", "offset": "5 mm", "name": "Shelf"}},
|
||||
]});
|
||||
s.run_script(&script).unwrap();
|
||||
let grade = |want: Value| {
|
||||
let mut c = Checks { list: Vec::new(), pass: true };
|
||||
check_construction(&s, &want, 1e-3, &mut c);
|
||||
c.pass
|
||||
};
|
||||
// An axis is its line, either way along it, through any point of it; a plane likewise.
|
||||
assert!(grade(json!({
|
||||
"Pin": {"point": [0, 0, 0]},
|
||||
"Spine": {"axis": {"through": [0, 0, 40], "dir": [0, 0, -1]}},
|
||||
"Shelf": {"plane": {"through": [7, -3, 5], "normal": [0, 0, 2]}},
|
||||
})));
|
||||
assert!(!grade(json!({"Pin": {"point": [0, 0, 0.01]}})));
|
||||
assert!(!grade(json!({"Spine": {"axis": {"through": [0.01, 0, 0], "dir": [0, 0, 1]}}})));
|
||||
assert!(!grade(json!({"Spine": {"axis": {"through": [0, 0, 0], "dir": [0, 0.01, 1]}}})));
|
||||
assert!(!grade(json!({"Shelf": {"plane": {"through": [0, 0, 5.01], "normal": [0, 0, 1]}}})));
|
||||
assert!(!grade(json!({"Shelf": {"plane": {"through": [0, 0, 5], "normal": [1, 0, 0]}}})));
|
||||
// A name the timeline has not got, or of another kind, fails.
|
||||
assert!(!grade(json!({"Pin": {"plane": {"through": [0, 0, 0], "normal": [0, 0, 1]}}})));
|
||||
assert!(!grade(json!({"Nothing": {"point": [0, 0, 0]}})));
|
||||
assert!(!grade(json!({"Pin": {"centre": [0, 0, 0]}})));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn results_are_read_from_each_commands_reply() {
|
||||
let replies = [json!({"center": [1.0, 2.0, 3.0], "volume": 24000.0}), json!({"summary": {"worst": "g1"}, "count": 1})];
|
||||
let grade = |results: Value| {
|
||||
let mut c = Checks { list: Vec::new(), pass: true };
|
||||
output_checks(&mut c, &json!({ "results": results }), "", &replies, 1e-3);
|
||||
c.pass
|
||||
};
|
||||
assert!(grade(json!([
|
||||
{"step": 1, "pointer": "/center", "json": [1.0, 2.0, 3.0]},
|
||||
{"step": 1, "pointer": "/volume", "json": 24010.0},
|
||||
{"step": 2, "pointer": "/summary/worst", "json": "g1"},
|
||||
{"step": 2, "json": {"count": 1}},
|
||||
])));
|
||||
assert!(!grade(json!([{"step": 1, "pointer": "/volume", "json": 24100.0}])));
|
||||
assert!(grade(json!([{"step": 1, "pointer": "/volume", "json": 24100.0, "rel": 0.01}])));
|
||||
assert!(!grade(json!([{"step": 1, "pointer": "/center", "json": [1.0, 2.0, 3.01]}])));
|
||||
assert!(grade(json!([{"step": 1, "pointer": "/center", "json": [1.0, 2.0, 3.01], "abs_mm": 0.02}])));
|
||||
assert!(!grade(json!([{"step": 2, "pointer": "/summary/worst", "json": "g2"}])));
|
||||
// A whole number is exact: a count.
|
||||
assert!(!grade(json!([{"step": 2, "pointer": "/count", "json": 2}])));
|
||||
// A step or a part that is not there fails, as does an entry without a step.
|
||||
assert!(!grade(json!([{"step": 3, "pointer": "/count", "json": 1}])));
|
||||
assert!(!grade(json!([{"step": 2, "pointer": "/missing", "json": null}])));
|
||||
assert!(!grade(json!([{"pointer": "/count", "json": 1}])));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_base_cycle_is_an_error_not_a_hang() {
|
||||
let root = std::env::temp_dir().join(format!("kernel-cases-cycle-{}", std::process::id()));
|
||||
@@ -590,4 +1164,27 @@ mod tests {
|
||||
assert!(script(&a, "/scratch", &r).unwrap_err().contains("deeper than"));
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
}
|
||||
|
||||
/// The flat pattern is graded on the last `sheet.flat_pattern` result: its size, its outline's
|
||||
/// area less the cut-outs', and its bend lines matched either way round, one for one.
|
||||
#[test]
|
||||
fn flat_pattern_grades_size_area_and_bend_lines() {
|
||||
let flat = json!({"flat_size_mm": [10.0, 4.0, 2.0],
|
||||
"outline": [[[0.0, 0.0], [10.0, 0.0], [10.0, 4.0], [0.0, 4.0]]], "cutouts": [[[1.0, 1.0], [2.0, 1.0], [2.0, 2.0], [1.0, 2.0]]],
|
||||
"bends": [{"start": [5.0, 0.0], "end": [5.0, 4.0]}]});
|
||||
let results = [json!({"volume_mm3": 1.0}), flat];
|
||||
let grade = |want: Value| {
|
||||
let mut c = Checks { list: Vec::new(), pass: true };
|
||||
flat_pattern_checks(&mut c, &want, &results, 1e-3, 1e-3);
|
||||
c.pass
|
||||
};
|
||||
assert!(grade(json!({"size_mm": [10.0, 4.0], "area_mm2": 39.0, "bend_lines": [[[5.0, 4.0], [5.0, 0.0]]]})));
|
||||
assert!(!grade(json!({"area_mm2": 40.0})), "the cut-out is not material");
|
||||
assert!(!grade(json!({"size_mm": [10.0, 5.0]})));
|
||||
assert!(!grade(json!({"bend_lines": [[[5.0, 0.0], [5.0, 4.0]], [[5.0, 0.0], [5.0, 4.0]]]})), "one bend line matches one only");
|
||||
assert!(!grade(json!({"bend_lines": [[[6.0, 0.0], [6.0, 4.0]]]})));
|
||||
let mut c = Checks { list: Vec::new(), pass: true };
|
||||
flat_pattern_checks(&mut c, &json!({"area_mm2": 1.0}), &results[..1], 1e-3, 1e-3);
|
||||
assert!(!c.pass, "no flat pattern was made");
|
||||
}
|
||||
}
|
||||
@@ -461,21 +461,40 @@ fn thread_grooves(
|
||||
format!("this {shown} mm shaft is too thin for a modelled {m} thread: {cut}; make the shaft {} mm for {m}{alt}", show_mm(d))
|
||||
}));
|
||||
}
|
||||
// The section's radial span: from the root out past the surface (external), or from inside
|
||||
// the hole wall out to the root (internal), so the cut leaves no skin.
|
||||
// The section: from the root out past the surface (external), or from inside the hole wall
|
||||
// out to the root (internal), so the cut leaves no skin, its flanks the groove's.
|
||||
// A taper thread's crests are cut by its major cone (external) or minor cone (internal),
|
||||
// as the die or tap cuts them ([`taper_envelope`]): its groove reaches just past the crest,
|
||||
// by as much as narrows the tooth's crest flat by a quarter (NPT's flat is 0.038 P).
|
||||
let past = |g: &crate::thread_forms::GrooveProfile| 0.25 * g.crest_flat / (g.flank_lo.tan() + g.flank_hi.tan());
|
||||
let span = |g: &crate::thread_forms::GrooveProfile| match (taper.is_some(), t.internal) {
|
||||
(true, true) => (g.crest_r - past(g), g.root_r),
|
||||
(true, false) => (g.root_r, g.crest_r + past(g)),
|
||||
(false, true) => (radius.min(g.crest_r) - 0.1 * p, g.root_r),
|
||||
(false, false) => (g.root_r, radius.max(d / 2.0) + 0.05 * p),
|
||||
// as the die or tap cuts them ([`taper_envelope`]): its groove reaches past the crest by as
|
||||
// much as narrows the tooth's crest flat by a quarter (NPT's flat is 0.038 P). The cone
|
||||
// changes 1 in 32 along the axis (`major_at`) across the section's own width, so its edge
|
||||
// there follows the cone at that margin rather than being cut square: square, its deeper
|
||||
// corner stops short of the cone and leaves a sliver of each flank.
|
||||
let cone = taper.map_or(0.0, |_| (major_at(t.start + 1.0) - major_at(t.start)) / 2.0);
|
||||
let section_of = |g: &crate::thread_forms::GrooveProfile| -> (Vec<Vec2>, f64) {
|
||||
let (tl, th) = (g.flank_lo.tan(), g.flank_hi.tan());
|
||||
if taper.is_none() {
|
||||
let (r0, r1) = if t.internal { (radius.min(g.crest_r) - 0.1 * p, g.root_r) } else { (g.root_r, radius.max(d / 2.0) + 0.05 * p) };
|
||||
let ((lo0, hi0), (lo1, hi1)) = (g.extents(p, r0), g.extents(p, r1));
|
||||
let wide = g.width(p, if t.internal { r0 } else { r1 });
|
||||
return (vec![Vec2::new(r0, -lo0), Vec2::new(r1, -lo1), Vec2::new(r1, hi1), Vec2::new(r0, hi0)], wide);
|
||||
}
|
||||
// Depth from the root, out towards the crest: d(z) = dc + q·z along the edge, which
|
||||
// meets the flanks z = −(h + d·tl) and z = h + d·th.
|
||||
let o = if t.internal { -1.0 } else { 1.0 };
|
||||
let q = o * cone;
|
||||
let h = g.width(p, g.root_r) / 2.0;
|
||||
let dc = o * (g.crest_r - g.root_r) + 0.25 * g.crest_flat / (tl + th);
|
||||
let (z_lo, z_hi) = (-(h + dc * tl) / (1.0 + q * tl), (h + dc * th) / (1.0 - q * th));
|
||||
let r = |z: f64| g.root_r + o * (dc + q * z);
|
||||
let (root, edge) = ([Vec2::new(g.root_r, -h), Vec2::new(g.root_r, h)], [Vec2::new(r(z_lo), z_lo), Vec2::new(r(z_hi), z_hi)]);
|
||||
// In the order the square section has: the inner radius's corners first.
|
||||
let pts = if t.internal { vec![edge[0], root[0], root[1], edge[1]] } else { vec![root[0], edge[0], edge[1], root[1]] };
|
||||
(pts, z_hi - z_lo)
|
||||
};
|
||||
let (r0, r1) = span(&g);
|
||||
let wide = if t.internal { r0 } else { r1 };
|
||||
if g.width(p, wide) >= p * 0.98 {
|
||||
let (mut section, wide) = section_of(&g);
|
||||
let radii = |s: &[Vec2]| s.iter().fold((f64::INFINITY, f64::NEG_INFINITY), |(a, b), v| (a.min(v.x), b.max(v.x)));
|
||||
let (r0, r1) = radii(§ion);
|
||||
if wide >= p * 0.98 {
|
||||
// The groove would be wider than a pitch: the face is far inside the thread (a hole
|
||||
// narrower than its minor diameter, a shaft thicker than its major one, #2688).
|
||||
let (m, dia) = (&t.designation, 2.0 * radius);
|
||||
@@ -488,9 +507,6 @@ fn thread_grooves(
|
||||
format!("this {shown} mm shaft is too thick for a modelled {m} thread; make the shaft {} mm for {m}{alt}", show_mm(d))
|
||||
}));
|
||||
}
|
||||
let (lo0, hi0) = g.extents(p, r0);
|
||||
let (lo1, hi1) = g.extents(p, r1);
|
||||
let mut section = vec![Vec2::new(r0, -lo0), Vec2::new(r1, -lo1), Vec2::new(r1, hi1), Vec2::new(r0, hi0)];
|
||||
if !(r0.is_finite() && r1.is_finite() && r0 > 0.0) {
|
||||
return Err(DocError::Invalid("thread dimensions are out of range".into()));
|
||||
}
|
||||
@@ -503,7 +519,8 @@ fn thread_grooves(
|
||||
// the material (an external thread's away from the axis, past the surface; an internal
|
||||
// one's towards it, into the hole) as it turns. It lies past the full-form length, up to the
|
||||
// shoulder's clearance; at a free end, inside the face, the groove reaching nothing there.
|
||||
let (w_lo, w_hi) = (lo0.max(lo1), hi0.max(hi1));
|
||||
// How far the section reaches each way along the axis.
|
||||
let (w_lo, w_hi) = section.iter().fold((0.0_f64, 0.0_f64), |(a, b), v| (a.max(-v.y), b.max(v.y)));
|
||||
let s0 = match (ends[0], ease[0] > 0.0) {
|
||||
(End::Free, false) => t.start - p,
|
||||
(End::Free, true) => t.start,
|
||||
@@ -528,11 +545,8 @@ fn thread_grooves(
|
||||
let mut r0 = r0;
|
||||
let taper_rate = match taper {
|
||||
Some(_) => {
|
||||
let gb = profile(major_at(s0));
|
||||
let (a, b) = span(&gb);
|
||||
let ((l0, h0), (l1, h1)) = (gb.extents(p, a), gb.extents(p, b));
|
||||
section = vec![Vec2::new(a, -l0), Vec2::new(b, -l1), Vec2::new(b, h1), Vec2::new(a, h0)];
|
||||
r0 = a;
|
||||
section = section_of(&profile(major_at(s0))).0;
|
||||
r0 = radii(§ion).0;
|
||||
(major_at(s0 + lead) - major_at(s0)) / 2.0
|
||||
}
|
||||
None => 0.0,
|
||||
|
||||
+166
-135
@@ -12,13 +12,14 @@ The **frontier** is the first case of a tier, in ladder order, that fails (fail,
|
||||
| 02-booleans | booleans in the degeneracy classes, and cuts that end in a single line | 25 | 25 pass | – |
|
||||
| 03-analytic-profiles | extrudes and revolves of line-and-arc profiles | 10 | 10 pass | – |
|
||||
| 04-spline-profiles | spline profiles, sweeps and lofts | 12 | 12 pass | – |
|
||||
| 05-holes-and-taps | holes and tapped holes | 13 | 13 pass | – |
|
||||
| 06-threads | modelled threads | 19 | 19 pass | – |
|
||||
| 07-fillets | constant, variable and corner fillets | 18 | 17 pass, 1 unsupported | – |
|
||||
| 05-holes-and-taps | holes and tapped holes | 17 | 17 pass | – |
|
||||
| 06-threads | modelled threads | 30 | 1 fail, 29 pass | 023-external-1-2-npt |
|
||||
| 07-fillets | constant, variable and corner fillets | 19 | 19 pass | – |
|
||||
| 08-chamfers | chamfers | 8 | 8 pass | – |
|
||||
| 09-shells-and-offsets | shells and offsets | 15 | 15 pass | – |
|
||||
| 10-patterns-and-mirrors | patterns and mirrors | 8 | 8 pass | – |
|
||||
| 11-cumulative-parts | parts combining every tier | 4 | 4 pass | – |
|
||||
| 12-sheet-metal | sheet metal: flanges, closed corners, reliefs, hems, folds and the flat pattern | 14 | 14 pass | – |
|
||||
|
||||
Cases where SMLib's check gave no verdict on a body (SMLib can't take the record yet), so only the record's checks graded validity: 0.
|
||||
|
||||
@@ -28,141 +29,171 @@ Times are the commands' own, in seconds, from the case's process; **golden** is
|
||||
|
||||
| Case | What | Answer | Result | s | golden s | changes |
|
||||
|---|---|---|---|---|---|---|
|
||||
| ladder/01-primitives/005-sphere | a sphere r10 | analytic | pass | 0.003 | 0.003 | |
|
||||
| ladder/01-primitives/001-box | a 60x40x20 box: the stock every later tier starts from | analytic | pass | 0.004 | 0.004 | |
|
||||
| ladder/01-primitives/004-frustum | a cone frustum r10 -> r5, h20 (revolved trapezoid) | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/01-primitives/003-cone | a cone r10 h30 (no cone primitive: a revolved right triangle, its axis a sketch line) | analytic | pass | 0.025 | 0.025 | |
|
||||
| ladder/01-primitives/002-cylinder | a cylinder r10 h30 | analytic | pass | 0.032 | 0.032 | |
|
||||
| ladder/01-primitives/006-torus | a torus R20 r5 | analytic | pass | 0.575 | 0.575 | |
|
||||
| ladder/02-booleans/001-coincident-face-join | a 60x40x10 box joined exactly on the stock's top face: one 60x40x30 box | analytic | pass | 0.006 | 0.006 | |
|
||||
| ladder/02-booleans/019-notch-flush-with-end-face | a notch 40x20 through the height, its end flush with the stock's end face: a U | analytic | pass | 0.007 | 0.007 | |
|
||||
| ladder/02-booleans/004-edge-on-edge-no-overlap | a cut tool that shares only the top front edge of the stock | analytic | pass | 0.010 | 0.010 | |
|
||||
| ladder/02-booleans/015-knife-edge-wedge-cut | a triangular prism cut whose slope meets the bottom face along one line (a knife edge), its other faces on the stock's | analytic | pass | 0.011 | 0.011 | |
|
||||
| ladder/02-booleans/014-cut-through-sphere-pole | a 4x4 square post cut off the top of a sphere r10 through its pole | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/02-booleans/016-v-groove-pinches-bottom-to-line | a V groove whose apex touches the bottom face along a line, cut through: two pieces | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/02-booleans/020-part-back-wall | the running part: a 60x10x15 back wall joined on the stock's top, flush with its back and ends | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/01-primitives/005-sphere | a sphere r10 | analytic | pass | 0.005 | 0.005 | |
|
||||
| ladder/01-primitives/003-cone | a cone r10 h30 (no cone primitive: a revolved right triangle, its axis a sketch line) | analytic | pass | 0.037 | 0.037 | |
|
||||
| ladder/01-primitives/004-frustum | a cone frustum r10 -> r5, h20 (revolved trapezoid) | analytic | pass | 0.041 | 0.041 | |
|
||||
| ladder/01-primitives/002-cylinder | a cylinder r10 h30 | analytic | pass | 0.043 | 0.043 | |
|
||||
| ladder/01-primitives/006-torus | a torus R20 r5 | analytic | pass | 0.172 | 0.172 | |
|
||||
| ladder/02-booleans/004-edge-on-edge-no-overlap | a cut tool that shares only the top front edge of the stock | analytic | pass | 0.011 | 0.011 | |
|
||||
| ladder/02-booleans/015-knife-edge-wedge-cut | a triangular prism cut whose slope meets the bottom face along one line (a knife edge), its other faces on the stock's | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/02-booleans/001-coincident-face-join | a 60x40x10 box joined exactly on the stock's top face: one 60x40x30 box | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/02-booleans/016-v-groove-pinches-bottom-to-line | a V groove whose apex touches the bottom face along a line, cut through: two pieces | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/02-booleans/003-pocket-flush-with-top | a 20x20x10 pocket whose tool's top is the stock's top face | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/02-booleans/002-coplanar-overlap-join | two 60x40x20 boxes overlapping 30x20 in plan, tops and bottoms coplanar | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/02-booleans/006-tangent-along-line-no-overlap | a cylinder r10 along X lying on the top face (tangent along a line), cut | analytic | pass | 0.016 | 0.016 | |
|
||||
| ladder/02-booleans/017-cylinder-tangent-top-and-bottom | a cylinder r10 along X tangent to both the top and bottom faces, cut: two pieces with zero-angle cusps | analytic | pass | 0.023 | 0.023 | |
|
||||
| ladder/02-booleans/018-hole-tangent-to-side-face | a through hole r10 tangent to the front face: the front face pinched to a line | analytic | pass | 0.026 | 0.026 | |
|
||||
| ladder/02-booleans/008-near-tangent-gap-1e-6 | a cylinder r10 along X 1e-6 mm above the top face, cut | analytic | pass | 0.028 | 0.028 | |
|
||||
| ladder/02-booleans/010-near-tangent-overlap-1e-6 | a cylinder r10 along X dipping 1e-6 mm into the top face, cut | invariants | pass | 0.029 | 0.029 | |
|
||||
| ladder/02-booleans/011-tangent-along-circle-through-hole | a sphere r10 sitting in a through hole r10 at the top edge (tangent along the hole's top circle), cut | analytic | pass | 0.035 | 0.035 | |
|
||||
| ladder/02-booleans/005-vertex-on-face-no-overlap | an inverted cone whose apex touches the middle of the top face, cut | analytic | pass | 0.043 | 0.043 | |
|
||||
| ladder/02-booleans/007-near-tangent-gap-1e-3 | a cylinder r10 along X 1e-3 mm above the top face, cut | analytic | pass | 0.044 | 0.044 | |
|
||||
| ladder/02-booleans/009-near-tangent-overlap-1e-3 | a cylinder r10 along X dipping 1e-3 mm into the top face, cut: a groove 1e-3 deep | analytic | pass | 0.048 | 0.048 | |
|
||||
| ladder/02-booleans/013-cut-across-cylinder-seam | a 10x4 notch through a cylinder r10 across its +X side (where the seam lies) | analytic | pass | 0.050 | 0.050 | |
|
||||
| ladder/02-booleans/021-holes-touching-at-a-point | two through holes r5 whose circles touch at one point (30, 20) | analytic | pass | 0.055 | 0.055 | |
|
||||
| ladder/02-booleans/012-tangent-along-circle-bowl | a blind hole r10 10 deep, then a sphere r10 centred on its floor: the floor disk vanishes exactly | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/02-booleans/022-cylinder-grazing-a-hole-edge | a corner piece (square column minus a quarter disc r1.5, 0.0003 off the axis) cut out of a part with a blind r1.6 hole on the same axis: the tool's r1.5 face sits 0.1 mm inside the hole wall; 'no result' | analytic | pass | 0.061 | 0.061 | |
|
||||
| ladder/02-booleans/023-lips-1e-4-off-the-walls-joined | two half-annulus lips (r 4..5, from z=2 to 20) joined onto a stadium-ring base (z 0..2, r 3..5 arcs, centres 20 apart) with their cylinder walls 0.0001 mm off the base's: the lip cap touches the base top, leaving a 0.0001 mm crescent overhang. Layout is a hand-built variant of the PR's public reproduction | analytic | pass | 0.132 | 0.132 | |
|
||||
| ladder/02-booleans/024-wall-halves-merged-into-a-flange | the flange top annulus of a freshly revolved hub (z = 6, r 18..30) picked by a point and extruded 5 mm (the pick found a third of the face: "the selected planar face no longer exists") | analytic | pass | 0.237 | 0.237 | |
|
||||
| ladder/02-booleans/025-flush-chord-layers-joined | a join of flush layers: a disc r37 (z -1.2..0) carrying 15 of the 19 regions of a sketch of 18 chords (z -3.6..-1.2; four bands left out), on an annulus r35..37 (z -5.6..-3.6) joined to a disc of all the chord regions (z -8..-5.6): SMLib's result came back with 'loop encloses no (u, v) area' though both operands are valid | analytic | pass | 1.355 | 1.355 | |
|
||||
| ladder/03-analytic-profiles/001-extrude-rect-with-arc-end | a 60x40 profile with a semicircular end r20, extruded 20 | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/03-analytic-profiles/007-revolve-180-touching-axis | a 15x20 rectangle on the axis revolved 180 deg: a half cylinder | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/03-analytic-profiles/006-revolve-partial-90 | a 10x10 rectangle 10 mm off the axis revolved 90 deg | analytic | pass | 0.016 | 0.016 | |
|
||||
| ladder/03-analytic-profiles/008-extrude-slot | a slot (centres 40 apart, width 20) extruded 10 | analytic | pass | 0.023 | 0.023 | |
|
||||
| ladder/03-analytic-profiles/003-extrude-tapered-circle | a circle r10 extruded 20 with a -5 deg taper (inward): a cone frustum | analytic | pass | 0.050 | 0.050 | |
|
||||
| ladder/03-analytic-profiles/002-extrude-annulus | an annulus r20/r10 extruded 15 | analytic | pass | 0.059 | 0.059 | |
|
||||
| ladder/03-analytic-profiles/004-revolve-full-off-axis | a 10x30 rectangle 10 mm off the Z axis revolved 360 deg: a tube | analytic | pass | 0.065 | 0.065 | |
|
||||
| ladder/03-analytic-profiles/005-revolve-touching-axis-hemisphere | a quarter disk r20 with an edge on the Z axis revolved 360 deg: a hemisphere | analytic | pass | 0.070 | 0.070 | |
|
||||
| ladder/03-analytic-profiles/009-part-boss-and-slot | the running part: a revolved boss r8 h10 joined on the top, a slot 15x8 cut through the base | analytic | pass | 0.124 | 0.124 | |
|
||||
| ladder/03-analytic-profiles/010-revolve-horn-torus-270 | the half disc of radius 14 on the far side of a diameter 14 mm from the axis (the full circle would touch the axis: a horn torus) revolved 270 degrees | analytic | pass | 0.136 | 0.136 | |
|
||||
| ladder/04-spline-profiles/005-loft-square-frustum | a loft between a 40 square at z=0 and a 20 square at z=30 | analytic | pass | 0.011 | 0.011 | |
|
||||
| ladder/04-spline-profiles/001-extrude-bezier-arch | a profile closed by a cubic Bezier arch (control-point spline, 4 points), extruded 10 | analytic | pass | 0.015 | 0.015 | |
|
||||
| ladder/04-spline-profiles/008-loft-square-to-circle | a loft from a 40 square at z=0 to a circle r10 at z=30 | analytic | pass | 0.027 | 0.027 | |
|
||||
| ladder/04-spline-profiles/009-extrude-periodic-fit-spline | a closed periodic fit-point spline through 6 points, extruded 10 | analytic | pass | 0.035 | 0.035 | |
|
||||
| ladder/04-spline-profiles/004-sweep-square-along-bezier | a 4x4 square swept along the same Bezier path | analytic | pass | 0.042 | 0.042 | |
|
||||
| ladder/04-spline-profiles/006-loft-circle-frustum | a loft between circles r20 at z=0 and r10 at z=30 | analytic | pass | 0.059 | 0.059 | |
|
||||
| ladder/04-spline-profiles/007-loft-three-circles | a smooth loft through circles r20, r10, r20 at z = 0, 20, 40 | analytic | pass | 0.072 | 0.072 | |
|
||||
| ladder/04-spline-profiles/002-revolve-bezier-profile | a profile with a Bezier side (r from 20 to 15 over z 0..30) revolved 360 deg about Z | analytic | pass | 0.084 | 0.084 | |
|
||||
| ladder/04-spline-profiles/010-part-bezier-window | the running part: a Bezier-arched window cut through the back wall | analytic | pass | 0.131 | 0.131 | |
|
||||
| ladder/04-spline-profiles/003-pipe-along-bezier | a pipe d4 along a planar Bezier path | analytic | pass | 0.141 | 0.141 | |
|
||||
| ladder/04-spline-profiles/012-loft-ribs-joined-to-a-rounded-pad | the same without the top flange: the join fails with 'boolean Union: no result' | analytic | pass | 0.681 | 0.681 | |
|
||||
| ladder/04-spline-profiles/011-crossing-pleated-loft-skins-joined | a join of two pleated skins (lofts between 24-pleat star outlines, less the same loft moved in 1.1 mm) that cross along a ring near their bottoms: truck panicked ('tolerance must be no less than 1e-6') or gave no result | analytic | pass | 1.376 | 1.376 | |
|
||||
| ladder/05-holes-and-taps/006-tapped-m6-through | an M6 tapped hole through: the tap drill d5 (major - pitch), cosmetic thread | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/05-holes-and-taps/001-simple-through | a d10 through hole in the stock's top | analytic | pass | 0.033 | 0.033 | |
|
||||
| ladder/05-holes-and-taps/009-hole-0.5-from-edge | a d10 through hole whose wall is 0.5 mm from the end face | analytic | pass | 0.034 | 0.034 | |
|
||||
| ladder/05-holes-and-taps/010-hole-tangent-to-end-face | a d10 through hole tangent to the end face x=0 | analytic | pass | 0.036 | 0.036 | |
|
||||
| ladder/05-holes-and-taps/003-drilled-blind-118 | a d10 drilled hole 10 deep to the shoulder with a 118 deg point | analytic | pass | 0.044 | 0.044 | |
|
||||
| ladder/05-holes-and-taps/007-tapped-m8-blind | an M8 tapped blind hole 12 deep with a 118 deg drill point | analytic | pass | 0.045 | 0.045 | |
|
||||
| ladder/05-holes-and-taps/002-simple-blind-flat | a d10 blind hole 10 deep, flat bottom | analytic | pass | 0.046 | 0.046 | |
|
||||
| ladder/05-holes-and-taps/004-counterbore | a counterbored hole: d6.6 through, d11 x 6.4 counterbore | analytic | pass | 0.051 | 0.051 | |
|
||||
| ladder/05-holes-and-taps/005-countersink | a countersunk hole: d6.6 through, d12 x 90 deg countersink | analytic | pass | 0.089 | 0.089 | |
|
||||
| ladder/05-holes-and-taps/011-crossing-holes-steinmetz | two d10 through holes whose axes cross: vertical and along Y at z=10 | analytic | pass | 0.102 | 0.102 | |
|
||||
| ladder/05-holes-and-taps/012-crossing-tapped-holes-offset | two M6 tapped holes (d5) crossing with axes 2 mm apart | analytic | pass | 0.113 | 0.113 | |
|
||||
| ladder/05-holes-and-taps/008-tapped-m5-into-curved-face | an M5 tapped hole drilled radially through a cylinder r20 lying along X | analytic | pass | 0.130 | 0.130 | |
|
||||
| ladder/05-holes-and-taps/013-part-holes | the running part: an M6 tapped through hole, an M5 tapped blind hole in the boss, a d3.3 hole down through wall and base | analytic | pass | 0.280 | 0.280 | |
|
||||
| ladder/06-threads/012-external-acme-3-4-6 | a modelled 3/4-6 ACME thread (ASME B1.5, general purpose) on a 3/4 in shaft, six turns | analytic | pass | 0.839 | 0.839 | |
|
||||
| ladder/06-threads/013-external-s20x4 | a modelled metric buttress S20x4 thread (DIN 513, 3/30 deg) on a d20 shaft, six turns | analytic | pass | 0.945 | 0.945 | |
|
||||
| ladder/06-threads/011-external-tr20x4 | a modelled trapezoidal Tr20x4 thread (ISO 2904) on a d20 shaft, six turns | analytic | pass | 0.956 | 0.956 | |
|
||||
| ladder/06-threads/003-external-m10-partial-length | a modelled M10 thread over 15 of the 30 mm from the top end (`from`): it stops square in the middle of the face | analytic | pass | 1.088 | 1.088 | |
|
||||
| ladder/06-threads/015-internal-tr20x4-nut | a modelled internal Tr20x4 thread in a d16 (D1 = d - P) bore through a 40x40x24 block | analytic | pass | 1.200 | 1.200 | |
|
||||
| ladder/06-threads/014-external-buttress-asme-1.5-8 | a modelled 1.5-8 buttress thread (ASME B1.9 basic profile, 7/45 deg) on a 1.5 in shaft, six turns | analytic | pass | 1.347 | 1.347 | |
|
||||
| ladder/06-threads/010-part-threaded-boss | the running part with a modelled M16 thread on its d16 boss | analytic | pass | 1.462 | 1.462 | |
|
||||
| ladder/06-threads/016-external-m10-left-hand | 001's modelled M10 thread, left-handed: the same volume, turning the other way | analytic | pass | 1.690 | 1.690 | |
|
||||
| ladder/06-threads/019-external-tr40x14-p7-two-start | a modelled two-start trapezoidal Tr40x14(P7) thread (ISO 2904, ISO 2903) on a d40 shaft, three leads long | analytic | pass | 1.831 | 1.831 | |
|
||||
| ladder/06-threads/005-internal-m10-through | a modelled internal M10 thread in a d8.5 (tap drill) hole through a 30x30x20 block | analytic | pass | 1.872 | 1.872 | |
|
||||
| ladder/06-threads/006-external-m10-into-chamfer | a d10 x 30 cylinder with a 1 mm chamfer on top, then a modelled M10 thread over its cylinder face, running out through the chamfer | analytic | pass | 1.920 | 1.920 | |
|
||||
| ladder/06-threads/007-external-m10-at-filleted-shoulder | a modelled M10 thread on a d10 shaft whose root at the d16 shoulder has an r1 fillet: it stops clear of the fillet | analytic | pass | 1.964 | 1.964 | |
|
||||
| ladder/06-threads/001-external-m10-full | a modelled M10 thread over the whole of a d10 x 30 cylinder | analytic | pass | 2.128 | 2.128 | |
|
||||
| ladder/06-threads/004-external-m10-to-shoulder | a modelled M10 thread on a d10 shaft running down to a d16 shoulder: it stops clear of it, the collar whole | analytic | pass | 2.144 | 2.144 | |
|
||||
| ladder/06-threads/009-thread-runout-length | 004's M10 thread run from the free top end, vanishing over a 3 mm (2 P) runout before the d16 shoulder | analytic | pass | 2.203 | 2.203 | |
|
||||
| ladder/06-threads/002-external-m10x1-fine | a modelled fine M10x1 thread over a d10 x 30 cylinder | analytic | pass | 2.626 | 2.626 | |
|
||||
| ladder/06-threads/017-external-m10-chamfered-tip | 001's modelled M10 thread with ISO 4753's chamfered end at both free ends: a 45 deg cone down to the minor diameter, cut after the groove | analytic | pass | 3.485 | 3.485 | |
|
||||
| ladder/06-threads/008-multi-start-thread | a two-start M10 thread (lead 3, pitch 1.5) over a d10 x 30 cylinder | analytic | pass | 3.706 | 3.706 | |
|
||||
| ladder/06-threads/018-external-m10-both-hands | 001's modelled M10 thread cut both ways: a right- and a left-handed groove crossing on a d10 x 30 cylinder | analytic | pass | 7.756 | 7.756 | |
|
||||
| ladder/07-fillets/015-corner-g2-patch | three r5 rounds at a corner with the g2 corner patch | invariants | not supported yet: step 2 (solid.fillet): invalid input: not supported yet: a fillet with G2 corner patches with the SMLib kernel | 0.003 | 0.003 | |
|
||||
| ladder/07-fillets/006-variable-r5-to-zero | a variable round on the top front edge, r5 at x=0 down to 0 at the x=60 vertex | analytic | pass | 0.009 | 0.009 | |
|
||||
| ladder/07-fillets/001-single-edge-r5 | an r5 round on the stock's top front edge | analytic | pass | 0.016 | 0.016 | |
|
||||
| ladder/07-fillets/007-variable-r5-to-1e-3 | a variable round on the top front edge, r5 down to 1e-3 mm | analytic | pass | 0.018 | 0.018 | |
|
||||
| ladder/07-fillets/011-chain-ending-at-corner | r5 rounds on two top edges meeting at a corner whose vertical edge stays sharp | analytic | pass | 0.019 | 0.019 | |
|
||||
| ladder/02-booleans/020-part-back-wall | the running part: a 60x10x15 back wall joined on the stock's top, flush with its back and ends | analytic | pass | 0.013 | 0.013 | |
|
||||
| ladder/02-booleans/019-notch-flush-with-end-face | a notch 40x20 through the height, its end flush with the stock's end face: a U | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/02-booleans/002-coplanar-overlap-join | two 60x40x20 boxes overlapping 30x20 in plan, tops and bottoms coplanar | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/02-booleans/014-cut-through-sphere-pole | a 4x4 square post cut off the top of a sphere r10 through its pole | analytic | pass | 0.025 | 0.025 | |
|
||||
| ladder/02-booleans/007-near-tangent-gap-1e-3 | a cylinder r10 along X 1e-3 mm above the top face, cut | analytic | pass | 0.033 | 0.033 | |
|
||||
| ladder/02-booleans/006-tangent-along-line-no-overlap | a cylinder r10 along X lying on the top face (tangent along a line), cut | analytic | pass | 0.036 | 0.036 | |
|
||||
| ladder/02-booleans/010-near-tangent-overlap-1e-6 | a cylinder r10 along X dipping 1e-6 mm into the top face, cut | invariants | pass | 0.037 | 0.037 | |
|
||||
| ladder/02-booleans/008-near-tangent-gap-1e-6 | a cylinder r10 along X 1e-6 mm above the top face, cut | analytic | pass | 0.037 | 0.037 | |
|
||||
| ladder/02-booleans/009-near-tangent-overlap-1e-3 | a cylinder r10 along X dipping 1e-3 mm into the top face, cut: a groove 1e-3 deep | analytic | pass | 0.041 | 0.041 | |
|
||||
| ladder/02-booleans/005-vertex-on-face-no-overlap | an inverted cone whose apex touches the middle of the top face, cut | analytic | pass | 0.045 | 0.045 | |
|
||||
| ladder/02-booleans/017-cylinder-tangent-top-and-bottom | a cylinder r10 along X tangent to both the top and bottom faces, cut: two pieces with zero-angle cusps | analytic | pass | 0.052 | 0.052 | |
|
||||
| ladder/02-booleans/018-hole-tangent-to-side-face | a through hole r10 tangent to the front face: the front face pinched to a line | analytic | pass | 0.059 | 0.059 | |
|
||||
| ladder/02-booleans/013-cut-across-cylinder-seam | a 10x4 notch through a cylinder r10 across its +X side (where the seam lies) | analytic | pass | 0.059 | 0.059 | |
|
||||
| ladder/02-booleans/012-tangent-along-circle-bowl | a blind hole r10 10 deep, then a sphere r10 centred on its floor: the floor disk vanishes exactly | analytic | pass | 0.069 | 0.069 | |
|
||||
| ladder/02-booleans/011-tangent-along-circle-through-hole | a sphere r10 sitting in a through hole r10 at the top edge (tangent along the hole's top circle), cut | analytic | pass | 0.076 | 0.076 | |
|
||||
| ladder/02-booleans/022-cylinder-grazing-a-hole-edge | a corner piece (square column minus a quarter disc r1.5, 0.0003 off the axis) cut out of a part with a blind r1.6 hole on the same axis: the tool's r1.5 face sits 0.1 mm inside the hole wall; 'no result' | analytic | pass | 0.087 | 0.087 | |
|
||||
| ladder/02-booleans/021-holes-touching-at-a-point | two through holes r5 whose circles touch at one point (30, 20) | analytic | pass | 0.131 | 0.131 | |
|
||||
| ladder/02-booleans/024-wall-halves-merged-into-a-flange | the flange top annulus of a freshly revolved hub (z = 6, r 18..30) picked by a point and extruded 5 mm (the pick found a third of the face: "the selected planar face no longer exists") | analytic | pass | 0.182 | 0.182 | |
|
||||
| ladder/02-booleans/023-lips-1e-4-off-the-walls-joined | two half-annulus lips (r 4..5, from z=2 to 20) joined onto a stadium-ring base (z 0..2, r 3..5 arcs, centres 20 apart) with their cylinder walls 0.0001 mm off the base's: the lip cap touches the base top, leaving a 0.0001 mm crescent overhang. Layout is a hand-built variant of the PR's public reproduction | analytic | pass | 0.201 | 0.201 | |
|
||||
| ladder/02-booleans/025-flush-chord-layers-joined | a join of flush layers: a disc r37 (z -1.2..0) carrying 15 of the 19 regions of a sketch of 18 chords (z -3.6..-1.2; four bands left out), on an annulus r35..37 (z -5.6..-3.6) joined to a disc of all the chord regions (z -8..-5.6): SMLib's result came back with 'loop encloses no (u, v) area' though both operands are valid | analytic | pass | 1.559 | 1.559 | |
|
||||
| ladder/03-analytic-profiles/006-revolve-partial-90 | a 10x10 rectangle 10 mm off the axis revolved 90 deg | analytic | pass | 0.010 | 0.010 | |
|
||||
| ladder/03-analytic-profiles/007-revolve-180-touching-axis | a 15x20 rectangle on the axis revolved 180 deg: a half cylinder | analytic | pass | 0.010 | 0.010 | |
|
||||
| ladder/03-analytic-profiles/008-extrude-slot | a slot (centres 40 apart, width 20) extruded 10 | analytic | pass | 0.011 | 0.011 | |
|
||||
| ladder/03-analytic-profiles/001-extrude-rect-with-arc-end | a 60x40 profile with a semicircular end r20, extruded 20 | analytic | pass | 0.015 | 0.015 | |
|
||||
| ladder/03-analytic-profiles/003-extrude-tapered-circle | a circle r10 extruded 20 with a -5 deg taper (inward): a cone frustum | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/03-analytic-profiles/002-extrude-annulus | an annulus r20/r10 extruded 15 | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/03-analytic-profiles/005-revolve-touching-axis-hemisphere | a quarter disk r20 with an edge on the Z axis revolved 360 deg: a hemisphere | analytic | pass | 0.031 | 0.031 | |
|
||||
| ladder/03-analytic-profiles/004-revolve-full-off-axis | a 10x30 rectangle 10 mm off the Z axis revolved 360 deg: a tube | analytic | pass | 0.042 | 0.042 | |
|
||||
| ladder/03-analytic-profiles/009-part-boss-and-slot | the running part: a revolved boss r8 h10 joined on the top, a slot 15x8 cut through the base | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/03-analytic-profiles/010-revolve-horn-torus-270 | the half disc of radius 14 on the far side of a diameter 14 mm from the axis (the full circle would touch the axis: a horn torus) revolved 270 degrees | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/04-spline-profiles/005-loft-square-frustum | a loft between a 40 square at z=0 and a 20 square at z=30 | analytic | pass | 0.010 | 0.010 | |
|
||||
| ladder/04-spline-profiles/001-extrude-bezier-arch | a profile closed by a cubic Bezier arch (control-point spline, 4 points), extruded 10 | analytic | pass | 0.020 | 0.020 | |
|
||||
| ladder/04-spline-profiles/008-loft-square-to-circle | a loft from a 40 square at z=0 to a circle r10 at z=30 | analytic | pass | 0.021 | 0.021 | |
|
||||
| ladder/04-spline-profiles/009-extrude-periodic-fit-spline | a closed periodic fit-point spline through 6 points, extruded 10 | analytic | pass | 0.031 | 0.031 | |
|
||||
| ladder/04-spline-profiles/006-loft-circle-frustum | a loft between circles r20 at z=0 and r10 at z=30 | analytic | pass | 0.036 | 0.036 | |
|
||||
| ladder/04-spline-profiles/007-loft-three-circles | a smooth loft through circles r20, r10, r20 at z = 0, 20, 40 | analytic | pass | 0.037 | 0.037 | |
|
||||
| ladder/04-spline-profiles/004-sweep-square-along-bezier | a 4x4 square swept along the same Bezier path | analytic | pass | 0.039 | 0.039 | |
|
||||
| ladder/04-spline-profiles/002-revolve-bezier-profile | a profile with a Bezier side (r from 20 to 15 over z 0..30) revolved 360 deg about Z | analytic | pass | 0.069 | 0.069 | |
|
||||
| ladder/04-spline-profiles/010-part-bezier-window | the running part: a Bezier-arched window cut through the back wall | analytic | pass | 0.099 | 0.099 | |
|
||||
| ladder/04-spline-profiles/003-pipe-along-bezier | a pipe d4 along a planar Bezier path | analytic | pass | 0.110 | 0.110 | |
|
||||
| ladder/04-spline-profiles/012-loft-ribs-joined-to-a-rounded-pad | the same without the top flange: the join fails with 'boolean Union: no result' | analytic | pass | 0.463 | 0.463 | |
|
||||
| ladder/04-spline-profiles/011-crossing-pleated-loft-skins-joined | a join of two pleated skins (lofts between 24-pleat star outlines, less the same loft moved in 1.1 mm) that cross along a ring near their bottoms: truck panicked ('tolerance must be no less than 1e-6') or gave no result | analytic | pass | 1.323 | 1.323 | |
|
||||
| ladder/05-holes-and-taps/001-simple-through | a d10 through hole in the stock's top | analytic | pass | 0.023 | 0.023 | |
|
||||
| ladder/05-holes-and-taps/010-hole-tangent-to-end-face | a d10 through hole tangent to the end face x=0 | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/05-holes-and-taps/006-tapped-m6-through | an M6 tapped hole through: the tap drill d5 (major - pitch), cosmetic thread | analytic | pass | 0.026 | 0.026 | |
|
||||
| ladder/05-holes-and-taps/017-tapped-1-4-npt-through | a 1/4-18 NPT tapped hole through the stock (ASME B1.20.1): a straight hole at the tap maker's 10.85 mm, cosmetic thread | analytic | pass | 0.028 | 0.028 | |
|
||||
| ladder/05-holes-and-taps/016-tapped-rc-1-2-through | an Rc 1/2 tapped hole through the stock (ISO 7-1 internal taper): a straight hole at the tap maker's 17.6 mm, cosmetic thread | analytic | pass | 0.028 | 0.028 | |
|
||||
| ladder/05-holes-and-taps/002-simple-blind-flat | a d10 blind hole 10 deep, flat bottom | analytic | pass | 0.029 | 0.029 | |
|
||||
| ladder/05-holes-and-taps/003-drilled-blind-118 | a d10 drilled hole 10 deep to the shoulder with a 118 deg point | analytic | pass | 0.030 | 0.030 | |
|
||||
| ladder/05-holes-and-taps/007-tapped-m8-blind | an M8 tapped blind hole 12 deep with a 118 deg drill point | analytic | pass | 0.032 | 0.032 | |
|
||||
| ladder/05-holes-and-taps/015-tapped-1-4-28-unf-blind | a 1/4-28 UNF tapped blind hole 10 deep, flat bottom: drilled 5.45 mm, cosmetic thread | analytic | pass | 0.034 | 0.034 | |
|
||||
| ladder/05-holes-and-taps/009-hole-0.5-from-edge | a d10 through hole whose wall is 0.5 mm from the end face | analytic | pass | 0.036 | 0.036 | |
|
||||
| ladder/05-holes-and-taps/014-tapped-1-4-20-unc-through | a 1/4-20 UNC tapped hole through the stock: drilled #7 (0.201 in), cosmetic thread | analytic | pass | 0.041 | 0.041 | |
|
||||
| ladder/05-holes-and-taps/004-counterbore | a counterbored hole: d6.6 through, d11 x 6.4 counterbore | analytic | pass | 0.049 | 0.049 | |
|
||||
| ladder/05-holes-and-taps/005-countersink | a countersunk hole: d6.6 through, d12 x 90 deg countersink | analytic | pass | 0.059 | 0.059 | |
|
||||
| ladder/05-holes-and-taps/011-crossing-holes-steinmetz | two d10 through holes whose axes cross: vertical and along Y at z=10 | analytic | pass | 0.078 | 0.078 | |
|
||||
| ladder/05-holes-and-taps/012-crossing-tapped-holes-offset | two M6 tapped holes (d5) crossing with axes 2 mm apart | analytic | pass | 0.127 | 0.127 | |
|
||||
| ladder/05-holes-and-taps/008-tapped-m5-into-curved-face | an M5 tapped hole drilled radially through a cylinder r20 lying along X | analytic | pass | 0.134 | 0.134 | |
|
||||
| ladder/05-holes-and-taps/013-part-holes | the running part: an M6 tapped through hole, an M5 tapped blind hole in the boss, a d3.3 hole down through wall and base | analytic | pass | 0.256 | 0.256 | |
|
||||
| ladder/06-threads/030-square-thread-refused | a square thread on a d10 x 30 cylinder: refused, no current standard defines one | invariants | pass | 0.018 | 0.018 | |
|
||||
| ladder/06-threads/012-external-acme-3-4-6 | a modelled 3/4-6 ACME thread (ASME B1.5, general purpose) on a 3/4 in shaft, six turns | analytic | pass | 0.634 | 0.634 | |
|
||||
| ladder/06-threads/011-external-tr20x4 | a modelled trapezoidal Tr20x4 thread (ISO 2904) on a d20 shaft, six turns | analytic | pass | 0.648 | 0.648 | |
|
||||
| ladder/06-threads/029-external-tr20x4-chamfer-needs-depth | 011's Tr20x4 thread with a chamfered tip and no depth: refused, ISO 4753 is for metric threads | invariants | pass | 0.657 | 0.657 | |
|
||||
| ladder/06-threads/013-external-s20x4 | a modelled metric buttress S20x4 thread (DIN 513, 3/30 deg) on a d20 shaft, six turns | analytic | pass | 0.665 | 0.665 | |
|
||||
| ladder/06-threads/021-internal-rp-1-2 | a modelled Rp 1/2 parallel internal pipe thread (ISO 7-1) in a d18.631 (its minor) bore through a 40x40 block six turns thick | analytic | pass | 0.685 | 0.685 | |
|
||||
| ladder/06-threads/020-external-g-1-2 | a modelled G 1/2 parallel pipe thread (ISO 228-1, 55 deg) on a d20.955 shaft, six turns | analytic | pass | 0.695 | 0.695 | |
|
||||
| ladder/06-threads/015-internal-tr20x4-nut | a modelled internal Tr20x4 thread in a d16 (D1 = d - P) bore through a 40x40x24 block | analytic | pass | 0.695 | 0.695 | |
|
||||
| ladder/06-threads/014-external-buttress-asme-1.5-8 | a modelled 1.5-8 buttress thread (ASME B1.9 basic profile, 7/45 deg) on a 1.5 in shaft, six turns | analytic | pass | 0.716 | 0.716 | |
|
||||
| ladder/06-threads/026-external-s20x4-steep-flank-start-to-shoulder | a modelled S20x4 buttress thread on a d20 shaft down to a d30 shoulder, the steep flank toward the thread's start (down): the 30 deg wall faces the shoulder | analytic | pass | 0.746 | 0.746 | |
|
||||
| ladder/06-threads/010-part-threaded-boss | the running part with a modelled M16 thread on its d16 boss | analytic | pass | 0.774 | 0.774 | |
|
||||
| ladder/06-threads/025-external-s20x4-steep-flank-end-to-shoulder | a modelled S20x4 buttress thread on a d20 shaft down to a d30 shoulder, the steep flank toward the thread's end (up, the default): the 3 deg wall faces the shoulder | analytic | pass | 0.776 | 0.776 | |
|
||||
| ladder/06-threads/003-external-m10-partial-length | a modelled M10 thread over 15 of the 30 mm from the top end (`from`): it stops square in the middle of the face | analytic | pass | 0.855 | 0.855 | |
|
||||
| ladder/06-threads/005-internal-m10-through | a modelled internal M10 thread in a d8.5 (tap drill) hole through a 30x30x20 block | analytic | pass | 1.161 | 1.161 | |
|
||||
| ladder/06-threads/019-external-tr40x14-p7-two-start | a modelled two-start trapezoidal Tr40x14(P7) thread (ISO 2904, ISO 2903) on a d40 shaft, three leads long | analytic | pass | 1.196 | 1.196 | |
|
||||
| ladder/06-threads/028-external-tr20x4-chamfer-30-deg-2.5-deep | 011's modelled Tr20x4 thread with chamfered ends at its own angle and depth: 30 deg to the axis, 2.5 mm in from the major diameter | analytic | pass | 1.311 | 1.311 | |
|
||||
| ladder/06-threads/022-external-r-1-2-taper | a modelled R 1/2 taper pipe thread (ISO 7-1, 55 deg, 1 in 16) on a 21.3 mm pipe (ISO 65), its standard 13.2 mm from the pipe's end | analytic | pass | 1.344 | 1.344 | |
|
||||
| ladder/06-threads/024-internal-rc-1-2-taper | a modelled Rc 1/2 internal taper pipe thread (ISO 7-1) in a d17.6 hole (the tap maker's) through a 13.2 mm plate, from its top face | analytic | pass | 1.383 | 1.383 | |
|
||||
| ladder/06-threads/004-external-m10-to-shoulder | a modelled M10 thread on a d10 shaft running down to a d16 shoulder: it stops clear of it, the collar whole | analytic | pass | 1.403 | 1.403 | |
|
||||
| ladder/06-threads/007-external-m10-at-filleted-shoulder | a modelled M10 thread on a d10 shaft whose root at the d16 shoulder has an r1 fillet: it stops clear of the fillet | analytic | pass | 1.437 | 1.437 | |
|
||||
| ladder/06-threads/009-thread-runout-length | 004's M10 thread run from the free top end, vanishing over a 3 mm (2 P) runout before the d16 shoulder | analytic | pass | 1.439 | 1.439 | |
|
||||
| ladder/06-threads/023-external-1-2-npt | a modelled 1/2-14 NPT taper pipe thread (ASME B1.20.1, 60 deg, 1 in 16) on its 0.840 in pipe, its effective thread L2 from the end | analytic | **FAIL**: volume_mm3 8227.346353 (want 8226.404942) | 1.619 | 1.619 | |
|
||||
| ladder/06-threads/016-external-m10-left-hand | 001's modelled M10 thread, left-handed: the same volume, turning the other way | analytic | pass | 1.626 | 1.626 | |
|
||||
| ladder/06-threads/001-external-m10-full | a modelled M10 thread over the whole of a d10 x 30 cylinder | analytic | pass | 1.690 | 1.690 | |
|
||||
| ladder/06-threads/006-external-m10-into-chamfer | a d10 x 30 cylinder with a 1 mm chamfer on top, then a modelled M10 thread over its cylinder face, running out through the chamfer | analytic | pass | 1.713 | 1.713 | |
|
||||
| ladder/06-threads/027-external-m10-chamfered-start | 001's modelled M10 thread with ISO 4753's chamfered end at the end it starts from only (`tip: start`, from the top) | analytic | pass | 2.526 | 2.526 | |
|
||||
| ladder/06-threads/002-external-m10x1-fine | a modelled fine M10x1 thread over a d10 x 30 cylinder | analytic | pass | 2.534 | 2.534 | |
|
||||
| ladder/06-threads/008-multi-start-thread | a two-start M10 thread (lead 3, pitch 1.5) over a d10 x 30 cylinder | analytic | pass | 3.074 | 3.074 | |
|
||||
| ladder/06-threads/017-external-m10-chamfered-tip | 001's modelled M10 thread with ISO 4753's chamfered end at both free ends: a 45 deg cone down to the external minor diameter d3, cut after the groove | analytic | pass | 3.340 | 3.340 | |
|
||||
| ladder/06-threads/018-external-m10-both-hands | 001's modelled M10 thread cut both ways: a right- and a left-handed groove crossing on a d10 x 30 cylinder | analytic | pass | 6.515 | 6.515 | |
|
||||
| ladder/07-fillets/001-single-edge-r5 | an r5 round on the stock's top front edge | analytic | pass | 0.008 | 0.008 | |
|
||||
| ladder/07-fillets/007-variable-r5-to-1e-3 | a variable round on the top front edge, r5 down to 1e-3 mm | analytic | pass | 0.009 | 0.009 | |
|
||||
| ladder/07-fillets/011-chain-ending-at-corner | r5 rounds on two top edges meeting at a corner whose vertical edge stays sharp | analytic | pass | 0.011 | 0.011 | |
|
||||
| ladder/07-fillets/002-four-vertical-edges-r5 | r5 rounds on the four vertical edges | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/07-fillets/006-variable-r5-to-zero | a variable round on the top front edge, r5 at x=0 down to 0 at the x=60 vertex | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/07-fillets/008-constant-r1e-3 | a constant 1e-3 mm round on the top front edge | analytic | pass | 0.019 | 0.019 | |
|
||||
| ladder/07-fillets/005-variable-r5-to-r1 | a variable round on the top front edge, r5 at x=0 to r1 at x=60 | analytic | pass | 0.020 | 0.020 | |
|
||||
| ladder/07-fillets/004-convex-and-concave-r5 | an L block: r5 on its inner (concave) vertical edge and on an outer (convex) one | analytic | pass | 0.021 | 0.021 | |
|
||||
| ladder/07-fillets/009-corner-three-equal-r5 | r5 rounds on the three edges meeting at the corner (60,40,20): a sphere corner | analytic | pass | 0.023 | 0.023 | |
|
||||
| ladder/07-fillets/008-constant-r1e-3 | a constant 1e-3 mm round on the top front edge | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/07-fillets/002-four-vertical-edges-r5 | r5 rounds on the four vertical edges | analytic | pass | 0.027 | 0.027 | |
|
||||
| ladder/07-fillets/010-corner-unequal-r7-r3 | an r7 vertical round at a corner, then r3 along a top edge, which runs on round the r7 arc to the other top edge | analytic | pass | 0.037 | 0.037 | |
|
||||
| ladder/07-fillets/016-corner-three-sequential-r5-r3-r7 | rounds r5 and r3 on the two top edges at a corner, then r7 on the vertical edge under them: refused, the r7 cannot exist | invariants | pass | 0.046 | 0.046 | |
|
||||
| ladder/07-fillets/012-variable-into-rounded-corner | a vertical r5 round, then a variable round r1 -> r5 along the top back edge into it | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/07-fillets/014-curved-edge-r2 | an r2 round on the top edge of a cylinder r10 h20 | analytic | pass | 0.078 | 0.078 | |
|
||||
| ladder/07-fillets/018-corner-three-sequential-r5-r3-r2 | rounds r5 and r3 on the two top edges at a corner, then r2 on the vertical edge under them, run on up into the corner | invariants | pass | 0.080 | 0.080 | |
|
||||
| ladder/07-fillets/003-tangent-chain-r3 | an r3 round all round the top of the box with r5 vertical rounds: a tangent chain of lines and arcs | analytic | pass | 0.080 | 0.080 | |
|
||||
| ladder/07-fillets/013-corner-setback | three r5 rounds at the corner (60,40,20) with setbacks of 8 mm along each edge | invariants | pass | 0.117 | 0.117 | |
|
||||
| ladder/07-fillets/017-part-rounds | the running part: r5 on the front vertical edges, r3 on the back wall's top front edge, r1 where the boss meets the top | analytic | pass | 0.690 | 0.690 | |
|
||||
| ladder/08-chamfers/005-corner-two-mitred-3 | 3 mm chamfers on two top edges meeting at a corner (mitred) | analytic | pass | 0.008 | 0.008 | |
|
||||
| ladder/08-chamfers/004-corner-three-equal-3 | 3 mm chamfers on the three edges meeting at a corner | analytic | pass | 0.009 | 0.009 | |
|
||||
| ladder/08-chamfers/003-distance-angle-5-30 | a chamfer 5 mm at 30 deg on the top front edge | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/07-fillets/010-corner-unequal-r7-r3 | an r7 vertical round at a corner, then r3 along a top edge, which runs on round the r7 arc to the other top edge | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/07-fillets/004-convex-and-concave-r5 | an L block: r5 on its inner (concave) vertical edge and on an outer (convex) one | analytic | pass | 0.025 | 0.025 | |
|
||||
| ladder/07-fillets/009-corner-three-equal-r5 | r5 rounds on the three edges meeting at the corner (60,40,20): a sphere corner | analytic | pass | 0.032 | 0.032 | |
|
||||
| ladder/07-fillets/014-curved-edge-r2 | an r2 round on the top edge of a cylinder r10 h20 | analytic | pass | 0.048 | 0.048 | |
|
||||
| ladder/07-fillets/012-variable-into-rounded-corner | a vertical r5 round, then a variable round r1 -> r5 along the top back edge into it | analytic | pass | 0.051 | 0.051 | |
|
||||
| ladder/07-fillets/016-corner-three-sequential-r5-r3-r7 | rounds r5 and r3 on the two top edges at a corner, then r7 on the vertical edge under them: refused, the r7 cannot exist | invariants | pass | 0.053 | 0.053 | |
|
||||
| ladder/07-fillets/018-corner-three-sequential-r5-r3-r2 | rounds r5 and r3 on the two top edges at a corner, then r2 on the vertical edge under them, run on up into the corner | invariants | pass | 0.061 | 0.061 | |
|
||||
| ladder/07-fillets/013-corner-setback | three r5 rounds at the corner (60,40,20) with setbacks of 8 mm along each edge | invariants | pass | 0.062 | 0.062 | |
|
||||
| ladder/07-fillets/003-tangent-chain-r3 | an r3 round all round the top of the box with r5 vertical rounds: a tangent chain of lines and arcs | analytic | pass | 0.075 | 0.075 | |
|
||||
| ladder/07-fillets/017-part-rounds | the running part: r5 on the front vertical edges, r3 on the back wall's top front edge, r1 where the boss meets the top | analytic | pass | 0.480 | 0.480 | |
|
||||
| ladder/07-fillets/019-concave-corner-g2-patch | three concave r5 rounds at the inner corner of a 20x20x10 notch, with the g2 corner patch | invariants | pass | 2.084 | 2.084 | |
|
||||
| ladder/07-fillets/015-corner-g2-patch | three r5 rounds at a corner with the g2 corner patch | invariants | pass | 2.173 | 2.173 | |
|
||||
| ladder/08-chamfers/001-equal-5 | a 5 mm chamfer on the top front edge | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/08-chamfers/002-two-distances-5-3 | a 5 x 3 chamfer on the top front edge | analytic | pass | 0.024 | 0.024 | |
|
||||
| ladder/08-chamfers/007-chamfer-then-fillets | a 3 mm chamfer on the top front edge, then r2 rounds on the front vertical edges that meet it | analytic | pass | 0.029 | 0.029 | |
|
||||
| ladder/08-chamfers/006-curved-edge-2 | a 2 mm chamfer on the top edge of a cylinder r10 h20 | analytic | pass | 0.070 | 0.070 | |
|
||||
| ladder/08-chamfers/008-part-chamfers | the running part: 1 mm on the boss top edge, 2 mm on the back wall's top back edge | analytic | pass | 0.749 | 0.749 | |
|
||||
| ladder/09-shells-and-offsets/007-offset-top-face-5 | the stock's top face offset 5 mm | analytic | pass | 0.016 | 0.016 | |
|
||||
| ladder/09-shells-and-offsets/001-box-open-top-t2 | the stock shelled 2 mm, open at the top | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/08-chamfers/003-distance-angle-5-30 | a chamfer 5 mm at 30 deg on the top front edge | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/08-chamfers/002-two-distances-5-3 | a 5 x 3 chamfer on the top front edge | analytic | pass | 0.012 | 0.012 | |
|
||||
| ladder/08-chamfers/005-corner-two-mitred-3 | 3 mm chamfers on two top edges meeting at a corner (mitred) | analytic | pass | 0.015 | 0.015 | |
|
||||
| ladder/08-chamfers/004-corner-three-equal-3 | 3 mm chamfers on the three edges meeting at a corner | analytic | pass | 0.018 | 0.018 | |
|
||||
| ladder/08-chamfers/007-chamfer-then-fillets | a 3 mm chamfer on the top front edge, then r2 rounds on the front vertical edges that meet it | analytic | pass | 0.031 | 0.031 | |
|
||||
| ladder/08-chamfers/006-curved-edge-2 | a 2 mm chamfer on the top edge of a cylinder r10 h20 | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/08-chamfers/008-part-chamfers | the running part: 1 mm on the boss top edge, 2 mm on the back wall's top back edge | analytic | pass | 0.681 | 0.681 | |
|
||||
| ladder/09-shells-and-offsets/001-box-open-top-t2 | the stock shelled 2 mm, open at the top | analytic | pass | 0.009 | 0.009 | |
|
||||
| ladder/09-shells-and-offsets/003-tube-two-open-faces | the stock shelled 2 mm, open top and bottom | analytic | pass | 0.009 | 0.009 | |
|
||||
| ladder/09-shells-and-offsets/007-offset-top-face-5 | the stock's top face offset 5 mm | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/09-shells-and-offsets/004-thin-wall-0.2 | the stock shelled 0.2 mm, open at the top | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/09-shells-and-offsets/003-tube-two-open-faces | the stock shelled 2 mm, open top and bottom | analytic | pass | 0.018 | 0.018 | |
|
||||
| ladder/09-shells-and-offsets/012-closed-shell-sealed-void | the stock shelled 2 mm with no face open: a closed body with a sealed void | analytic | pass | 0.018 | 0.018 | |
|
||||
| ladder/09-shells-and-offsets/009-shell-outside-t2 | the stock shelled 2 mm outward, open at the top | analytic | pass | 0.038 | 0.038 | |
|
||||
| ladder/09-shells-and-offsets/006-shell-rounds-r1-thinner-than-t2 | the box with r1 vertical rounds shelled 2 mm: the inner corners close sharp | analytic | pass | 0.060 | 0.060 | |
|
||||
| ladder/09-shells-and-offsets/008-offset-cylinder-wall-2 | a cylinder r10 h20 with its side face offset 2 mm | analytic | pass | 0.075 | 0.075 | |
|
||||
| ladder/09-shells-and-offsets/002-cylinder-open-top-t1 | a cylinder r10 h30 shelled 1 mm, open at the top | analytic | pass | 0.102 | 0.102 | |
|
||||
| ladder/09-shells-and-offsets/010-shell-under-rounded-top | the stock with r3 rounds on its four top edges, shelled 2 mm open at the bottom | analytic | pass | 0.105 | 0.105 | |
|
||||
| ladder/09-shells-and-offsets/014-drafted-box-with-rounds-shelled | a 120x80x40 box drafted 5 degrees with 4 mm rounds on the sloping corners, shelled 2 mm open at the top: the inner rounds' edges must lie on their faces (#3573 reports the same design) | analytic | pass | 0.124 | 0.124 | |
|
||||
| ladder/09-shells-and-offsets/005-shell-rounds-r5-t2 | the box with r5 vertical rounds shelled 2 mm open at the top: the inner corners r3 | analytic | pass | 0.174 | 0.174 | |
|
||||
| ladder/09-shells-and-offsets/013-dome-shelled-from-base | a dome r20 shelled 2 mm, open at its flat base: the rim is the circle r18 where the inner sphere meets the base plane | analytic | pass | 0.236 | 0.236 | |
|
||||
| ladder/09-shells-and-offsets/015-shelled-dome-ring-joined-back | a dome (a quarter disc r20 revolved) shelled 2 mm from its flat base, then the base ring (r 18..20) face-extruded 10 mm back into the dome as a join: ~120 s, then 'boolean Union: no result' | analytic | pass | 0.922 | 0.922 | |
|
||||
| ladder/09-shells-and-offsets/011-part-shell | the running part shelled 1.5 mm open at the bottom | analytic | pass | 1.078 | 1.078 | |
|
||||
| ladder/10-patterns-and-mirrors/007-pattern-bodies | a pin r3 h10 patterned 4 times at 10 mm as bodies | analytic | pass | 0.031 | 0.031 | |
|
||||
| ladder/10-patterns-and-mirrors/004-mirror-body-joined | a 30x40x20 half with a d10 hole mirrored about x=30 and joined: the faces at x=30 coincide | analytic | pass | 0.067 | 0.067 | |
|
||||
| ladder/09-shells-and-offsets/012-closed-shell-sealed-void | the stock shelled 2 mm with no face open: a closed body with a sealed void | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/09-shells-and-offsets/009-shell-outside-t2 | the stock shelled 2 mm outward, open at the top | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/09-shells-and-offsets/006-shell-rounds-r1-thinner-than-t2 | the box with r1 vertical rounds shelled 2 mm: the inner corners close sharp | analytic | pass | 0.040 | 0.040 | |
|
||||
| ladder/09-shells-and-offsets/008-offset-cylinder-wall-2 | a cylinder r10 h20 with its side face offset 2 mm | analytic | pass | 0.057 | 0.057 | |
|
||||
| ladder/09-shells-and-offsets/005-shell-rounds-r5-t2 | the box with r5 vertical rounds shelled 2 mm open at the top: the inner corners r3 | analytic | pass | 0.071 | 0.071 | |
|
||||
| ladder/09-shells-and-offsets/002-cylinder-open-top-t1 | a cylinder r10 h30 shelled 1 mm, open at the top | analytic | pass | 0.077 | 0.077 | |
|
||||
| ladder/09-shells-and-offsets/014-drafted-box-with-rounds-shelled | a 120x80x40 box drafted 5 degrees with 4 mm rounds on the sloping corners, shelled 2 mm open at the top: the inner rounds' edges must lie on their faces (#3573 reports the same design) | analytic | pass | 0.077 | 0.077 | |
|
||||
| ladder/09-shells-and-offsets/010-shell-under-rounded-top | the stock with r3 rounds on its four top edges, shelled 2 mm open at the bottom | analytic | pass | 0.079 | 0.079 | |
|
||||
| ladder/09-shells-and-offsets/013-dome-shelled-from-base | a dome r20 shelled 2 mm, open at its flat base: the rim is the circle r18 where the inner sphere meets the base plane | analytic | pass | 0.112 | 0.112 | |
|
||||
| ladder/09-shells-and-offsets/015-shelled-dome-ring-joined-back | a dome (a quarter disc r20 revolved) shelled 2 mm from its flat base, then the base ring (r 18..20) face-extruded 10 mm back into the dome as a join: ~120 s, then 'boolean Union: no result' | analytic | pass | 0.696 | 0.696 | |
|
||||
| ladder/09-shells-and-offsets/011-part-shell | the running part shelled 1.5 mm open at the bottom | analytic | pass | 0.965 | 0.965 | |
|
||||
| ladder/10-patterns-and-mirrors/007-pattern-bodies | a pin r3 h10 patterned 4 times at 10 mm as bodies | analytic | pass | 0.035 | 0.035 | |
|
||||
| ladder/10-patterns-and-mirrors/004-mirror-body-joined | a 30x40x20 half with a d10 hole mirrored about x=30 and joined: the faces at x=30 coincide | analytic | pass | 0.047 | 0.047 | |
|
||||
| ladder/10-patterns-and-mirrors/005-mirror-feature | a d10 hole in the stock mirrored about x=30 as a feature | analytic | pass | 0.074 | 0.074 | |
|
||||
| ladder/10-patterns-and-mirrors/001-rect-pattern-holes | a d5 hole patterned 3 x 2 at 20 mm in a 60x40x10 plate | analytic | pass | 0.175 | 0.175 | |
|
||||
| ladder/10-patterns-and-mirrors/003-overlapping-pattern-leaves-core | six r5 cuts patterned round a circle r6 in a disk r20: they overlap and cut a core free | analytic | pass | 0.315 | 0.315 | |
|
||||
| ladder/10-patterns-and-mirrors/002-circular-pattern-holes | a d6 hole patterned 8 times round a disk r30 h10 | analytic | pass | 0.351 | 0.351 | |
|
||||
| ladder/10-patterns-and-mirrors/006-circular-pattern-counterbores | a counterbored hole (d5, d9 x 3) patterned 6 times round a disk r30 h10 | analytic | pass | 0.855 | 0.855 | |
|
||||
| ladder/10-patterns-and-mirrors/008-part-vents | the running part with a d3 vent hole in its top patterned 4 times at 5 mm | analytic | pass | 1.765 | 1.765 | |
|
||||
| ladder/11-cumulative-parts/001-bracket | an L bracket: concave r5 round, 5 mm outer chamfer, a hole in each leg | analytic | pass | 0.088 | 0.088 | |
|
||||
| ladder/11-cumulative-parts/002-flange | a revolved flange and hub with a bore, six bolt holes, a hub chamfer and a hub-root round | analytic | pass | 0.618 | 0.618 | |
|
||||
| ladder/11-cumulative-parts/003-threaded-flange | the flange with a modelled M30 thread on its hub, between the round and the chamfer, and M8 tapped holes in the disk | analytic | pass | 1.821 | 1.821 | |
|
||||
| ladder/11-cumulative-parts/004-housing | the running part with every tier: back wall, boss, slot, spline window, tapped holes, rounds, chamfers, shell, vents, and a modelled M16 thread on the boss | analytic | pass | 2.307 | 2.307 | |
|
||||
| ladder/10-patterns-and-mirrors/001-rect-pattern-holes | a d5 hole patterned 3 x 2 at 20 mm in a 60x40x10 plate | analytic | pass | 0.239 | 0.239 | |
|
||||
| ladder/10-patterns-and-mirrors/003-overlapping-pattern-leaves-core | six r5 cuts patterned round a circle r6 in a disk r20: they overlap and cut a core free | analytic | pass | 0.299 | 0.299 | |
|
||||
| ladder/10-patterns-and-mirrors/002-circular-pattern-holes | a d6 hole patterned 8 times round a disk r30 h10 | analytic | pass | 0.484 | 0.484 | |
|
||||
| ladder/10-patterns-and-mirrors/006-circular-pattern-counterbores | a counterbored hole (d5, d9 x 3) patterned 6 times round a disk r30 h10 | analytic | pass | 0.758 | 0.758 | |
|
||||
| ladder/10-patterns-and-mirrors/008-part-vents | the running part with a d3 vent hole in its top patterned 4 times at 5 mm | analytic | pass | 1.590 | 1.590 | |
|
||||
| ladder/11-cumulative-parts/001-bracket | an L bracket: concave r5 round, 5 mm outer chamfer, a hole in each leg | analytic | pass | 0.089 | 0.089 | |
|
||||
| ladder/11-cumulative-parts/002-flange | a revolved flange and hub with a bore, six bolt holes, a hub chamfer and a hub-root round | analytic | pass | 0.673 | 0.673 | |
|
||||
| ladder/11-cumulative-parts/003-threaded-flange | the flange with a modelled M30 thread on its hub, between the round and the chamfer, and M8 tapped holes in the disk | analytic | pass | 2.166 | 2.166 | |
|
||||
| ladder/11-cumulative-parts/004-housing | the running part with every tier: back wall, boss, slot, spline window, tapped holes, rounds, chamfers, shell, vents, and a modelled M16 thread on the boss | analytic | pass | 2.313 | 2.313 | |
|
||||
| ladder/12-sheet-metal/001-base-flange | a 100 x 60 base flange, 2 mm sheet | analytic | pass | 0.002 | 0.002 | |
|
||||
| ladder/12-sheet-metal/002-edge-flange-90 | a 20 mm 90 deg edge flange along the base's front edge | analytic | pass | 0.005 | 0.005 | |
|
||||
| ladder/12-sheet-metal/010-fold-90 | 001's base folded 90 deg up along a sketch line across it at x = 70 | analytic | pass | 0.005 | 0.005 | |
|
||||
| ladder/12-sheet-metal/009-hem-on-the-back-edge | 002's L with an 8 mm hem on the base's back edge, folded under it with a 1 mm inner radius | analytic | pass | 0.006 | 0.006 | |
|
||||
| ladder/12-sheet-metal/012-fold-refolded | 011's flat refolded: 010's part again | analytic | pass | 0.008 | 0.008 | |
|
||||
| ladder/12-sheet-metal/007-corner-relief-rectangular | 003's tray with a rectangular corner relief 4 mm across at each corner | analytic | pass | 0.008 | 0.008 | |
|
||||
| ladder/12-sheet-metal/011-fold-unfolded | 010's fold unfolded: the flat 100 x 60 plate again | analytic | pass | 0.010 | 0.010 | |
|
||||
| ladder/12-sheet-metal/004-four-flanges-72-leaning-out | 20 mm flanges at 72 deg on all four edges, made together and closed at the corners, leaning out: the panel ends run on along a slant | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/12-sheet-metal/003-four-flanges-90-closed-corners | 20 mm 90 deg flanges on all four edges, made together: the corners close with the rule's gap, notch relief | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/12-sheet-metal/005-four-flanges-108-leaning-in | 20 mm flanges at 108 deg on all four edges, made together and closed at the corners, leaning in over the base: the panel ends are cut back along a slant where they would overlap | analytic | pass | 0.014 | 0.014 | |
|
||||
| ladder/12-sheet-metal/006-corner-relief-round | 003's tray with a round corner relief 4 mm across at each corner | analytic | pass | 0.017 | 0.017 | |
|
||||
| ladder/12-sheet-metal/013-flat-pattern | the flat pattern of 003's tray: its outline's size and area, and its four bend lines | analytic | pass | 0.032 | 0.032 | |
|
||||
| ladder/12-sheet-metal/008-corner-relief-tear | 003's tray with torn corners: the bends run to the corner and each end is cut straight, in the flat, to where its panel's end starts | analytic | pass | 0.071 | 0.071 | |
|
||||
| ladder/12-sheet-metal/014-bracket | a bracket: a 30 mm flange on the front edge, a 10 mm lip turned out on its far edge, a d10 hole through the base | analytic | pass | 0.092 | 0.092 | |
|
||||
@@ -0,0 +1,142 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Select the kernel rig areas a pull request affects (.github/workflows/kernel-rig.yml).
|
||||
|
||||
Usage: kernel_rig_plan.py (--all | --paths FILE) [--root DIR] [--github-output FILE]
|
||||
|
||||
FILE holds the changed paths relative to the repository root, separated by NUL (git diff -z);
|
||||
"-" reads standard input. --all selects every area (pushes, merge groups, the release gate, a run
|
||||
by hand). --root is the repository (default: two folders up from this script).
|
||||
|
||||
The areas are the folders of tests/kernel-cases/ (the ladder aside), so a new area joins by
|
||||
having a folder with its cases, its KNOWN_FAILING and its PATHS. A changed path selects:
|
||||
- every area, when it matches tests/kernel-cases/PATHS-ALL (the shared core: SMLib, geom, the
|
||||
kernel's core, the rig's grader and runner, the workflow);
|
||||
- an area, when it is under tests/kernel-cases/<area>/ or matches that area's PATHS: one git
|
||||
pathspec glob a line (`*` within a folder, `**` across folders), `#` starts a comment.
|
||||
The ladder spans every operation: it runs whenever any area does, and on a change under
|
||||
tests/kernel-cases/ladder/.
|
||||
|
||||
The coverage check (`cargo xtask kernel-cases --coverage`) runs in the build job. The build runs
|
||||
when a shard does, or when the command registry or the cases may have changed (COVERAGE below),
|
||||
so a new command without a case fails on its own pull request.
|
||||
|
||||
Prints and optionally appends to $GITHUB_OUTPUT:
|
||||
shards=["booleans", ..., "ladder"] the shard matrix, JSON (empty list: no shard runs)
|
||||
build=true|false the build job (and the coverage check) runs
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
CASES = "tests/kernel-cases"
|
||||
LADDER = "ladder"
|
||||
# Changes here may add or remove a registry command, or the case that covers one: the coverage
|
||||
# check must see them even when no area runs.
|
||||
COVERAGE = (
|
||||
"crates/engine/src/cmd/**",
|
||||
"tests/kernel-cases/EXEMPT",
|
||||
"tests/kernel-cases/**/recipe.json",
|
||||
"xtask/src/kernel_cases.rs",
|
||||
)
|
||||
|
||||
|
||||
def glob_regex(glob):
|
||||
"""A git pathspec glob (`:(glob)` magic) as a regular expression over a whole path: `**/`
|
||||
matches any folders (none too), a trailing `/**` everything below, `*` and `?` stay within
|
||||
one folder."""
|
||||
out, i = [], 0
|
||||
while i < len(glob):
|
||||
if glob.startswith("**/", i):
|
||||
out.append("(?:.*/)?")
|
||||
i += 3
|
||||
elif glob.startswith("**", i):
|
||||
out.append(".*")
|
||||
i += 2
|
||||
elif glob[i] == "*":
|
||||
out.append("[^/]*")
|
||||
i += 1
|
||||
elif glob[i] == "?":
|
||||
out.append("[^/]")
|
||||
i += 1
|
||||
else:
|
||||
out.append(re.escape(glob[i]))
|
||||
i += 1
|
||||
return re.compile("".join(out) + r"\Z")
|
||||
|
||||
|
||||
def read_globs(path):
|
||||
"""The globs of a PATHS file: one a line, blank lines and `#` comments skipped."""
|
||||
with open(path, encoding="utf-8") as f:
|
||||
lines = [line.strip() for line in f]
|
||||
globs = [line for line in lines if line and not line.startswith("#")]
|
||||
for g in globs:
|
||||
if g.startswith("/") or g.startswith(":") or "\\" in g:
|
||||
raise SystemExit(f"{path}: `{g}`: a glob is relative to the repository root, with / and no pathspec magic")
|
||||
return globs
|
||||
|
||||
|
||||
def areas(root):
|
||||
"""Every area (a folder of tests/kernel-cases/ but the ladder) with its PATHS globs."""
|
||||
base = os.path.join(root, CASES)
|
||||
out = {}
|
||||
for name in sorted(os.listdir(base)):
|
||||
if name == LADDER or not os.path.isdir(os.path.join(base, name)):
|
||||
continue
|
||||
paths = os.path.join(base, name, "PATHS")
|
||||
if not os.path.isfile(paths):
|
||||
raise SystemExit(f"{CASES}/{name}/PATHS is missing: every area lists the source files whose change reruns it")
|
||||
out[name] = read_globs(paths)
|
||||
return out
|
||||
|
||||
|
||||
def matches(globs, path):
|
||||
return any(glob_regex(g).match(path) for g in globs)
|
||||
|
||||
|
||||
def select(root, paths, everything=False):
|
||||
"""Return (shards, build): the areas to run, in order and the ladder last, and whether the
|
||||
build job runs."""
|
||||
by_area = areas(root)
|
||||
if everything:
|
||||
return [*by_area, LADDER], True
|
||||
shared = read_globs(os.path.join(root, CASES, "PATHS-ALL"))
|
||||
hit, ladder = set(), False
|
||||
for path in paths:
|
||||
if matches(shared, path):
|
||||
return [*by_area, LADDER], True
|
||||
if path.startswith(f"{CASES}/{LADDER}/"):
|
||||
ladder = True
|
||||
for area, globs in by_area.items():
|
||||
if path.startswith(f"{CASES}/{area}/") or matches(globs, path):
|
||||
hit.add(area)
|
||||
shards = [a for a in by_area if a in hit]
|
||||
if shards or ladder:
|
||||
shards.append(LADDER)
|
||||
return shards, bool(shards) or any(matches(COVERAGE, p) for p in paths)
|
||||
|
||||
|
||||
def read_paths(src):
|
||||
data = sys.stdin.buffer.read() if src == "-" else open(src, "rb").read()
|
||||
return [p.decode() for p in data.split(b"\0") if p]
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
group = ap.add_mutually_exclusive_group(required=True)
|
||||
group.add_argument("--paths")
|
||||
group.add_argument("--all", action="store_true")
|
||||
ap.add_argument("--root", default=os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
ap.add_argument("--github-output")
|
||||
a = ap.parse_args()
|
||||
shards, build = select(a.root, [] if a.all else read_paths(a.paths), everything=a.all)
|
||||
lines = [f"shards={json.dumps(shards)}", f"build={'true' if build else 'false'}"]
|
||||
print("\n".join(lines))
|
||||
if a.github_output:
|
||||
with open(a.github_output, "a", encoding="utf-8") as f:
|
||||
f.write("\n".join(lines) + "\n")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,156 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Self-test for kernel_rig_plan.py. Run: python3 -I scripts/ci/test_kernel_rig_plan.py (from the
|
||||
repo root).
|
||||
|
||||
Uses a small synthetic tests/kernel-cases/, then the real one: every area has its PATHS and
|
||||
KNOWN_FAILING, every glob names files that exist, and the workflow's trigger paths cover them all.
|
||||
"""
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import kernel_rig_plan as plan # noqa: E402
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
WORKFLOW = os.path.join(ROOT, ".github", "workflows", "kernel-rig.yml")
|
||||
|
||||
|
||||
def write(root, rel, text=""):
|
||||
path = os.path.join(root, rel)
|
||||
os.makedirs(os.path.dirname(path), exist_ok=True)
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
f.write(text)
|
||||
|
||||
|
||||
class Glob(unittest.TestCase):
|
||||
def test_star_stays_in_a_folder_and_double_star_crosses(self):
|
||||
self.assertTrue(plan.glob_regex("crates/kernel/src/blend*.rs").match("crates/kernel/src/blend_smlib.rs"))
|
||||
self.assertFalse(plan.glob_regex("crates/kernel/src/*.rs").match("crates/kernel/src/tess/grid.rs"))
|
||||
self.assertTrue(plan.glob_regex("crates/kernel/src/tess/**").match("crates/kernel/src/tess/a/b.rs"))
|
||||
self.assertFalse(plan.glob_regex("crates/kernel/src/tess/**").match("crates/kernel/src/tess.rs"))
|
||||
self.assertTrue(plan.glob_regex("tests/**/recipe.json").match("tests/recipe.json"))
|
||||
self.assertTrue(plan.glob_regex("tests/**/recipe.json").match("tests/a/b/recipe.json"))
|
||||
self.assertFalse(plan.glob_regex("a.rs").match("a.rsx"))
|
||||
self.assertFalse(plan.glob_regex("a.rs").match("b/a.rs"))
|
||||
|
||||
|
||||
class Synthetic(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
r = self.root = self.tmp.name
|
||||
write(r, "tests/kernel-cases/PATHS-ALL", "# shared\ncrates/geom/**\n\n.github/workflows/kernel-rig.yml\n")
|
||||
write(r, "tests/kernel-cases/fillets/PATHS", "# blends\ncrates/kernel/src/blend*.rs\n")
|
||||
write(r, "tests/kernel-cases/shell/PATHS", "crates/kernel/src/offset*.rs\ncrates/kernel/src/blend_smlib.rs\n")
|
||||
write(r, "tests/kernel-cases/ladder/ladder.json", "{}")
|
||||
write(r, "tests/kernel-cases/README.md")
|
||||
|
||||
def tearDown(self):
|
||||
self.tmp.cleanup()
|
||||
|
||||
def select(self, *paths):
|
||||
return plan.select(self.root, list(paths))
|
||||
|
||||
def test_an_area_runs_on_its_paths_with_the_ladder(self):
|
||||
self.assertEqual(self.select("crates/kernel/src/blend.rs"), (["fillets", "ladder"], True))
|
||||
self.assertEqual(self.select("crates/kernel/src/blend_smlib.rs"), (["fillets", "shell", "ladder"], True))
|
||||
|
||||
def test_a_change_to_an_areas_cases_runs_it(self):
|
||||
self.assertEqual(self.select("tests/kernel-cases/shell/1-x/expected.json"), (["shell", "ladder"], True))
|
||||
self.assertEqual(self.select("tests/kernel-cases/shell/PATHS"), (["shell", "ladder"], True))
|
||||
self.assertEqual(self.select("tests/kernel-cases/ladder/golden.json"), (["ladder"], True))
|
||||
|
||||
def test_the_shared_core_runs_every_area(self):
|
||||
for p in ["crates/geom/src/brep.rs", ".github/workflows/kernel-rig.yml"]:
|
||||
self.assertEqual(self.select("docs/a.md", p), (["fillets", "shell", "ladder"], True), p)
|
||||
|
||||
def test_unrelated_changes_run_nothing(self):
|
||||
self.assertEqual(self.select("crates/ui-egui/src/app.rs", "docs/a.md", "tests/kernel-cases/README.md"), ([], False))
|
||||
|
||||
def test_a_registry_or_case_change_builds_for_the_coverage_check(self):
|
||||
self.assertEqual(self.select("crates/engine/src/cmd/view_navigation.rs"), ([], True))
|
||||
self.assertEqual(self.select("tests/kernel-cases/EXEMPT"), ([], True))
|
||||
|
||||
def test_everything_runs_every_area(self):
|
||||
self.assertEqual(plan.select(self.root, [], everything=True), (["fillets", "shell", "ladder"], True))
|
||||
|
||||
def test_a_new_area_joins_from_its_folder(self):
|
||||
write(self.root, "tests/kernel-cases/surfaces/PATHS", "crates/kernel/src/surface_*.rs\n")
|
||||
self.assertEqual(self.select("crates/kernel/src/surface_trim.rs"), (["surfaces", "ladder"], True))
|
||||
self.assertEqual(plan.select(self.root, [], everything=True)[0], ["fillets", "shell", "surfaces", "ladder"])
|
||||
|
||||
def test_an_area_without_paths_is_an_error(self):
|
||||
os.makedirs(os.path.join(self.root, "tests/kernel-cases/plastic"))
|
||||
with self.assertRaises(SystemExit) as e:
|
||||
self.select("crates/geom/src/brep.rs")
|
||||
self.assertIn("plastic/PATHS is missing", str(e.exception))
|
||||
|
||||
|
||||
def trigger_globs():
|
||||
"""The pull_request trigger paths of the workflow (the push trigger lists the same)."""
|
||||
with open(WORKFLOW, encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
events = {}
|
||||
for event in ("pull_request", "push"):
|
||||
block = re.search(rf"^ {event}:\n((?: .*\n|\s*\n)+)", text, re.M)
|
||||
assert block, event
|
||||
paths = block.group(1).split("paths:", 1)[1]
|
||||
events[event] = re.findall(r'^\s+- "([^"]+)"', paths, re.M)
|
||||
return events
|
||||
|
||||
|
||||
def sample(glob):
|
||||
"""A path the glob matches: each wildcard filled in."""
|
||||
return glob.replace("**", "x/y").replace("*", "x").replace("?", "x")
|
||||
|
||||
|
||||
class Real(unittest.TestCase):
|
||||
def test_every_area_has_its_lists_and_every_glob_names_files(self):
|
||||
# Tracked files and new ones not yet committed (not the ignored ones).
|
||||
ls = ["git", "ls-files", "--cached", "--others", "--exclude-standard"]
|
||||
tracked = subprocess.run(ls, cwd=ROOT, check=True, capture_output=True, text=True).stdout.split("\n")
|
||||
shared = plan.read_globs(os.path.join(ROOT, plan.CASES, "PATHS-ALL"))
|
||||
areas = plan.areas(ROOT)
|
||||
self.assertTrue(areas)
|
||||
for area, globs in {"PATHS-ALL": shared, **areas}.items():
|
||||
if area != "PATHS-ALL":
|
||||
self.assertTrue(os.path.isfile(os.path.join(ROOT, plan.CASES, area, "KNOWN_FAILING")), area)
|
||||
for g in globs:
|
||||
with self.subTest(area=area, glob=g):
|
||||
rx = plan.glob_regex(g)
|
||||
self.assertTrue(any(rx.match(t) for t in tracked), f"{area}: {g} matches no file")
|
||||
|
||||
def test_an_area_names_only_its_own_files(self):
|
||||
# The shared core is in PATHS-ALL; an area's PATHS repeating it (or a whole crate's
|
||||
# folder) would only blur what the area is about.
|
||||
ls = ["git", "ls-files", "--cached", "--others", "--exclude-standard"]
|
||||
files = subprocess.run(ls, cwd=ROOT, check=True, capture_output=True, text=True).stdout.split("\n")
|
||||
shared = plan.read_globs(os.path.join(ROOT, plan.CASES, "PATHS-ALL"))
|
||||
core = {f for f in files if plan.matches(shared, f)}
|
||||
for area, globs in plan.areas(ROOT).items():
|
||||
for g in globs:
|
||||
rx = plan.glob_regex(g)
|
||||
overlap = sorted(f for f in core if rx.match(f))
|
||||
with self.subTest(area=area, glob=g):
|
||||
self.assertFalse(overlap, f"{area}/PATHS: {g} names shared-core files (PATHS-ALL): {overlap[:3]}")
|
||||
|
||||
def test_the_workflow_triggers_on_every_glob(self):
|
||||
events = trigger_globs()
|
||||
self.assertEqual(events["pull_request"], events["push"])
|
||||
triggers = [plan.glob_regex(g) for g in events["pull_request"]]
|
||||
globs = [*plan.read_globs(os.path.join(ROOT, plan.CASES, "PATHS-ALL")), *plan.COVERAGE]
|
||||
for area, own in plan.areas(ROOT).items():
|
||||
globs += [*own, f"{plan.CASES}/{area}/**"]
|
||||
for g in globs:
|
||||
with self.subTest(glob=g):
|
||||
self.assertTrue(any(t.match(sample(g)) for t in triggers), f"{g}: not under the workflow's trigger paths")
|
||||
|
||||
def test_a_ui_change_runs_nothing(self):
|
||||
self.assertEqual(plan.select(ROOT, ["crates/ui-egui/src/app.rs", "docs/kernel-cases.md", "README.md"]), ([], False))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -25,6 +25,8 @@ A failing test without its fix cannot merge: it turns `main` red for everyone. I
|
||||
|
||||
## Goldens, matrices and skipped tests
|
||||
- The reference for what the kernel builds is the kernel-cases ladder (`tests/kernel-cases/ladder/`, `cargo xtask kernel-cases --ladder`, `docs/kernel-ladder.md`).
|
||||
- Kernel PRs run `kernel-rig.yml`: the areas the diff reaches (`PATHS`) against `KNOWN_FAILING`, the ladder against its golden. In the same PR a fix removes its line, a new failing case adds one, a changed ladder result is re-recorded (`--record "why"`), a new command gets a case or an `EXEMPT` line; see `tests/kernel-cases/README.md`.
|
||||
- Maintainers' PRs run the native, GPU path and reference tests on the affected packages; others wait for `approved-for-ci`. `release-gate.yml` runs everything in full before develop replaces main.
|
||||
- The action matrix is a ratchet: record a newly passing action with `cargo xtask action-matrix --bless` (`docs/action-matrix.md`).
|
||||
- Pull requests skip a few heavy tests, which run in the merge queue, nightly and on `main`. Check that validation after merging. The list is in `.config/nextest.toml` and the testing page.
|
||||
- Mutation testing finds behaviour the suites miss: `docs/mutation-testing.md`.
|
||||
- Mutation testing finds what the suites miss: `docs/mutation-testing.md`.
|
||||
@@ -0,0 +1,283 @@
|
||||
# Registry commands with no kernel rig case (`cargo xtask kernel-cases --coverage`). Every other
|
||||
# command of `solidcraft-cli commands` (planned ones aside) must be run by some recipe.json under
|
||||
# tests/kernel-cases/. One line a command: `<id> <why it has no case>`; `#` starts a comment.
|
||||
# Each section is sorted, with no id twice.
|
||||
#
|
||||
# Commands with no geometry to grade: the view, rendering, appearance, materials, selection, the
|
||||
# browser, files and saving, documents, diagnostics, and component, parameter and timeline
|
||||
# bookkeeping. Each is covered by the engine's and the UI's own tests.
|
||||
|
||||
appearance.assign appearance only: colours and textures
|
||||
appearance.library appearance only: colours and textures
|
||||
appearance.list appearance only: colours and textures
|
||||
assembly.bom a bill of materials report
|
||||
body.rename a body name
|
||||
browser.collapse_all the browser tree: order, groups and folding
|
||||
browser.expand_all the browser tree: order, groups and folding
|
||||
browser.group the browser tree: order, groups and folding
|
||||
browser.move the browser tree: order, groups and folding
|
||||
browser.order the browser tree: order, groups and folding
|
||||
browser.rename_group the browser tree: order, groups and folding
|
||||
browser.ungroup the browser tree: order, groups and folding
|
||||
canvas.calibrate reference images, and sketches traced from them (sketch only)
|
||||
canvas.decal reference images, and sketches traced from them (sketch only)
|
||||
canvas.delete reference images, and sketches traced from them (sketch only)
|
||||
canvas.edit reference images, and sketches traced from them (sketch only)
|
||||
canvas.insert reference images, and sketches traced from them (sketch only)
|
||||
canvas.to_sketch reference images, and sketches traced from them (sketch only)
|
||||
component.break_link component links
|
||||
component.copies a listing of identical copies
|
||||
component.cycle_color component colours
|
||||
component.delete removes a component: no geometry built
|
||||
component.links component links
|
||||
component.list a listing
|
||||
component.metadata component metadata
|
||||
component.metadata.set component metadata
|
||||
component.properties component properties
|
||||
component.relink component links
|
||||
component.rename a component name
|
||||
component.replace_with_link component links
|
||||
component.unlock component locking
|
||||
component.update_links component links
|
||||
diagnostics.crash_report crash reports
|
||||
diagnostics.crash_reports crash reports
|
||||
diagnostics.crash_reports.clear crash reports
|
||||
diagnostics.crash_test crash reports
|
||||
diagnostics.profile timing: where a command's time goes
|
||||
doc.open opening and recovering documents
|
||||
doc.recover opening and recovering documents
|
||||
doc.recovery_discard opening and recovering documents
|
||||
doc.recovery_list opening and recovering documents
|
||||
document.metadata document metadata and revisions
|
||||
document.metadata.remove document metadata and revisions
|
||||
document.metadata.set document metadata and revisions
|
||||
document.revision document metadata and revisions
|
||||
edit.checkpoint undo, redo and checkpoints: an earlier state restored, no new geometry
|
||||
edit.redo undo, redo and checkpoints: an earlier state restored, no new geometry
|
||||
edit.restore_checkpoint undo, redo and checkpoints: an earlier state restored, no new geometry
|
||||
edit.undo undo, redo and checkpoints: an earlier state restored, no new geometry
|
||||
engine.commands the command registry itself
|
||||
engine.describe the command registry itself
|
||||
explode.delete exploded views: display offsets
|
||||
explode.list exploded views: display offsets
|
||||
expr.evaluate expression evaluation
|
||||
file.open_in_easyprint hands the file to another program
|
||||
file.save saving the design
|
||||
file.save_as saving the design
|
||||
file.save_mesh saving a display mesh
|
||||
file.send_to_slicer hands the file to a slicer
|
||||
file.slicers a listing of slicers
|
||||
frame.profile.list a listing of the profile library
|
||||
frame.profile.properties a profile's section properties from the library
|
||||
inspect.accessibility display analysis: shading
|
||||
inspect.colored_components display: component colours
|
||||
inspect.curvature_map display analysis: shading
|
||||
inspect.environment_map display analysis: shading
|
||||
inspect.silhouette display analysis: outline
|
||||
inspect.zebra display analysis: shading
|
||||
library.apply material and appearance libraries
|
||||
library.export material and appearance libraries
|
||||
library.inspect material and appearance libraries
|
||||
material.assign materials and their properties
|
||||
material.create materials and their properties
|
||||
material.delete materials and their properties
|
||||
material.edit materials and their properties
|
||||
material.inspect materials and their properties
|
||||
material.list materials and their properties
|
||||
material.properties.directional materials and their properties
|
||||
material.properties.validate materials and their properties
|
||||
model.edges a listing of the model's topology
|
||||
model.faces a listing of the model's topology
|
||||
model.threads a listing of the model's topology
|
||||
motion.delete removes a motion study
|
||||
motion.export writes a study's results to a file
|
||||
motion.export_animation writes an animation
|
||||
motion.list a listing of motion studies
|
||||
parameters.comment parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.complete parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.delete parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.export parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.favorite parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.graph parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.import parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.list parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.move parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.rename parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parameters.users parameter bookkeeping; a value change that rebuilds is parameters.change, which cases use
|
||||
parts.library a listing of the parts library
|
||||
render.aging.describe rendering: images, cameras, stages
|
||||
render.backends rendering: images, cameras, stages
|
||||
render.camera.fit rendering: images, cameras, stages
|
||||
render.camera.get rendering: images, cameras, stages
|
||||
render.camera.set rendering: images, cameras, stages
|
||||
render.cancel rendering: images, cameras, stages
|
||||
render.effects.describe rendering: images, cameras, stages
|
||||
render.export rendering: images, cameras, stages
|
||||
render.hdr.inspect rendering: images, cameras, stages
|
||||
render.library.appearance.apply rendering: images, cameras, stages
|
||||
render.library.describe rendering: images, cameras, stages
|
||||
render.library.environment.apply rendering: images, cameras, stages
|
||||
render.library.list rendering: images, cameras, stages
|
||||
render.library.physical.prepare rendering: images, cameras, stages
|
||||
render.library.preview rendering: images, cameras, stages
|
||||
render.library.studio.apply rendering: images, cameras, stages
|
||||
render.library.studio.prepare rendering: images, cameras, stages
|
||||
render.library.surface.bind rendering: images, cameras, stages
|
||||
render.library.surface.prepare rendering: images, cameras, stages
|
||||
render.library.surface.unbind rendering: images, cameras, stages
|
||||
render.library.targets rendering: images, cameras, stages
|
||||
render.optics.bind rendering: images, cameras, stages
|
||||
render.optics.unbind rendering: images, cameras, stages
|
||||
render.preflight rendering: images, cameras, stages
|
||||
render.preset.apply rendering: images, cameras, stages
|
||||
render.preset.resolve rendering: images, cameras, stages
|
||||
render.quality.prepare rendering: images, cameras, stages
|
||||
render.result.pin rendering: images, cameras, stages
|
||||
render.result.regrade rendering: images, cameras, stages
|
||||
render.scene rendering: images, cameras, stages
|
||||
render.settings.apply rendering: images, cameras, stages
|
||||
render.settings.capture_hdr rendering: images, cameras, stages
|
||||
render.settings.get rendering: images, cameras, stages
|
||||
render.settings.set rendering: images, cameras, stages
|
||||
render.shot.duplicate rendering: images, cameras, stages
|
||||
render.shot.remove rendering: images, cameras, stages
|
||||
render.shot.rename rendering: images, cameras, stages
|
||||
render.stage.backdrop rendering: images, cameras, stages
|
||||
render.stage.clear rendering: images, cameras, stages
|
||||
render.stage.ground rendering: images, cameras, stages
|
||||
render.start rendering: images, cameras, stages
|
||||
render.status rendering: images, cameras, stages
|
||||
select.clear the selection
|
||||
select.set the selection
|
||||
selection.delete deletes what is selected through the commands that own each kind
|
||||
sheet.rules a listing of sheet metal rules
|
||||
sketch.arc.tangent 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.auto_constrain 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.auto_constrain_from_datum 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.break 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.break_link 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.cancel 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.centerline 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.chain 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.chamfer.distance_angle 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.chamfer.equal_distance 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.chamfer.two_distance 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.circle.three_point 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.circle.three_tangent 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.circle.two_point 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.circle.two_tangent 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constrainer 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.coincident 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.collinear 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.concentric 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.curvature 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.equal 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.midpoint 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.parallel 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.perpendicular 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.polygon 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.constraint.symmetry 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.construction 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.copy 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.cut 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.delete 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.dimension_text 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.drag 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.drag_end 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.draw.dimensioned 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.drawing_bounds 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.edit_text 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.export_dxf 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.extend 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.fillet 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.finish_auto_constrain 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.glyphs 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.infinite 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.insert_dxf 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.insert_svg 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.inspect 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.line.midpoint 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.loose_ends 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.loose_ends.tie 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.mirror 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.move 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.move3d 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.offset 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.offset.break 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.paste 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.pattern.rectangular 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.point3d 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.polygon.edge 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.rectangle.three_point 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.redefine 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.scale 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.slot.arc_center 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.slot.arc_three_point 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.slot.center_point 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.snap 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.solve 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.toggle_driven 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.transform 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.trim 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
sketch.trim.path 2D sketch only (the sketch solver and engine tests); no kernel operation
|
||||
timeline.dependents a listing of dependents
|
||||
timeline.export_script writes the history as a script
|
||||
timeline.inspect a listing of the timeline
|
||||
timeline.rename a feature name
|
||||
timeline.rename_group a group name
|
||||
view.ambient_occlusion the view: camera, layout, display
|
||||
view.apply the view: camera, layout, display
|
||||
view.back the view: camera, layout, display
|
||||
view.bottom the view: camera, layout, display
|
||||
view.delete the view: camera, layout, display
|
||||
view.fit the view: camera, layout, display
|
||||
view.front the view: camera, layout, display
|
||||
view.graphics_preset the view: camera, layout, display
|
||||
view.grid the view: camera, layout, display
|
||||
view.ground_shadow the view: camera, layout, display
|
||||
view.history_layout the view: camera, layout, display
|
||||
view.home the view: camera, layout, display
|
||||
view.isometric the view: camera, layout, display
|
||||
view.layout the view: camera, layout, display
|
||||
view.left the view: camera, layout, display
|
||||
view.list the view: camera, layout, display
|
||||
view.navigate the view: camera, layout, display
|
||||
view.navigation_bar the view: camera, layout, display
|
||||
view.normal_to the view: camera, layout, display
|
||||
view.perspective the view: camera, layout, display
|
||||
view.rename the view: camera, layout, display
|
||||
view.right the view: camera, layout, display
|
||||
view.save the view: camera, layout, display
|
||||
view.spin the view: camera, layout, display
|
||||
view.tool the view: camera, layout, display
|
||||
view.top the view: camera, layout, display
|
||||
view.visual_style the view: camera, layout, display
|
||||
|
||||
# Commands that make or change geometry and have no case yet. This section only shrinks:
|
||||
# the pull request that adds a case for one removes its line (the check fails on a listed command
|
||||
# that a case uses), and a new geometry command gets a case, not a line here.
|
||||
[to cover]
|
||||
body.repair repair: the solid a refused or open part becomes
|
||||
component.move_sketches assemblies: sketches moved between components
|
||||
component.revert_position assemblies: a placement reverted
|
||||
file.export_view_dxf drawings: the projection of the model a view DXF holds
|
||||
inspect.draft inspect: the number or curves it reports
|
||||
inspect.parameter_sweep inspect: results rebuilt over a parameter range
|
||||
inspect.section inspect: the number or curves it reports
|
||||
motion.trace.edit assemblies: motion results
|
||||
motion.trace.keep assemblies: motion results
|
||||
parts.fastener standard parts: a fastener body
|
||||
parts.insert standard parts: a part body
|
||||
parts.resize standard parts: a part resized
|
||||
sketch.arc3d sketch: a curve kind no case profiles yet
|
||||
sketch.auto_project sketch from the model: curves the kernel computes from bodies
|
||||
sketch.conic sketch: a curve kind no case profiles yet
|
||||
sketch.fit_curves_to_section sketch from the model: curves the kernel computes from bodies
|
||||
sketch.include_3d sketch from the model: curves the kernel computes from bodies
|
||||
sketch.intersect sketch from the model: curves the kernel computes from bodies
|
||||
sketch.intersection_curve sketch from the model: curves the kernel computes from bodies
|
||||
sketch.isoparametric_curve sketch from the model: curves the kernel computes from bodies
|
||||
sketch.project_to_surface sketch from the model: curves the kernel computes from bodies
|
||||
sketch.spline.control_point_5 sketch: a curve kind no case profiles yet
|
||||
sketch.spline3d sketch: a curve kind no case profiles yet
|
||||
sketch.spun_profile sketch from the model: curves the kernel computes from bodies
|
||||
@@ -0,0 +1,58 @@
|
||||
# The shared core: a change to any of these reruns every area of the kernel rig and the ladder
|
||||
# (scripts/ci/kernel_rig_plan.py). One git pathspec glob a line, relative to the repository root:
|
||||
# `*` stays within a folder, `**` crosses folders. Each area's own sources are in <area>/PATHS.
|
||||
#
|
||||
# SMLib: the bindings, the schema 4 record bridge and the pinned revision (SMLIB_REV,
|
||||
# SMLIB_PREBUILT), and the script that fetches it.
|
||||
crates/smlib/**
|
||||
scripts/fetch-smlib.sh
|
||||
# The geometry every body is made of: B-rep record, curves, surfaces, meshes.
|
||||
crates/geom/**
|
||||
# The kernel's core, which every case goes through: bodies, extrude/revolve/primitives, booleans
|
||||
# and placements, the planar prisms, the SMLib sweeps and booleans, history and provenance, the
|
||||
# native bridge to SMLib, tessellation, and what the grader measures (measure, validity, counts).
|
||||
crates/kernel/Cargo.toml
|
||||
crates/kernel/src/body.rs
|
||||
crates/kernel/src/boolean_record.rs
|
||||
crates/kernel/src/build.rs
|
||||
crates/kernel/src/freeform.rs
|
||||
crates/kernel/src/heal.rs
|
||||
crates/kernel/src/history.rs
|
||||
crates/kernel/src/lib.rs
|
||||
crates/kernel/src/measure.rs
|
||||
crates/kernel/src/native.rs
|
||||
crates/kernel/src/native/**
|
||||
crates/kernel/src/numbered.rs
|
||||
crates/kernel/src/ops.rs
|
||||
crates/kernel/src/par.rs
|
||||
crates/kernel/src/planar_regularize.rs
|
||||
crates/kernel/src/planar_sources.rs
|
||||
crates/kernel/src/plane_fit.rs
|
||||
crates/kernel/src/prism.rs
|
||||
crates/kernel/src/prism_curve.rs
|
||||
crates/kernel/src/prism_measure.rs
|
||||
crates/kernel/src/profile.rs
|
||||
crates/kernel/src/provenance.rs
|
||||
crates/kernel/src/record.rs
|
||||
crates/kernel/src/shell_groups.rs
|
||||
crates/kernel/src/smlib_boolean.rs
|
||||
crates/kernel/src/smlib_sweeps.rs
|
||||
crates/kernel/src/tess/**
|
||||
crates/kernel/src/topo.rs
|
||||
crates/kernel/src/validity.rs
|
||||
crates/kernel/src/watch.rs
|
||||
# Timeline evaluation and the model cache, which every feature is evaluated through.
|
||||
crates/doc/src/eval.rs
|
||||
crates/doc/src/model_cache.rs
|
||||
crates/doc/src/walk.rs
|
||||
# The command registry and the solid feature commands every case starts with (sketches made
|
||||
# into boxes, cylinders, extrusions, revolutions, combines, moves; fillets, holes, shells, sweeps
|
||||
# and lofts live there too).
|
||||
crates/engine/src/cmd/features.rs
|
||||
crates/engine/src/cmd/mod.rs
|
||||
# The rig itself: the grader, the runner, the selection and this gate's workflow.
|
||||
.github/workflows/kernel-rig.yml
|
||||
apps/solidcraft-cli/src/kernel_cases.rs
|
||||
scripts/ci/kernel_rig_plan.py
|
||||
xtask/src/kernel_cases.rs
|
||||
xtask/src/kernel_ladder.rs
|
||||
@@ -57,6 +57,16 @@ One directory per area, one per case: `tests/kernel-cases/<area>/<id>/`.
|
||||
| `crashes` (crashes and hangs inside kernel operations) | booleans/shell/import/crash rig |
|
||||
| `fillets`, `sweeps`, `threads`, `sheet-metal`, `tessellation` | history rig |
|
||||
| `continuity` (designed seams of known order, G0 to G4, that prove the continuity measurement itself) | history rig |
|
||||
| `solids` (cones, scale, align, bounding solids) | tool coverage |
|
||||
| `frames` (frame members, inserted profiles) | tool coverage |
|
||||
| `plastic` (boss, lip and groove, rest, snap fit, plastic rules) | tool coverage rig |
|
||||
| `surfaces` (every `surface.*` tool: offset, ruled, untrim, unstitch, reverse normal, boundary, blend, match, fair, and a normal and an edge case of each of the others) | surfaces rig |
|
||||
| `construction` (construction planes, axes and points: `construct.*`) | tool coverage rig |
|
||||
| `inspect` (the inspect commands that return numbers) | tool coverage rig |
|
||||
| `history` (the timeline's suppress, reorder, delete, roll back, edit and folders; configuration rows, columns and rules; parameters that drive geometry) | tool coverage rig |
|
||||
| `assemblies` (joints and couplings, motion studies, contact, components and occurrences, interference and clearance between placed parts: placements and answers worked out by hand) | rig coverage |
|
||||
|
||||
Each area also has its gate files: `KNOWN_FAILING` and `PATHS` (see [the gate](#the-kernel-rig-gate)).
|
||||
|
||||
`<id>` is `<source number>-<short-name>`, such as `1894-prism-cut-touching-walls`.
|
||||
|
||||
@@ -112,38 +122,93 @@ the frozen truck-geometry PRs, a `kernel-paused` PR), for the report's coverage
|
||||
| `faces`, `edges`, `vertices`, `shells`, `body_count` as `[min, max]` | An inclusive range, where the geometry only bounds a count (a modelled thread's faces). |
|
||||
| `continuity` | `{order, edges}`: every seam `edges` names reaches `order` (`g0` … `g4`), as Continuity Analysis (`inspect.continuity`) measures it: from the faces' exact surfaces, at its default 33 stations a seam and its default tolerances (1 µm, 1°, 0.01 / mm, 0.001 / mm², 0.0001 / mm³), never loosened per case. A failure names the worst seam (lowest order; of those, the one furthest past the next order's tolerance), its faces, the order it reaches and that next order's worst value. `edges`: `blend` (default), every seam of a face a fillet or chamfer made (a round, a chamfer face or a corner patch) with the faces either side of the edge it replaced, and every seam of a corner patch with the rounds it joins: what the blend is built to meet (not where a round runs into an end face, nor where two rounds meet without a patch: that seam is the input's, tangent only where the rounded edges were); `corner`, those of them on a corner patch (a blend made from several replaced edges); or a list of points `[[x,y,z], …]`, the edges nearest them, as Continuity Analysis picks them. `exact: true`: every seam reaches `order` and not the next (a case built to an order proves the measurement reads that order, no more and no less). A constant round meets its faces G1 (curvature jumps by 1 / r), a `curvature` round G2, a chamfer G0; a `corner: g2` patch is built G2 to the rounds and faces round it. |
|
||||
| `continuity` (older form) | `{near, within_mm, clear_mm, curvature_jump_per_mm}`: over every tangent seam lying wholly within `within_mm` of `near` (a corner's patch and its neighbours), the curvature jump across it (the faces' normal curvatures square to the seam, from their exact surfaces, at 65 stations a seam) is at most `curvature_jump_per_mm` at every station at least `clear_mm` along the seam from a vertex where two of those seams turn (where a neighbour's own G1 seam ends, which no surface is G2 to both sides of). A rolling ball's corner jumps 1 / r everywhere. |
|
||||
| `surface_types` | The set of kinds the faces' surfaces are, over every body, as the records hold them: `plane`, `cylinder`, `cone`, `sphere`, `torus`, `bspline` (a B-spline or NURBS surface) or `revolution` (a revolved curve). Exact: none missing, none extra. |
|
||||
| `splines` | `[{degree: [p, q], spans?: [m, n]}, …]`: one entry per B-spline face, each matching one face (directions in either order); `spans`, the distinct knot intervals each way, only where the construction fixes them. |
|
||||
| `boundary_edges` | The edges only one face uses (a sheet's free boundary), over every body, as the records hold them; exact or `[min, max]`. |
|
||||
| `flat_pattern` | A sheet metal case's flat pattern, from the script's last `sheet.flat_pattern` result: `size_mm` ([w, h] of the outline), `area_mm2` (the outline's area less the cut-outs', relative tolerance as volume) and `bend_lines` (each `[[x, y], [x, y]]`, a bend's centre line in flat coordinates, matched one for one, either way round, and as many as the result has), positions within the box-diagonal tolerance. |
|
||||
| `watertight` | `true`: each body's display mesh (chord tolerance `tolerance.mesh_mm`, default 0.01 mm) has no open and no over-shared edges, with vertices closer than `tolerance.weld_mm` (default 1e-4 mm) taken as one. |
|
||||
| `timeout_s` | A longer timeout for this case than the run's (at most 1800 s), for cases that are slow by nature. A case that only needs it on a loaded machine shouldn't set it. |
|
||||
| `tolerance` | Optional overrides: `rel`, `abs_mm`, `mesh_mm`, `weld_mm`. |
|
||||
| `files` | The files the case wrote to `$OUT`, each `{path, json \| csv \| dxf}`, matched as a part of what is there: every key the case gives, an array item by item and as long, a whole number exactly, any other number within `rel`. `json`: the file's JSON; `csv`: its rows, as objects keyed by the header row; `dxf`: per layer of its ENTITIES section, how many of each entity (`{"CUT": {"CIRCLE": 1, "ELLIPSE": 0, "length_mm": 31.416}}`; a count may be a range `[min, max]`) and `length_mm`, the total length of its lines, arcs, circles, ellipses and polylines. |
|
||||
| `results` | The commands' own answers, each `{step, pointer?, json, rel?, abs_mm?}`: the answer of the `step`th command (from 1, base commands included), or its part at the JSON `pointer` (RFC 6901), matched as `files` matches JSON: a whole number exactly (a count), another within `rel` (the case's relative tolerance unless given) or `abs_mm`, lists item by item. |
|
||||
| `construction` | `{name: spec}`, a spec being `{point: [x,y,z]}`, `{axis: {through, dir}}` or `{plane: {through, normal}}`: each named construction point, axis or plane as the timeline evaluated it. A point within the position tolerance (`tolerance.abs_mm`, else 1e-3 of the box diagonal, of 1 mm where there is no body); an axis whose direction is parallel to `dir` (either way, sine of the angle at most 1e-6) and whose line passes within it of `through`; a plane likewise with `normal`. An axis or plane is graded as the line or plane it is, not by the origin it keeps. |
|
||||
| `missing` | A capability SolidCraft has no command or parameter for yet (`"solid.thread has no start count"`): the case is reported **not supported yet** without running, so the gap stays visible. |
|
||||
|
||||
## The fillet gate
|
||||
## The kernel rig gate
|
||||
|
||||
The fillet cases are the fillet regression suite: each is one small case of one issue, with its
|
||||
exact answer. `.github/workflows/fillet-rig.yml` runs them on every pull request (not a draft)
|
||||
that touches fillet code: `crates/kernel/src/{blend*,fillet*,*corner*,continuity*}.rs`,
|
||||
`crates/smlib/**` (`SMLIB_REV` and `SMLIB_PREBUILT` included), `crates/doc/src/eval*.rs`,
|
||||
`crates/engine/src/cmd/features.rs`, `tests/kernel-cases/fillets/**` and the rig's own code
|
||||
(GitHub filters whole files, so any change to `eval*.rs` or `features.rs` runs it). One release
|
||||
build of `solidcraft-cli`, then:
|
||||
Every area is a regression suite: each case is one small case of one issue, with its exact
|
||||
answer. `.github/workflows/kernel-rig.yml` runs them, and the ladder, on pull requests (not
|
||||
drafts). A plan job (`scripts/ci/kernel_rig_plan.py`) picks the areas from the changed files, one
|
||||
job builds `solidcraft-cli` (release, SMLib) and the rig's runner, and a matrix of shards, one per
|
||||
selected area plus the ladder, runs them in parallel; the `kernel-rig` check passes when every
|
||||
selected shard does (and when none was selected). Pushes to main and develop, merge groups, the
|
||||
release gate (`release-gate.yml`) and a run by hand run every area. Each area's shard runs:
|
||||
|
||||
```sh
|
||||
cargo xtask kernel-cases --area fillets --cli target/release/solidcraft-cli \
|
||||
--known-failing tests/kernel-cases/fillets/KNOWN_FAILING
|
||||
cargo xtask kernel-cases --area <area> --cli target/release/solidcraft-cli \
|
||||
--known-failing tests/kernel-cases/<area>/KNOWN_FAILING
|
||||
```
|
||||
|
||||
`fillets/KNOWN_FAILING` lists the cases that fail today, sorted, one a line with its cause
|
||||
(`<case> <why it fails today>`; `#` starts a comment). The gate fails on a **regression**, a case
|
||||
that fails (or crashes, hangs, or is not supported yet) and is not listed, and on a **fixed** case,
|
||||
one listed that passes: a fix removes its line in the same pull request, so the list only shrinks.
|
||||
A new case that fails today goes in with its line. With `--known-failing` the run writes no
|
||||
report; `docs/kernel-cases.md` stays the full run's.
|
||||
`<area>/KNOWN_FAILING` lists the cases of that area that fail today, sorted, one a line with its
|
||||
cause (`<case> <why it fails today>`; `#` starts a comment; the header names the baseline: the
|
||||
develop commit and SMLib revision it was taken from). The gate fails on a **regression**, a
|
||||
case that fails (or crashes, hangs, or is not supported yet) and is not listed, and on a
|
||||
**fixed** case, one listed that passes. With `--known-failing` the run writes no report;
|
||||
`docs/kernel-cases.md` stays the full run's.
|
||||
|
||||
**Updating a list.** The pull request that changes an outcome changes the list in the same pull
|
||||
request, so the list only shrinks and never goes stale:
|
||||
|
||||
- a fix (yours, or an SMLib pin bump): remove the line of each case the shard reports as
|
||||
`FIXED`;
|
||||
- a new case that fails today: add its line, sorted, with the cause from its result
|
||||
(`results.json` in the shard's `kernel-rig-results-<area>` artifact, or a local run);
|
||||
- a regression: fix it in the same pull request.
|
||||
|
||||
To check a list locally before pushing: `cargo xtask kernel-cases --area <area> --cli
|
||||
target/release/solidcraft-cli --known-failing tests/kernel-cases/<area>/KNOWN_FAILING`.
|
||||
|
||||
### Which areas a pull request runs
|
||||
|
||||
- `<area>/PATHS`: the source files whose change reruns that area, one git pathspec glob a line
|
||||
(`*` within a folder, `**` across folders; `#` starts a comment): the engine command modules,
|
||||
doc evaluation and kernel files its commands go through. Only the area's own files: never a
|
||||
file `PATHS-ALL` covers, nor a whole crate (the self-test fails on either).
|
||||
- `PATHS-ALL`: the shared core, whose change reruns every area: SMLib (`crates/smlib/**`, its pin
|
||||
included) and `scripts/fetch-smlib.sh`, `crates/geom/**`, the kernel's core (bodies, extrude and
|
||||
revolve, booleans, the SMLib bridge, tessellation, what the grader measures), timeline
|
||||
evaluation, the solid feature commands, the grader, the runner and the workflow.
|
||||
- A change under `<area>/` (a case, its `KNOWN_FAILING`, its `PATHS`) reruns that area.
|
||||
- The ladder spans every operation: it runs whenever any area does, and on a change under
|
||||
`ladder/`.
|
||||
|
||||
The workflow's trigger paths are whole folders that hold every `PATHS` glob (a self-test,
|
||||
`scripts/ci/test_kernel_rig_plan.py`, checks it), so a pull request that touches none of them
|
||||
starts no job at all. To see what a change would run:
|
||||
`git diff --name-only -z origin/develop... | python3 scripts/ci/kernel_rig_plan.py --paths -`.
|
||||
|
||||
**A new area** joins with its folder: its cases, a `KNOWN_FAILING` (empty but for its header
|
||||
when every case passes), and a `PATHS` listing the files its commands go through. The plan finds
|
||||
the areas from the folders, so the workflow needs no edit (unless a `PATHS` glob lies outside
|
||||
the trigger paths, which the self-test reports). Add a row to the table under Layout.
|
||||
|
||||
### Every command has a case
|
||||
|
||||
`cargo xtask kernel-cases --coverage --cli target/release/solidcraft-cli` (run in the gate's
|
||||
build job) lists every registry command (`solidcraft-cli commands`, planned ones aside) that no
|
||||
`recipe.json` here runs, and fails unless `EXEMPT` lists it: one line a command, `<id> <why it
|
||||
has no case>`, each section sorted. Lines before `[to cover]` have no geometry to grade (the
|
||||
view, rendering, appearance, files, component and parameter bookkeeping, ...). Lines after it
|
||||
make geometry and wait for a case: that section only shrinks. The check also fails on a listed
|
||||
command that a case now uses (remove its line in the same pull request) or that the registry no
|
||||
longer has. A new geometry command gets a case, not an `EXEMPT` line. The build job runs for this
|
||||
check on any change to `crates/engine/src/cmd/`, a recipe or `EXEMPT`, even when no area does.
|
||||
|
||||
## The complexity ladder
|
||||
|
||||
`ladder/` orders kernel operations by complexity instead of by where they went wrong: tiers from
|
||||
primitives through degenerate booleans, analytic and spline profiles, holes and taps, threads,
|
||||
fillets, chamfers, shells, patterns, to whole parts. Later tiers build on earlier tiers' shapes (a
|
||||
fillets, chamfers, shells, patterns, whole parts, and sheet metal. Later tiers build on earlier tiers' shapes (a
|
||||
running part grows one tier at a time through `base`), so the last case carries everything.
|
||||
|
||||
- `ladder/<NN-tier>/<NNN-name>/`: cases in the format above, each a test with its own answer.
|
||||
@@ -157,9 +222,17 @@ running part grows one tier at a time through `base`), so the last case carries
|
||||
|
||||
```sh
|
||||
cargo xtask kernel-cases --ladder --cli target/release/solidcraft-cli
|
||||
cargo xtask kernel-cases --ladder --cli target/release/solidcraft-cli --gate
|
||||
cargo xtask kernel-cases --ladder --cli target/release/solidcraft-cli --record "why"
|
||||
```
|
||||
|
||||
The ladder needs no known-failing list: the golden is the reference. Its shard in the kernel rig
|
||||
gate runs with `--gate`, which fails on any case whose status or counts differ from the golden,
|
||||
better or worse, and on a case with no golden; times are not compared there (they are the
|
||||
machine's). A pull request that changes a ladder result re-records the golden with
|
||||
`--record "why the golden changes"` and commits `golden.json` and
|
||||
`ladder.json` with it.
|
||||
|
||||
Ladder runs measure one case at a time (unless `--jobs`) and keep their output in
|
||||
`target/kernel-ladder` (`--out`); `--record` rewrites the golden and sorts each tier by time,
|
||||
fastest first; commit both files. The report, `docs/kernel-ladder.md`, gives per tier the counts
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# The assemblies cases that fail today, one a line: `<case> <why it fails today>`. Sorted. A gate
|
||||
# fails on a case that fails and is not listed here, and on a listed case that passes: a fix
|
||||
# removes its line in the same pull request.
|
||||
# Baseline: rig-cases-assemblies 45f69c0e5 with SMLib 60b1c6a, aarch64 Linux. None fail today.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Source files whose change must rerun the assemblies cases (one git pathspec glob a line).
|
||||
# Joints, couplings, cams, reach and the solver.
|
||||
crates/doc/src/joints*.rs
|
||||
crates/doc/src/assembly.rs
|
||||
crates/engine/src/cmd/joints.rs
|
||||
crates/engine/src/cmd/joints_inspect.rs
|
||||
# Motion studies, plots, traces, interference, sweeps, contact and exploded views.
|
||||
crates/doc/src/motion.rs
|
||||
crates/engine/src/cmd/motion.rs
|
||||
crates/engine/src/cmd/motion_analysis.rs
|
||||
crates/engine/src/cmd/motion_sweep.rs
|
||||
crates/engine/src/cmd/motion_trace.rs
|
||||
crates/engine/src/cmd/contact_sweep.rs
|
||||
# Components and occurrences (their placement in the world is crates/doc/src/eval.rs: shared core).
|
||||
crates/engine/src/cmd/component.rs
|
||||
crates/engine/src/cmd/component_clone.rs
|
||||
crates/engine/src/cmd/component_clone_assembly.rs
|
||||
crates/engine/src/cmd/component_drag.rs
|
||||
crates/engine/src/cmd/component_extract.rs
|
||||
crates/engine/src/cmd/component_link.rs
|
||||
crates/engine/src/cmd/component_properties.rs
|
||||
crates/engine/src/cmd/component_reparent.rs
|
||||
crates/engine/src/cmd/component_transfer.rs
|
||||
# Interference and clearance between placed bodies.
|
||||
crates/engine/src/cmd/clearance.rs
|
||||
crates/engine/src/cmd/interference.rs
|
||||
# The cases themselves.
|
||||
tests/kernel-cases/assemblies/**
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "the body of an arm turned 90 degrees copied to the root",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); hinge driven to 90 puts ArmBox at (0,20,5); its copy in the root stays there: centres (0,0,-5), (0,20,5), (0,20,5): mean (0,13.333,1.667)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 12000.0,
|
||||
"center_of_mass": [
|
||||
0,
|
||||
13.333333,
|
||||
1.666667
|
||||
]
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.copy_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "root"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "the arm's body copied into the base's component",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a copy stays where its body is: Base then holds 4000 at (0,0,-5) and 4000 at (20,0,5): 8000, centre (10,0,0); the world has 3 bodies, 12000",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 12000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
10.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"volume_mm3": 8000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.copy_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Base:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.extract of a component that is already linked",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5), Arm's box built inside Arm; after one extract Arm is linked; extracting it again is refused",
|
||||
"outcome": "refused",
|
||||
"refusal": "is linked to a design file already"
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.activate",
|
||||
"params": {
|
||||
"component": "root"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.extract",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"path": "$OUT/arm.solidcraft"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.extract",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"path": "$OUT/arm2.solidcraft"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.extract of a component whose body was moved in from the root",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm's body came in by component.move_bodies, a feature outside it: its history can't move to a design of its own, so extract is refused",
|
||||
"outcome": "refused",
|
||||
"refusal": "moves bodies into or out of Arm"
|
||||
}
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.extract",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"path": "$OUT/arm.solidcraft"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an arm built in its component extracted to a design file, then that file inserted again 50 mm along y",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5), Arm's box built inside Arm; extract keeps Arm where it is (now linked to the file: centre (20,0,5)); the file inserted with translate (0,50,0) holds the same 40x10x10 bar: centre (20,50,5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 12000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 8,
|
||||
"json": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"volume_mm3": 4000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"name": "Arm copy"
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
50.0,
|
||||
5.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
0.0,
|
||||
45.0,
|
||||
0.0
|
||||
],
|
||||
"max": [
|
||||
40.0,
|
||||
55.0,
|
||||
10.0
|
||||
]
|
||||
},
|
||||
"volume_mm3": 4000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.activate",
|
||||
"params": {
|
||||
"component": "root"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.extract",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"path": "$OUT/arm.solidcraft"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.insert_design",
|
||||
"params": {
|
||||
"path": "$OUT/arm.solidcraft",
|
||||
"name": "Arm copy",
|
||||
"translate": [
|
||||
0,
|
||||
50,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm copy:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.from_bodies on two root bodies",
|
||||
"source": "analytic",
|
||||
"method": "boxes P 10x10x10 from (0,0,0) and Q 20x10x10 from (30,0,0): one component each, named after its body, in place: P:1 (5,5,5), Q:1 (40,5,5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 3000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 4,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
5.0,
|
||||
5.0,
|
||||
5.0
|
||||
],
|
||||
"volume_mm3": 1000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 5,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
40.0,
|
||||
5.0,
|
||||
5.0
|
||||
],
|
||||
"volume_mm3": 2000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "P"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
30,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Q"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.from_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"P",
|
||||
"Q"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "P:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Q:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.from_bodies naming a body that is not there",
|
||||
"source": "analytic",
|
||||
"method": "a design with one body P: from_bodies of 'Nope' is refused, naming it",
|
||||
"outcome": "refused",
|
||||
"refusal": "Nope"
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"operation": "new",
|
||||
"body_name": "P"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.from_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Nope"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a hand-written design (one 30x20x10 box) inserted 100 mm along x",
|
||||
"source": "analytic",
|
||||
"method": "plate.solidcraft in the case directory: a box 30x20x10 at the origin; inserted with translate (100,0,0): 6000 mm3, box (100,0,0)-(130,20,10), centre (115,10,5)",
|
||||
"body_count": 1,
|
||||
"volume_mm3": 6000.0,
|
||||
"area_mm2": 2200.0,
|
||||
"bbox": {
|
||||
"min": [
|
||||
100,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"max": [
|
||||
130,
|
||||
20,
|
||||
10
|
||||
]
|
||||
},
|
||||
"results": [
|
||||
{
|
||||
"step": 1,
|
||||
"json": {
|
||||
"bodies": [
|
||||
"Plate"
|
||||
],
|
||||
"name": "plate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 2,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
115.0,
|
||||
10.0,
|
||||
5.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
100.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"max": [
|
||||
130.0,
|
||||
20.0,
|
||||
10.0
|
||||
]
|
||||
},
|
||||
"volume_mm3": 6000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"format": "solidcraft/40",
|
||||
"name": "plate",
|
||||
"units": "mm",
|
||||
"params": [],
|
||||
"next_id": 2,
|
||||
"features": [
|
||||
{"id": 1, "name": "Box1", "type": "box", "suppressed": false, "operation": "new_body", "body_names": ["Plate"],
|
||||
"corner": [0.0, 0.0, 0.0], "length": "30", "width": "20", "height": "10"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "component.insert_design",
|
||||
"params": {
|
||||
"path": "$CASE/plate.solidcraft",
|
||||
"translate": [
|
||||
100,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "plate:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "the hand-written design inserted twice, the second reusing the first's link",
|
||||
"source": "analytic",
|
||||
"method": "plate.solidcraft (box 30x20x10) at (0,0,0) and again with translate (0,50,0): 2 bodies, 12000 mm3, box (0,0,0)-(30,70,10)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 12000.0,
|
||||
"bbox": {
|
||||
"min": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"max": [
|
||||
30,
|
||||
70,
|
||||
10
|
||||
]
|
||||
},
|
||||
"center_of_mass": [
|
||||
15,
|
||||
35,
|
||||
5
|
||||
]
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"format": "solidcraft/40",
|
||||
"name": "plate",
|
||||
"units": "mm",
|
||||
"params": [],
|
||||
"next_id": 2,
|
||||
"features": [
|
||||
{"id": 1, "name": "Box1", "type": "box", "suppressed": false, "operation": "new_body", "body_names": ["Plate"],
|
||||
"corner": [0.0, 0.0, 0.0], "length": "30", "width": "20", "height": "10"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "component.insert_design",
|
||||
"params": {
|
||||
"path": "$CASE/plate.solidcraft"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.insert_design",
|
||||
"params": {
|
||||
"path": "$CASE/plate.solidcraft",
|
||||
"reuse": true,
|
||||
"translate": [
|
||||
0,
|
||||
50,
|
||||
0
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a root body moved into a component placed 100 mm along x",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Holder (empty) moved by (100,0,0), then a box 10x10x10 from (0,20,0) moved into it: the body keeps its world place, centre (5,25,5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 9000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 12,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
5.0,
|
||||
25.0,
|
||||
5.0
|
||||
],
|
||||
"volume_mm3": 1000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Holder",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.move",
|
||||
"params": {
|
||||
"occurrence": "Holder:1",
|
||||
"translate": [
|
||||
100,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
20,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Cube"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Cube"
|
||||
],
|
||||
"component": "Holder"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Holder:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "two bodies moved from the root into a component each",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); moving bodies into components keeps them where they are: Arm (20,0,5), Base (0,0,-5), 4000 mm3 each",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"bbox": {
|
||||
"min": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"max": [
|
||||
40,
|
||||
10,
|
||||
10
|
||||
]
|
||||
},
|
||||
"results": [
|
||||
{
|
||||
"step": 8,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
5.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
0.0,
|
||||
-5.0,
|
||||
0.0
|
||||
],
|
||||
"max": [
|
||||
40.0,
|
||||
5.0,
|
||||
10.0
|
||||
]
|
||||
},
|
||||
"volume_mm3": 4000.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
0.0,
|
||||
-5.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
-10.0,
|
||||
-10.0,
|
||||
-10.0
|
||||
],
|
||||
"max": [
|
||||
10.0,
|
||||
10.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
"volume_mm3": 4000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Base:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.paste_new in place of an arm turned 90 degrees, 20 mm up",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); hinge at 90 puts Arm at (0,20,5), box x -5..5, y 0..40; in_place puts the copy where it is in the world, moved (0,0,20): centres (0,0,-5), (0,20,5), (0,20,25): mean (0,13.333,8.333)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 12000.0,
|
||||
"center_of_mass": [
|
||||
0,
|
||||
13.333333,
|
||||
8.333333
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"max": [
|
||||
10,
|
||||
40,
|
||||
30
|
||||
]
|
||||
}
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.paste_new",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"occurrence": "Arm:1",
|
||||
"in_place": true,
|
||||
"translate": [
|
||||
0,
|
||||
0,
|
||||
20
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "component.paste_new of the arm 30 mm along y",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); an independent copy of Arm moved by (0,30,0): centres (0,0,-5), (20,0,5), (20,30,5), 4000 each: total 12000, centre (13.333,10,1.667), box (-10,-10,-10)-(40,35,10)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 12000.0,
|
||||
"center_of_mass": [
|
||||
13.333333,
|
||||
10,
|
||||
1.666667
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"max": [
|
||||
40,
|
||||
35,
|
||||
10
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.paste_new",
|
||||
"params": {
|
||||
"component": "Arm",
|
||||
"translate": [
|
||||
0,
|
||||
30,
|
||||
0
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.check with the arm driven into the block (contact off for the drive)",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; at 60 the corner reaches y = 40 sin60 + 5 cos60 = 37.14 > 30: the pair overlaps; with the set enabled again contact.check lists it",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 17,
|
||||
"json": {
|
||||
"collisions": [
|
||||
{
|
||||
"a": "Arm:1",
|
||||
"b": "Stop:1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.disable_all",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 60
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.check",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.check of two blocks touching face to face, then a drive in that set",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm stands on Base's top face (z = 0, a 10x10 patch): touching is not passing through, so contact.check lists nothing and a drive to 90 is not stopped",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"collisions": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
}
|
||||
],
|
||||
"stopped_by_contact": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 13,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Base",
|
||||
"Arm"
|
||||
],
|
||||
"name": "Face set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.check",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"value": 90,
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.disable_all after a set was enabled, and a 90 degree drive",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; contact off: the drive reaches 90, Arm at (0,20,5) inside the block",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"enabled": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 17,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 18,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.disable_all",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.list",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a contact set stops a 90 degree drive of the arm at the block",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; the drive stops there, fraction \u03b8/90 = 0.45520",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 40.966136
|
||||
}
|
||||
],
|
||||
"stopped_by_contact": {
|
||||
"fraction": 0.455179
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
15.101944,
|
||||
13.112257,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"value": 90,
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.edit renaming one set and deleting another",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; two sets made (contact.create turns contact on), the first renamed 'Arm stop', the second deleted: one set left",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"all": false,
|
||||
"enabled": true,
|
||||
"sets": [
|
||||
{
|
||||
"name": "Arm stop"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Base",
|
||||
"Arm"
|
||||
],
|
||||
"name": "Face set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.edit",
|
||||
"params": {
|
||||
"set": "Stop set",
|
||||
"name": "Arm stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.edit",
|
||||
"params": {
|
||||
"set": "Face set",
|
||||
"delete": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.list",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a suppressed contact set and a 90 degree drive into the block",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; with its only set suppressed nothing stops the drive: 90, Arm at (0,20,5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 17,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.edit",
|
||||
"params": {
|
||||
"set": "Stop set",
|
||||
"suppressed": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.enable_all and a 90 degree drive into the block",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; every occurrence in one set: the block stops the arm at \u03b8 = 40.97 (Base, which Arm only touches, does not)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 14,
|
||||
"json": {
|
||||
"all": true,
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 40.966136
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
15.101944,
|
||||
13.112257,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_all",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.list",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "contact.list after two sets and contact.enable_sets",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Stop: box 50x10x10 from (-10,30,0), grounded; the arm's corner (40,5) turned \u03b8 reaches y = 40 sin \u03b8 + 5 cos \u03b8, which is 30 at \u03b8 = asin(30/\u221a1625) - atan(5/40) = 40.9676; both sets, in the order made, contact enabled for sets, not all",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 13000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"all": false,
|
||||
"enabled": true,
|
||||
"sets": [
|
||||
{
|
||||
"name": "Stop set"
|
||||
},
|
||||
{
|
||||
"name": "Face set"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 50,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
30,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "StopBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Stop",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"StopBox"
|
||||
],
|
||||
"component": "Stop"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Stop:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Arm",
|
||||
"Stop"
|
||||
],
|
||||
"name": "Stop set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.create",
|
||||
"params": {
|
||||
"occurrences": [
|
||||
"Base",
|
||||
"Arm"
|
||||
],
|
||||
"name": "Face set"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "contact.enable_sets",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "contact.list",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an automatic exploded view of scale 2",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); each occurrence moves scale \u00d7 (its centre - the mean of the centres): centres (0,0,-5) and (20,0,5), mean (10,0,0): Base by (-20,0,-10), Arm by (20,0,10); shown, Arm at (40,0,15)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 8,
|
||||
"json": {
|
||||
"moves": [
|
||||
{
|
||||
"translate": [
|
||||
-20.0,
|
||||
0.0,
|
||||
-10.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"translate": [
|
||||
20.0,
|
||||
0.0,
|
||||
10.0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
40.0,
|
||||
0.0,
|
||||
15.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "explode.create",
|
||||
"params": {
|
||||
"name": "Apart",
|
||||
"scale": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "explode.show",
|
||||
"params": {
|
||||
"view": "Apart"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an exploded view moving the arm 30 mm up, shown",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); explode.show places Arm by (0,0,30): centre (20,0,35)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 8,
|
||||
"json": {
|
||||
"moves": [
|
||||
{
|
||||
"translate": [
|
||||
0.0,
|
||||
0.0,
|
||||
30.0
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
35.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "explode.create",
|
||||
"params": {
|
||||
"name": "Up",
|
||||
"moves": [
|
||||
{
|
||||
"occurrence": "Arm:1",
|
||||
"translate": [
|
||||
0,
|
||||
0,
|
||||
30
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "explode.show",
|
||||
"params": {
|
||||
"view": "Up"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "inspect.clearance of the arm lifted 5 mm off the base",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm moved by (0,0,5): its bottom (z 5) is 5 mm above Base's top (z 0) over x 0..10: distance 5",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"overlaps": [],
|
||||
"near": [
|
||||
{
|
||||
"distance_mm": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.move",
|
||||
"params": {
|
||||
"occurrence": "Arm:1",
|
||||
"translate": [
|
||||
0,
|
||||
0,
|
||||
5
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "inspect.clearance",
|
||||
"params": {
|
||||
"clearance": 10
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "inspect.clearance between the arm turned 90 degrees and a grounded block",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a block 10x10x10 from (20,0,0); hinge at 90 puts Arm at x -5..5, y 0..40: the gap to the block's face x = 20 is 15",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 9000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 14,
|
||||
"json": {
|
||||
"overlaps": [],
|
||||
"near": [
|
||||
{
|
||||
"distance_mm": 15.0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
20,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "PostBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Post",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"PostBox"
|
||||
],
|
||||
"component": "Post"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Post:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "inspect.clearance",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"against": [
|
||||
"PostBox"
|
||||
],
|
||||
"clearance": 20
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "inspect.interference of the arm sunk 5 mm into the base",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm moved by (0,0,-5): it shares x 0..10, y -5..5, z -5..0 with Base: 500 mm3, area 2(100+50+50) = 400, centre (5,0,-2.5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"count": 1,
|
||||
"interferences": [
|
||||
{
|
||||
"volume_mm3": 500.0,
|
||||
"area_mm2": 400.0,
|
||||
"center": [
|
||||
5.0,
|
||||
0.0,
|
||||
-2.5
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
0.0,
|
||||
-5.0,
|
||||
-5.0
|
||||
],
|
||||
"max": [
|
||||
10.0,
|
||||
5.0,
|
||||
0.0
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.move",
|
||||
"params": {
|
||||
"occurrence": "Arm:1",
|
||||
"translate": [
|
||||
0,
|
||||
0,
|
||||
-5
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "inspect.interference",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "inspect.interference of the arm standing on the base face to face",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); they meet on a face only: no overlap volume",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 8,
|
||||
"json": {
|
||||
"count": 0,
|
||||
"interferences": []
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "inspect.interference",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an as-built revolute on an arm lifted 20 mm, then driven 90 degrees",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Arm moved by (0,0,20) first, then joint.as_built revolute about z through the origin: it stays at (20,0,25); a drive to 90 turns it to (0,20,25)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
25.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
25.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.move",
|
||||
"params": {
|
||||
"occurrence": "Arm:1",
|
||||
"translate": [
|
||||
0,
|
||||
0,
|
||||
20
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.as_built",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"a": "Base",
|
||||
"b": "Arm",
|
||||
"at": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"name": "Hinge",
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an as-built slider along +x with limits -5..5, driven to 20",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); joint.as_built keeps Arm at (20,0,5); 20 is clamped to 5: centre (25,0,5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 5.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
25.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.as_built",
|
||||
"params": {
|
||||
"type": "slider",
|
||||
"a": "Base",
|
||||
"b": "Arm",
|
||||
"at": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"z": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"name": "Slide",
|
||||
"limits": [
|
||||
[
|
||||
-5,
|
||||
5
|
||||
]
|
||||
],
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Slide",
|
||||
"quiet": true,
|
||||
"value": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a ball joint driven to yaw 90 and pitch 90",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); ball with frame z = +z, x = +x: M = Rz(yaw)\u00b7Ry(pitch)\u00b7Rz(roll); Ry(90): (x,y,z) -> (z,y,-x), then Rz(90): (x,y) -> (-y,x): (20,0,5) -> (5,0,-20) -> (0,5,-20); box x -5..5, y 0..10, z -40..0",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
},
|
||||
{
|
||||
"value": 90.0
|
||||
},
|
||||
{
|
||||
"value": 0.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
5.0,
|
||||
-20.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
-5.0,
|
||||
0.0,
|
||||
-40.0
|
||||
],
|
||||
"max": [
|
||||
5.0,
|
||||
10.0,
|
||||
0.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "ball",
|
||||
"name": "Socket",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"frame": {
|
||||
"origin": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"frame": {
|
||||
"origin": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Socket",
|
||||
"quiet": true,
|
||||
"values": [
|
||||
90,
|
||||
90,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a knife follower on an eccentric disc cam, the cam turned 180 degrees",
|
||||
"source": "analytic",
|
||||
"method": "an eccentric disc cam (radius 10, centre 5 off its shaft on z through the origin) with a knife follower on a slider along +x through the shaft, touching at x = 15; the knife's distance at cam turn \u03c6 is s(\u03c6) = e cos \u03c6 + \u221a(R\u00b2 - e\u00b2 sin\u00b2 \u03c6) (e 5, R 10): rise s(0) - s(180) = 15 - 5 = 10; at 180 the knife is at s = 5, 10 mm in: the tappet's centre (20,0,2.5) -> (10,0,2.5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 5770.796,
|
||||
"results": [
|
||||
{
|
||||
"step": 13,
|
||||
"json": {
|
||||
"lift": {
|
||||
"rise": 10.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
10.0,
|
||||
0.0,
|
||||
2.5
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.cylinder",
|
||||
"params": {
|
||||
"radius": 10,
|
||||
"height": 5,
|
||||
"base": [
|
||||
5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"axis": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Disc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 4,
|
||||
"height": 5,
|
||||
"corner": [
|
||||
15,
|
||||
-2,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Tappet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Cam",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Disc"
|
||||
],
|
||||
"component": "Cam"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Follower",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Tappet"
|
||||
],
|
||||
"component": "Follower"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Shaft",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Cam",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "slider",
|
||||
"name": "Lift",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
15,
|
||||
0,
|
||||
2.5
|
||||
],
|
||||
"z": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Follower",
|
||||
"point": [
|
||||
15,
|
||||
0,
|
||||
2.5
|
||||
],
|
||||
"z": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.cam",
|
||||
"params": {
|
||||
"a": "Shaft",
|
||||
"b": "Lift",
|
||||
"profile": {
|
||||
"edges": [
|
||||
[
|
||||
15,
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"occurrence": "Cam"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Shaft",
|
||||
"quiet": true,
|
||||
"value": 180
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Follower:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a knife follower on an eccentric disc cam, the cam turned 90 degrees",
|
||||
"source": "analytic",
|
||||
"method": "an eccentric disc cam (radius 10, centre 5 off its shaft on z through the origin) with a knife follower on a slider along +x through the shaft, touching at x = 15; the knife's distance at cam turn \u03c6 is s(\u03c6) = e cos \u03c6 + \u221a(R\u00b2 - e\u00b2 sin\u00b2 \u03c6) (e 5, R 10): rise s(0) - s(180) = 15 - 5 = 10; at 90 the knife meets the disc where \u03c6 = -90 in the cam's frame: s = \u221a(100 - 25) = 8.66025: tappet centre x 20 + (8.66025 - 15)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 5770.796,
|
||||
"results": [
|
||||
{
|
||||
"step": 13,
|
||||
"json": {
|
||||
"lift": {
|
||||
"rise": 10.0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
13.660254,
|
||||
0.0,
|
||||
2.5
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.cylinder",
|
||||
"params": {
|
||||
"radius": 10,
|
||||
"height": 5,
|
||||
"base": [
|
||||
5,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"axis": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Disc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 4,
|
||||
"height": 5,
|
||||
"corner": [
|
||||
15,
|
||||
-2,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "Tappet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Cam",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Disc"
|
||||
],
|
||||
"component": "Cam"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Follower",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"Tappet"
|
||||
],
|
||||
"component": "Follower"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Shaft",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Cam",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "slider",
|
||||
"name": "Lift",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
15,
|
||||
0,
|
||||
2.5
|
||||
],
|
||||
"z": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Follower",
|
||||
"point": [
|
||||
15,
|
||||
0,
|
||||
2.5
|
||||
],
|
||||
"z": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.cam",
|
||||
"params": {
|
||||
"a": "Shaft",
|
||||
"b": "Lift",
|
||||
"profile": {
|
||||
"edges": [
|
||||
[
|
||||
15,
|
||||
0,
|
||||
0
|
||||
]
|
||||
],
|
||||
"occurrence": "Cam"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Shaft",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Follower:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a revolute between Gear and a free peg beside a grounded hinge chain",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0), here G2 joins a free Peg (not Base) to Gear while Hinge joins Arm to grounded Base: the Peg-Gear chain reaches nothing fixed, so a drive answers moved: false and Gear stays at (65,0,5)",
|
||||
"body_count": 4,
|
||||
"volume_mm3": 9064.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"moved": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 17,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
65.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 18,
|
||||
"json": {
|
||||
"floating": [
|
||||
{
|
||||
"joints": [
|
||||
"G2"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
60,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "GearBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Gear",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"GearBox"
|
||||
],
|
||||
"component": "Gear"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 4,
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"corner": [
|
||||
48,
|
||||
-2,
|
||||
-14
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "PegBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Peg",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"PegBox"
|
||||
],
|
||||
"component": "Peg"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "G2",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Peg",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Gear",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "G2",
|
||||
"value": 90,
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Gear:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.list",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a cylindrical joint about z driven to 90 degrees and 7 mm",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); cylindrical about z: M = Rz(90)\u00b7T(0,0,7): (20,0,5) -> (20,0,12) -> (0,20,12)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
},
|
||||
{
|
||||
"value": 7.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
12.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
-5.0,
|
||||
0.0,
|
||||
7.0
|
||||
],
|
||||
"max": [
|
||||
5.0,
|
||||
40.0,
|
||||
17.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "cylindrical",
|
||||
"name": "Spindle",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Spindle",
|
||||
"quiet": true,
|
||||
"values": [
|
||||
90,
|
||||
7
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a revolute driven 90 degrees, then deleted",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); after joint.delete the design has no joints and no links; Arm keeps the placement it had: (0,20,5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"joints": [],
|
||||
"links": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.delete",
|
||||
"params": {
|
||||
"joint": "Hinge"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.list",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a motion link deleted, then its driver turned",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0); link Hinge -> G2 (ratio 1) deleted (link 0): Hinge 30 leaves G2 at 0, Gear at (65,0,5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 9000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"links": []
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 17,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
65.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
60,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "GearBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Gear",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"GearBox"
|
||||
],
|
||||
"component": "Gear"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "G2",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Gear",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.motion_link",
|
||||
"params": {
|
||||
"a": "Hinge",
|
||||
"b": "G2",
|
||||
"ratio": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.delete",
|
||||
"params": {
|
||||
"link": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.list",
|
||||
"params": {}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 30
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Gear:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "joint.edit flip: false on a revolute made with flip: true",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); frame x = +x, z = +z at the origin on both sides; unflipped, B's frame is turned by diag(1,-1,-1) in A's, a half turn about world x: (20,0,5) -> (20,0,-5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 9,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
-5.0
|
||||
],
|
||||
"bbox": {
|
||||
"min": [
|
||||
0.0,
|
||||
-5.0,
|
||||
-10.0
|
||||
],
|
||||
"max": [
|
||||
40.0,
|
||||
5.0,
|
||||
0.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"frame": {
|
||||
"origin": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"frame": {
|
||||
"origin": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"x": [
|
||||
1,
|
||||
0,
|
||||
0
|
||||
]
|
||||
}
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.edit",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"flip": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "joint.edit offset 3 on a revolute",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); the offset moves B's frame 3 mm up A's z: (20,0,5) -> (20,0,8); a drive to 90 then gives (0,20,8)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
8.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"values": [
|
||||
{
|
||||
"value": 90.0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 12,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
0.0,
|
||||
20.0,
|
||||
8.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.edit",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"offset": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 90
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a suppressed revolute driven 90 degrees",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); a suppressed joint can move nothing: the drive answers moved: false and Arm stays at (20,0,5)",
|
||||
"body_count": 2,
|
||||
"volume_mm3": 8000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 10,
|
||||
"json": {
|
||||
"moved": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 11,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
20.0,
|
||||
0.0,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.edit",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"suppressed": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"value": 90,
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "an internal gear pair (a ring gear), radii 10 and 20",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0); internal: ratio +ra/rb = +0.5, Hinge 60 turns G2 +30: Gear centre (50 + 15 cos30, 15 sin30, 5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 9000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 13,
|
||||
"json": {
|
||||
"ratio": 0.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
62.990381,
|
||||
7.5,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
60,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "GearBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Gear",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"GearBox"
|
||||
],
|
||||
"component": "Gear"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "G2",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Gear",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.gear",
|
||||
"params": {
|
||||
"a": "Hinge",
|
||||
"b": "G2",
|
||||
"ra": 10,
|
||||
"rb": 20,
|
||||
"internal": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 60
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Gear:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"sources": [],
|
||||
"what": "a gear pair of pitch radii 10 and 20, the driver turned 60 degrees",
|
||||
"source": "analytic",
|
||||
"method": "Base: box 20x20x10 from (-10,-10,-10), grounded; Arm: box 40x10x10 from (0,-5,0), centre (20,0,5); Gear: box 10x10x10 from (60,-5,0), centre (65,0,5), on revolute G2 about z through (50,0,0); joint.gear Hinge -> G2, ra 10, rb 20: ratio -ra/rb = -0.5, so Hinge 60 turns G2 -30: Gear centre (50 + 15 cos(-30), 15 sin(-30), 5)",
|
||||
"body_count": 3,
|
||||
"volume_mm3": 9000.0,
|
||||
"results": [
|
||||
{
|
||||
"step": 13,
|
||||
"json": {
|
||||
"ratio": -0.5
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 15,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
62.990381,
|
||||
-7.5,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"step": 16,
|
||||
"json": {
|
||||
"total": {
|
||||
"center_of_mass": [
|
||||
10.0,
|
||||
17.320508,
|
||||
5.0
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
{
|
||||
"commands": [
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 20,
|
||||
"width": 20,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
-10,
|
||||
-10,
|
||||
-10
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "BaseBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 40,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
0,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "ArmBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Base",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"BaseBox"
|
||||
],
|
||||
"component": "Base"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Arm",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"ArmBox"
|
||||
],
|
||||
"component": "Arm"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.ground",
|
||||
"params": {
|
||||
"occurrence": "Base:1",
|
||||
"grounded": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "solid.box",
|
||||
"params": {
|
||||
"length": 10,
|
||||
"width": 10,
|
||||
"height": 10,
|
||||
"corner": [
|
||||
60,
|
||||
-5,
|
||||
0
|
||||
],
|
||||
"operation": "new",
|
||||
"body_name": "GearBox"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.create",
|
||||
"params": {
|
||||
"name": "Gear",
|
||||
"parent": "root",
|
||||
"activate": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "component.move_bodies",
|
||||
"params": {
|
||||
"bodies": [
|
||||
"GearBox"
|
||||
],
|
||||
"component": "Gear"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "Hinge",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Arm",
|
||||
"point": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.create",
|
||||
"params": {
|
||||
"type": "revolute",
|
||||
"name": "G2",
|
||||
"flip": true,
|
||||
"a": {
|
||||
"occurrence": "Base",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"b": {
|
||||
"occurrence": "Gear",
|
||||
"point": [
|
||||
50,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"z": [
|
||||
0,
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"quiet": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.gear",
|
||||
"params": {
|
||||
"a": "Hinge",
|
||||
"b": "G2",
|
||||
"ra": 10,
|
||||
"rb": 20
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "joint.drive",
|
||||
"params": {
|
||||
"joint": "Hinge",
|
||||
"quiet": true,
|
||||
"value": 60
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Gear:1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"command": "occurrence.properties",
|
||||
"params": {
|
||||
"occurrence": "Arm:1"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loaded 100 of 800 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user