Add section view feature for 3D canvas (#15879)

This commit is contained in:
Ian Bassi
2026-10-02 11:50:43 -03:00
committed by GitHub
parent 6c6e8be43d
commit a1ad2b4425
31 changed files with 599 additions and 612 deletions
+9
View File
@@ -1782,6 +1782,15 @@ void GCodeViewer::set_tone(float exposure, float saturation)
m_viewer.set_tone(exposure, saturation);
}
void GCodeViewer::set_clipping_plane(const ClippingPlane& plane)
{
// Flipped to match ClippingPlane::distance().
const Vec3f normal = -plane.get_normal().cast<float>();
m_viewer.set_clipping_plane(plane.is_active() ?
std::array<float, 4>{ normal.x(), normal.y(), normal.z(), float(plane.get_offset()) } :
std::array<float, 4>{ 0.0f, 0.0f, 0.0f, 1.0f });
}
void GCodeViewer::render_overlay(int canvas_width, int canvas_height, int right_margin)
{
if (m_viewer.get_extrusion_roles().empty())