Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/Mod/VibeCAD/VibeCADGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,6 +2330,28 @@ def _format_progress_event(event: dict[str, Any]) -> str:
phase = str(event.get("phase") or "work").replace("_", " ")
elapsed = float(event.get("elapsed_seconds", 0.0) or 0.0)
return f"VibeScript {phase} completed in {elapsed:.2f}s."
if name == "vibescript_domain_worker_progress":
phase = str(event.get("phase") or "work")
item = event.get("item_progress")
if (
phase == "simulation_collision"
and isinstance(item, dict)
and item.get("kind") == "collision_frame"
):
completed = max(0, int(item.get("completed") or 0))
total = max(0, int(item.get("total") or 0))
percent = round(100.0 * completed / total) if total else 0
message = (
f"Checking motion collisions: frame {completed} of {total} "
f"({percent}%)"
)
remaining = item.get("estimated_remaining_seconds")
if isinstance(remaining, (int, float)) and remaining >= 0:
minutes = max(1, round(float(remaining) / 60.0))
unit = "minute" if minutes == 1 else "minutes"
message += f" - about {minutes} {unit} remaining"
return message
return f"VibeScript {phase.replace('_', ' ')}..."
if name == "vibescript_domain_deferred_recompute_completed":
count = int(event.get("target_count", 0) or 0)
elapsed = float(event.get("elapsed_seconds", 0.0) or 0.0)
Expand Down Expand Up @@ -2383,6 +2405,7 @@ def _format_progress_event(event: dict[str, Any]) -> str:
"vibescript_domain_deferred_recompute_completed",
"vibescript_domain_phase_completed",
"vibescript_domain_phase_started",
"vibescript_domain_worker_progress",
}


Expand Down
8 changes: 8 additions & 0 deletions src/Mod/VibeCAD/VibeCADMechanismEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ def normalize_mechanism_scenario(value: Any) -> dict[str, Any]:
"frames_per_second",
}
),
optional=frozenset({"collision_mode"}),
)
raw_motion_ids = simulation_raw["motion_ids"]
if (
Expand Down Expand Up @@ -886,6 +887,12 @@ def normalize_mechanism_scenario(value: Any) -> dict[str, Any]:
"scenario.simulation",
"contains invalid time or tolerance bounds",
)
collision_mode = str(simulation_raw.get("collision_mode") or "full")
if collision_mode not in {"full", "off"}:
raise _error(
"scenario.simulation.collision_mode",
"must be full or off",
)
estimated_frames = math.ceil((end - start) / step) + 2
if (
estimated_frames > 10_000
Expand All @@ -910,6 +917,7 @@ def normalize_mechanism_scenario(value: Any) -> dict[str, Any]:
"time_step_s": step,
"error_tolerance": tolerance,
"frames_per_second": frames_per_second,
"collision_mode": collision_mode,
}
elif motions:
raise _error(
Expand Down
Loading
Loading