Initial support for OpenSCAD's customizer #477
Reference in New Issue
Block a user
Delete Branch "kurt/320-openscad-parms-demo-rebase"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds initial support for OpenSCAD's customizer 🙌
And also adds a select input for both SCAD and JSCAD from @hrgdavor.
I expect there to be a few quirks with this that will still need to be resolved, happy to merge with some quirks, just depending on how bad they are and we can fix later.
Preview links:
OpenSCAD
JSCAD
Resolves #320
Resolves #476
@@ -22,3 +39,4 @@)return { consoleMessage, fullPath }} catch (error) {return { error, fullPath }I had been storing the output logs from running CQ and OpenSCAD in s3 as metadata, and had planned to do the same thing with the customizer params, but realised this wasn't going to work since there is a tiny 2kb limit and that was already causing problems https://github.com/Irev-Dev/cadhub/issues/476
So now instead I'm concatenating the gzip file with and metadata (params and logs), its a little messy to split them apart in the browser but its working.
/var/task/cadhub-concat-splithas a unique string that I sue to split at.@@ -9,3 +6,1 @@[CONSOLE_MESSAGE_KEY]: Buffer.from(consoleMessage, 'utf-8').toString('base64'),async function writeFiles(files = [], tempFile) {Removed code to store things in s3 metadata.
@@ -13,3 +14,4 @@RUN apt-get install -y openscad-nightly# install node14, see comment at the to of node14source_setup.shADD common/node14source_setup.sh /nodesource_setup.shIm replacing the release with the nightly build to keep things simple @t-paul, I didn't want to have to try and figure out to support multiple version right now.
@@ -106,0 +114,4 @@} catch (e) {console.log(json, e)return {}}This is what splits and pulls the json meta off the concatenated file.
the choice input seems to work fine but color for values is a bit too close to the background and bit hard to read

it is likely a simple fix, and would be nice
Also I am not a fan of slider preview not respecting the step, it is a bit annoying for step:10... This one I am fine if you leave it like this, it is just a difference of opinion which is more natural to user, and can easily be changed in the future and is not breaking anything.
@@ -22,3 +39,4 @@)return { consoleMessage, fullPath }} catch (error) {return { error, fullPath }why not use https://www.npmjs.com/package/fflate
I started using it recently (to create 3mf export in my jscad prototype)
no temp file needed, lib is tiny, you can name the files when compressing, and decompressing and will likely be useful in the frontend in the future, so it will not be a bloat :)
... I would not stop this PR because of it, better not do too many things in a single PR. ... but maybe open an issue, so it is in the pipeline for later :)
@@ -106,0 +114,4 @@} catch (e) {console.log(json, e)return {}}it is ok for now, you control both sides, so It can be improved later
last input does not respect the initial value for some reason ...
same happens in jscad
@@ -13,3 +14,4 @@RUN apt-get install -y openscad-nightly# install node14, see comment at the to of node14source_setup.shADD common/node14source_setup.sh /nodesource_setup.shYep, keeping it simpler for now seems a good idea. This version is actively used by people (including myself) so it should be reasonably stable.
Hrg also said to me separately (listing here so I don't loose track):
bgcolor for choice and last input not respecting initial value are important (relates to #472)
my comment on step during preview, not so much, u can ignore taht one
zip also, can be done in another iteration
@@ -22,3 +39,4 @@)return { consoleMessage, fullPath }} catch (error) {return { error, fullPath }I was trying to stick to native browser ungziping things when the request arrives with the correct headers. But something like this might be better
I am not too concerned about finding an optimum solution right now since the next thing on my todo list is investigate performance, and I have a feeling that a lot of backend things might change in the process. Thanks for the lib recommendation.
👍 I'll look into this,
This doesn't happen for me, I'm guessing because this is using the browser native select so default styles vary. Its a dark background for me, Should be an easy fix though.
Confirmed,
This is now ready to merge as far as I am concerned, my other comments can be considered later on