Clearing stored parameters #1325
QuirkyCort
started this conversation in
General
Replies: 3 comments
-
adding this to your script after imports could work: localStorage.setItem('jscad:jscad1-design','{}') |
Beta Was this translation helpful? Give feedback.
0 replies
-
I got a "localStorage is not defined". I'm guessing the script is running in a webworker where localStorage isn't available? |
Beta Was this translation helpful? Give feedback.
0 replies
-
oh, dammit. Yes it is running in the worker. Guess that only option is to manually use Reset button. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that when using parameters, JSCAD stores the values in localstorage using the parameter name as key, and reloads it (...overriding the default in getParameterDefinitions) on the next load. This occurs even when a different file is loaded via the URL, so changes to the parameter for one file will affect the next file.
Example:
Load this URL: https://www.openjscad.xyz/?uri=https://raw.githubusercontent.com/QuirkyCort/misc/main/jscad_models/vl53l0x.js
Change the height parameter from the initial value of 15 to 50.
Load this other URL: https://www.openjscad.xyz/?uri=https://raw.githubusercontent.com/QuirkyCort/misc/main/jscad_models/gy33.js
The default height value is now 50 for the second file, instead of the default of 18.
Is there a way to force JSCAD to always load the defaults specified in getParameterDefinitions?
Beta Was this translation helpful? Give feedback.
All reactions