Skip to content

Latest commit

 

History

History
115 lines (84 loc) · 10 KB

File metadata and controls

115 lines (84 loc) · 10 KB

OpenSCADDesigns Devlog

Testing / Automation

As of [2023-07-09], test.bat will use find (location specified by %UNIX_FIND_EXE%) to find all .scad files and attempt to evaluate them.

A nicer system would cache results and pass in every defined preset for each OpenSCAD design.

Automated rendering

A reminder to myself about OpenSCAD.com command-line arguments.

STLs and renders can be generated from the command-line, like

"C:\Program Files\OpenSCAD\openscad.com" -p 2023\togridpile\TGx9.4.json -P p1706 ^
	--render 2023\togridpile\TGx9.4.scad ^
	-o output/p1706.1536x1536.png ^
	-o output/p1706.stl ^
	--colorscheme "Tomorrow Night" ^
	--imgsize 1536,1536

[2023-07-09] Thoughts on improved testing system

Idea would be to uniquely identify a .scad design based on the hash of the file and of all its dependencies, and results cached based on that hash.

For a given version of the repository, generation of those hashes could be done in a pipeliney way:

  • List files (basically ‘find’)
  • Hash files, list out filename + hash (‘ccouch3 id -show-inputs’ may already do this!)
  • Parse files, list dependencies
  • Recursively generate hashes for each file based on hash + hash of dependencies

[2025-01-15] - Pegboard Hooks Got Broken

Something between 8438ceeb68b944be641d5ae15bca63b42976804a..294a3c90dbdb5dd66637c7afb662d7e8f1df4489 seems to have broken the angled pegboard hook of 2023/experimental/PegboardHook0.scad.

  • Git bisect to the rescue
  • Looks like it was 8d391050d1baab058ceea2428db064ca9f2ec14a (which looks similar to but is NOT the same as the first ‘good’ commit)
  • Seems togpath1__fix_rath somehow breaks something, or it fixes a bug that those pegboard hook polygons relied on
  • Changing first line of `togpath1__merge_offsets` shouldn’t, but does, make the pegboard hook show up:
  • Something is getting hosed up when there are trailing offsets.
  • 2ae543365f7ce9a3ec96b066012ec827178aa364 (earlier) broke some assertion about qaths in TOGPath1.scad
    • 10353606d263765c651bb1c18df4741fa19e219e may fix this
  • Back to 20250115-rath-debug and cherry-pick that fix
    • TOGPath1.scad seems happy now
  • Guess I should rebase 20250115-rath-debug onto master, now
  • This still doesn’t fix the angled-shelf-holder.

c8c33e36bf16337e0982983457b15c99d44596f5 - Echo pbh0_render_shape’s input/output

I’m noticing a lot of NaNs.

ECHO: 36.8699
ECHO: shape = ["open-path", ["togpath1-rath", ["togpath1-rathnode", [-6.35, 6.35]], ["togpath1-rathnode", [-6.35, 0], ["round", 4.7625]], ["togpath1-rathnode", [1.5875, 0]]]], rendert = ["polygon-vp", [[-6.36587, 7.9375], [-6.58954, 7.9215], [-6.80865, 7.87384], [-7.01875, 7.79548], [-7.21556, 7.68801], [-7.39507, 7.55363], [-7.55363, 7.39507], [-7.68801, 7.21556], [-7.79548, 7.01875], [-7.87384, 6.80865], [-7.9215, 6.58954], [-7.9375, 6.36587], [-7.9375, 4.7058], [-7.87688, 3.85822], [-7.68417, 2.97236], [-7.36735, 2.12293], [-6.93287, 1.32724], [-6.38957, 0.601479], [-5.74852, -0.0395744], [-5.02276, -0.582871], [-4.22707, -1.01735], [-3.37764, -1.33417], [-2.49178, -1.52688], [-1.6442, -1.5875], [1.60338, -1.5875], [1.82704, -1.5715], [2.04615, -1.52384], [2.25625, -1.44548], [2.45306, -1.33801], [2.63257, -1.20363], [2.79113, -1.04507], [2.92551, -0.86556], [3.03298, -0.668752], [3.11134, -0.458653], [3.159, -0.239541], [3.175, -0.015875], [3.175, 0.015875], [3.159, 0.239541], [3.11134, 0.458653], [3.03298, 0.668752], [2.92551, 0.86556], [2.79113, 1.04507], [2.63257, 1.20363], [2.45306, 1.33801], [2.25625, 1.44548], [2.04615, 1.52384], [1.82704, 1.5715], [1.60338, 1.5875], [-1.5308, 1.5875], [-2.03877, 1.62383], [-2.48086, 1.72], [-2.90476, 1.87811], [-3.30184, 2.09493], [-3.66403, 2.36606], [-3.98394, 2.68597], [-4.25507, 3.04816], [-4.47189, 3.44524], [-4.63, 3.86914], [-4.72617, 4.31123], [-4.7625, 4.8192], [-4.7625, 6.36587], [-4.7785, 6.58954], [-4.82616, 6.80865], [-4.90452, 7.01875], [-5.01199, 7.21556], [-5.14637, 7.39507], [-5.30493, 7.55363], [-5.48444, 7.68801], [-5.68125, 7.79548], [-5.89135, 7.87384], [-6.11046, 7.9215], [-6.33412, 7.9375]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]]]
ECHO: shape = ["open-path", ["togpath1-rath", ["togpath1-rathnode", [-6.35, 0]], ["togpath1-rathnode", [1.5875, 0]]]],
    rendert = ["polygon-vp", [[nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan], [nan, nan]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]]]

What happens if we revert 8d391050d1baab058ceea2428db064ca9f2ec14a ?

Oh wait, we don’t need to. Just leave off trailing ["offset", 0].

ECHO: 36.8699
ECHO: shape = ["open-path", ["togpath1-rath", ["togpath1-rathnode", [-6.35, 6.35]], ["togpath1-rathnode", [-6.35, 0], ["round", 4.7625]], ["togpath1-rathnode", [1.5875, 0]]]], rendert = ["polygon-vp", [[-6.36587, 7.9375], [-6.58954, 7.9215], [-6.80865, 7.87384], [-7.01875, 7.79548], [-7.21556, 7.68801], [-7.39507, 7.55363], [-7.55363, 7.39507], [-7.68801, 7.21556], [-7.79548, 7.01875], [-7.87384, 6.80865], [-7.9215, 6.58954], [-7.9375, 6.36587], [-7.9375, 4.7058], [-7.87688, 3.85822], [-7.68417, 2.97236], [-7.36735, 2.12293], [-6.93287, 1.32724], [-6.38957, 0.601479], [-5.74852, -0.0395744], [-5.02276, -0.582871], [-4.22707, -1.01735], [-3.37764, -1.33417], [-2.49178, -1.52688], [-1.6442, -1.5875], [1.60338, -1.5875], [1.82704, -1.5715], [2.04615, -1.52384], [2.25625, -1.44548], [2.45306, -1.33801], [2.63257, -1.20363], [2.79113, -1.04507], [2.92551, -0.86556], [3.03298, -0.668752], [3.11134, -0.458653], [3.159, -0.239541], [3.175, -0.015875], [3.175, 0.015875], [3.159, 0.239541], [3.11134, 0.458653], [3.03298, 0.668752], [2.92551, 0.86556], [2.79113, 1.04507], [2.63257, 1.20363], [2.45306, 1.33801], [2.25625, 1.44548], [2.04615, 1.52384], [1.82704, 1.5715], [1.60338, 1.5875], [-1.5308, 1.5875], [-2.03877, 1.62383], [-2.48086, 1.72], [-2.90476, 1.87811], [-3.30184, 2.09493], [-3.66403, 2.36606], [-3.98394, 2.68597], [-4.25507, 3.04816], [-4.47189, 3.44524], [-4.63, 3.86914], [-4.72617, 4.31123], [-4.7625, 4.8192], [-4.7625, 6.36587], [-4.7785, 6.58954], [-4.82616, 6.80865], [-4.90452, 7.01875], [-5.01199, 7.21556], [-5.14637, 7.39507], [-5.30493, 7.55363], [-5.48444, 7.68801], [-5.68125, 7.79548], [-5.89135, 7.87384], [-6.11046, 7.9215], [-6.33412, 7.9375]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71]]]
ECHO: shape = ["open-path", ["togpath1-rath", ["togpath1-rathnode", [-6.35, 0]], ["togpath1-rathnode", [1.5875, 0]]]],
    rendert = ["polygon-vp", [[-7.9375, -0.015875], [-7.9215, -0.239541], [-7.87384, -0.458653], [-7.79548, -0.668752], [-7.68801, -0.86556], [-7.55363, -1.04507], [-7.39507, -1.20363], [-7.21556, -1.33801], [-7.01875, -1.44548], [-6.80865, -1.52384], [-6.58954, -1.5715], [-6.36587, -1.5875], [1.60338, -1.5875], [1.82704, -1.5715], [2.04615, -1.52384], [2.25625, -1.44548], [2.45306, -1.33801], [2.63257, -1.20363], [2.79113, -1.04507], [2.92551, -0.86556], [3.03298, -0.668752], [3.11134, -0.458653], [3.159, -0.239541], [3.175, -0.015875], [3.175, 0.015875], [3.159, 0.239541], [3.11134, 0.458653], [3.03298, 0.668752], [2.92551, 0.86556], [2.79113, 1.04507], [2.63257, 1.20363], [2.45306, 1.33801], [2.25625, 1.44548], [2.04615, 1.52384], [1.82704, 1.5715], [1.60338, 1.5875], [-6.36587, 1.5875], [-6.58954, 1.5715], [-6.80865, 1.52384], [-7.01875, 1.44548], [-7.21556, 1.33801], [-7.39507, 1.20363], [-7.55363, 1.04507], [-7.68801, 0.86556], [-7.79548, 0.668752], [-7.87384, 0.458653], [-7.9215, 0.239541], [-7.9375, 0.015875]], [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47]]]

So something inside ‘open-path’ handling

More debugging. Add a open_path_rath_polypoints. Look at the second one that’s output:

Without trailing zero offset:

ECHO: input_rath = ["togpath1-rath", ["togpath1-rathnode", [-6.35, 0]], ["togpath1-rathnode", [1.5875, 0]]], r = 1.5875, open_path_rath_polypoints = [[-6.35, 0], [1.5875, 0]]

With trailing zero offset:

ECHO: input_rath = ["togpath1-rath", ["togpath1-rathnode", [-6.35, 0]], ["togpath1-rathnode", [1.5875, 0]]], r = 1.5875, open_path_rath_polypoints = [[nan, nan], [nan, nan]]

That’s falsch!

But what is togpath1_rath_to_polypoints supposed to do when only two points are passed in??

It seems like I was abusing the function.

Normally any ops applied to a rath with only two segments wouldn’t make sense. PegboardHook0 is taking advantage of even degenerate raths keeping their points when no ops are applied.

Ultimately it’s togpath1__offset_vector that tries to apply an offset to a point between two others. Updating this function to return the original point when offset is zero fixes things.

With that figured out, I went ahead and changed togpath1__merge_offsets to omit trailing ["offset", 0], because in most cases it was adding those offsets itself.