diff --git a/docs/api/printerprofiles.rst b/docs/api/printerprofiles.rst index b22b8a36..668fed5b 100644 --- a/docs/api/printerprofiles.rst +++ b/docs/api/printerprofiles.rst @@ -143,11 +143,12 @@ Profile * - ``volume.width`` - 0..1 - ``float`` - - The width of the print volume + - The width of the print volume. For circular beds, the diameter of the bed. * - ``volume.depth`` - 0..1 - ``float`` - - The depth of the print volume + - The depth of the print volume. For circular beds, this is the diameter of the bed and will be forced to be the same + as ``volume.width`` upon saving. * - ``volume.height`` - 0..1 - ``float`` diff --git a/src/octoprint/printer/profile.py b/src/octoprint/printer/profile.py index 1e7a618a..78d73ac4 100644 --- a/src/octoprint/printer/profile.py +++ b/src/octoprint/printer/profile.py @@ -453,6 +453,10 @@ class PrinterProfileManager(object): if profile["volume"]["formFactor"] == BedTypes.CIRCULAR and not profile["volume"]["origin"] == BedOrigin.CENTER: profile["volume"]["origin"] = BedOrigin.CENTER + # force width and depth of volume to be identical for circular beds, with width being the reference + if profile["volume"]["formFactor"] == BedTypes.CIRCULAR: + profile["volume"]["depth"] = profile["volume"]["width"] + # validate offsets offsets = [] for offset in profile["extruder"]["offsets"]: diff --git a/src/octoprint/static/js/app/viewmodels/printerprofiles.js b/src/octoprint/static/js/app/viewmodels/printerprofiles.js index c9c100d3..074d6db3 100644 --- a/src/octoprint/static/js/app/viewmodels/printerprofiles.js +++ b/src/octoprint/static/js/app/viewmodels/printerprofiles.js @@ -281,6 +281,10 @@ $(function() { } } + if (profile.volume.formFactor == "circular") { + profile.volume.depth = profile.volume.width; + } + return profile; };