Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start the toolpath simulation.
CNC Programming
start_simulation([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing simulation speed instead of toolpath data.
Using machine state which is not the input for simulation start.
✗ Incorrect
The simulation starts by passing the toolpath data to the start_simulation function.
2fill in blank
mediumComplete the code to check if the simulation detected any collisions.
CNC Programming
if simulation_result.[1]():
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using has_errors which checks for general errors, not collisions.
Using detect_collision which is not a method of simulation_result.
✗ Incorrect
The method collision_detected() returns True if any collision was found during simulation.
3fill in blank
hardFix the error in the code to correctly retrieve the simulation time.
CNC Programming
total_time = simulation.[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using total_time() which is not defined.
Accessing simulation_time attribute which may not exist.
✗ Incorrect
The method get_total_time() correctly returns the total simulation time as a value.
4fill in blank
hardFill both blanks to filter and store only safe toolpath points.
CNC Programming
safe_points = [point for point in toolpath if point.[1]() and not point.[2]()]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using is_valid which may not check bounds.
Using is_error which is too general.
✗ Incorrect
We keep points that are within bounds and exclude those that are collision points.
5fill in blank
hardFill all three blanks to create a dictionary of points with their status if safe.
CNC Programming
point_status = [1]: [2] for [3] in toolpath if [3].is_within_bounds()}}
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'point' as loop variable but not matching keys and values.
Using point object as key which is not hashable.
✗ Incorrect
We use p.id as key, p.status as value, and 'p' as the loop variable name.