CadHub Customizer #461
Reference in New Issue
Block a user
Delete Branch "kurt/cadhub-customizer-test-code-437"
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?
Start of implementation of the CadHub customizer
follows https://github.com/Irev-Dev/cadhub/discussions/437
The idea is there is a consistent customizer on Cadhub that will work with multiple integrations.
So far this implements sting number and boolean for JSCAD, (and should work with OpenSCAD but that work is ongoing see: https://github.com/openscad/openscad/issues/3801)
It would be good to get select and groups working before we release the JSCAD integration, but I'm okay if that's added later.
@@ -0,0 +32,4 @@| CadhubNumberParam// OpenSCADconst openscadValues = `The following is just here to test implementation for OpenSCAD and will be removed later.
@@ -81,0 +105,4 @@script: code,params: parameters || {},url: 'jscad_script',})fundamentally i haven't changed how your code works, I just wanted to group things a little better in this file as I found some of the module level variables hard to keep track of and so instead moved some of the stuff that required state into this class. Plus one other thing that made me uncomfortable was how the function awaited a promise just to return another module level variable
response.This render function now sets up promise -> posts a message to the worker -> then returns the promise where the promise now contains the final response. I at least personally find it easier to reason about.
Just passing the response into the
callResolveequivalent so that the promise has the response inside.This is what I mean from this comment https://github.com/Irev-Dev/cadhub/pull/461/files#r692901725 about awaiting a promise just to return a different variable.
@@ -81,0 +105,4 @@script: code,params: parameters || {},url: 'jscad_script',})yes, it looks cleaner. thnx :)
yeah, that was messy. thanks
One issue I am having is that step parameter is not respected. I tried to trace it a bit, but I only found it gets lost and is not present as value in the event handlers. param.step is undefined.
also I think the logic for step will need updating to handle decimal steps.
there is a leftover
console.tracein my jscadcontroller, please remove iunless you need it still.I have tried pointer events, I they work in desktop env, but both your version with pointer lock and pointerevents don't work in mobile emulation for me in chrome.
I actually prefer the pointer lock functionality here, as it leaves the cursor in place.
step is now respected. :)
one minor issue though, step is not respected while dragging ... that is irellevant now, but it may be relevant when/if u implement live update of params option.
looks good aside from minor issue of step not in the preview while dragging slider
I'm not sure the steps should be enforced while the input is being actively dragged, to me it's disrespecting the user by interrupting them to change the input, rather that waiting until they are done to fix the input to match the steps.
I regards to live, I've been having trouble with it. You can see my attempt here https://github.com/Irev-Dev/cadhub/pull/new/kurt/live-customizer-attempt but something's not right, it doesn't always update when it should.
0cc335eis a rebase on main before merging.