Feedback system¶
The LayerFeedback.h
module handles the computation of all essential data required to deliver visual guidance to the user during the fabrication process. To compute feedback, information is primarily retrieved from two preceding layers:
LayerModel.h
: Contains the execution model and the geometries associated with the currently active hole or cut (viaAC_FF_COMP
macro).LayerToolhead.h
: Provides similar information, but specific to the current toolhead attached to the tool (viaAC_FF_TOOL
macro).
The LayerFeedback::OnFrameStart() from the LayerFeedback.h
simply activates the feedback set based on the correct toolhead based on the current fabrication element.
Toolhead | Hole | Cut |
---|---|---|
Chainsaw | ❌ | ✅ |
Circualr Saw | ❌ | ✅ |
Drill meshes | ✅ | ❌ |
Once the correct feedback is indetified, we have all the geometries of the joint or hole we are working on, as well as the geometries of the toolhead attached to the tool, we can compute all the relevant computations to build the feedback set: starting distance, depth, orientation, etc. In the layer LayerFeedback.h
not only we calculate these values but we generate all the necessary GOs to visualize them in the AR scene.
FabFeedback
interface¶
Feedback is categorized by similar operations:
- drilling (
HoleFeedback.h
), - circular cutting (
CutCircularSawFeedback.h
), - and chainsaw cutting (
CutChainSawFeedback.h
).
Each feedback category inherits from an interface class (AIAC/Feedback/FabFeedback.h
), which provides top-level control functions such as Update()
, Activate()
, and Deactivate()
.
Tip
The Update()
function is called at each frame to update the feedback data, while Activate()
and Deactivate()
are used to enable/disable the feedback visualization.
FeedbackVisualizer
widgets¶
Each tool's visual guidance might consists of multiple visual cues, most of which are built on the template FeedbackVisualizer.h
. All the feedback values are computed but also visualized as GOs, and stored inside (m_AllPrimitives
). This is convinient as we can easily toggle the visibility of the feedback by calling the Activate()
/Deactivate()
functions.
Example
As an example, the circular saw feedback has several VisualFeedback
classes that inherit from FeedbackVisualizer
to manage the visualization of the feedback. In the case of the circular saw, we have the following VisualFeedback
classes:
VisualFeedback class | Description |
---|---|
class CutCircularSawDepthVisualizer | it visualizes the height of the blade in relation to the lap joint |
class CutCircularSawPositionStartVisualizer | it visualizes the starting position of the cut as a text in millimeters and as a green line for graphical correction |
class CutCircularOrientationVisualizer | it visualizes the correct orientation of the cut as a text in millimeters and as a green line for graphical correction |
class CircularSawCutPlaneVisualizer : public CutPlaneVisualizer | in this case it still inherits from FeedbackVisualizer the CutPlaneVisualizer , but since it is employed also by other tools (e.g. chainsaw), the sub-class already presents some common parameters and visual cues for the plane corresponding to the blade |
class CircularSawCutBladeThicknessVisualizer | it visualizes the thickness of the blade as two red lines |
All the VisualFeedback
are not active all the time at the same time during a fabrication. Depending on which scenario is detected, they are activated (visible) or deactivated (not visible).
Here's an example of the CutCircularSawFeedback
class in action for a typical circular saw cutting sequence:
This composite system allows for a flexible and modular feedback system that can be easily extended with new feedback types and visualizations.