diff --git a/frontend/js/labs/stereo.js b/frontend/js/labs/stereo.js index bca4249..0c7f9ba 100644 --- a/frontend/js/labs/stereo.js +++ b/frontend/js/labs/stereo.js @@ -247,6 +247,7 @@ class StereoSim { /* state */ this.figureType = 'cube'; this.params = { a: 4, b: 3, c: 5, h: 5, r: 2, R: 3, n: 4 }; + this.showFigure = true; // master: show/hide the solid itself (faces+edges+vertices+labels) this.showEdges = true; this.showVertices = true; this.showLabels = true; @@ -369,6 +370,7 @@ class StereoSim { setFigure(type) { this.figureType = type; + this.showFigure = true; this._figGroup.visible = true; this._labelGroup.visible = true; this._unfold = false; this._unfoldProgress = 0; this._unfoldTarget = 0; this.showSection = false; this.showInscribed = false; this.showCircumscribed = false; @@ -423,6 +425,7 @@ class StereoSim { this._buildFigure(); } + toggleFigure(v) { this.showFigure = v; this._figGroup.visible = v; this._labelGroup.visible = v; this._invalidate(); } toggleEdges(v) { this.showEdges = v; this._buildFigure(); } toggleVertices(v) { this.showVertices = v; this._buildFigure(); } toggleLabels(v) { this.showLabels = v; this._buildFigure(); this._rebuildConstructions(); } @@ -4895,6 +4898,7 @@ class StereoSim { ['stg-height','stg-apothem','stg-diagonals','stg-midpoints','stg-inscribed','stg-circumscribed','stg-edgelengths'].forEach(id => { document.getElementById(id)?.classList.remove('on'); }); + document.getElementById('stg-figure')?.classList.add('on'); // new figure → visible _stereoDeactivateTools(); } } @@ -4978,6 +4982,7 @@ class StereoSim { const on = !toggle.classList.contains('on'); toggle.classList.toggle('on', on); if (!stereoSim) return; + if (layer === 'figure') stereoSim.toggleFigure(on); if (layer === 'edges') stereoSim.toggleEdges(on); if (layer === 'vertices') stereoSim.toggleVertices(on); if (layer === 'labels') stereoSim.toggleLabels(on); diff --git a/frontend/labs-bodies.html b/frontend/labs-bodies.html index 1a8de15..dcf3bea 100644 --- a/frontend/labs-bodies.html +++ b/frontend/labs-bodies.html @@ -3569,6 +3569,10 @@