forked from 1b-agent/fieldcraft-upstream
Meshing test corpus built with SolidCraft; assembly placement in open_design (#11)
* geometry: build designs from SolidCraft command scripts (feature scripts) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * geometry: place component bodies through their occurrences when opening a design An assembly's instances were missing and moved components sat at their own origin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * Meshing test corpus: 16 SolidCraft recipes, analytic shapes, loader and runner modelcraft-testkit holds the corpus (tests/corpus/<name>/recipe.json run through SolidCraft's engine, then opened as a design) and the runner binary behind cargo xtask corpus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * docs: corpus results, test corpus architecture and the scripts feature; licences Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * corpus: measure each body once, check stage widths, simpler loader and runner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm --------- Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
49 files changed
+1770
-84
No files matched your search
@@ -18,7 +18,8 @@ pub const MAX_DESIGN_BYTES: usize = solidcraft_io::MAX_DESIGN_BYTES;
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Design {
|
||||
pub name: String,
|
||||
/// The bodies at the end of the timeline, in the design's order.
|
||||
/// The bodies at the end of the timeline, in the design's order, placed in the world: bodies of
|
||||
/// components moved by their occurrences, one body per placement.
|
||||
pub bodies: Vec<Shape>,
|
||||
/// Features that failed to rebuild. The design still opens with the bodies the rest made,
|
||||
/// as it does in SolidCraft.
|
||||
@@ -63,7 +64,9 @@ pub(crate) fn rebuild(doc: &Document) -> Result<Design> {
|
||||
.filter(|r| !r.skipped)
|
||||
.filter_map(|r| r.error.as_ref().map(|e| FeatureError { feature: r.name.clone(), message: e.clone() }))
|
||||
.collect();
|
||||
let state = model.state();
|
||||
// Placed in the world: a component's bodies through every occurrence of it (an instance is a
|
||||
// body of its own, named after its occurrence path), as SolidCraft displays and exports them.
|
||||
let state = guard("place components", || Ok(solidcraft_doc::world_state(doc, &model.state())))?;
|
||||
let mut bodies = Vec::with_capacity(state.bodies.len());
|
||||
for b in &state.bodies {
|
||||
let faces = guard("name faces", || {
|
||||
|
||||
Reference in new issue
Block a user