Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CascadeStudio models randomly corrupted #36

Open
udif opened this issue Nov 17, 2020 · 1 comment
Open

CascadeStudio models randomly corrupted #36

udif opened this issue Nov 17, 2020 · 1 comment

Comments

@udif
Copy link

udif commented Nov 17, 2020

I started playing with CascadeStudio every since the hackaday article 1-2 months ago, and I really like it.

However, as I try building more complex models I run into geometrical corruption issues, where changing a small parameter controlling the size of an objects can cause total model corruption. sometimes changing the model, evaluating it, and reverting the change fixes the corruption. For my previous model I had to rewrite it for a different platform (www.jscad.xyz), just because CascadeStudio wasn't stable enough.

Today it happened again, so I wanted to share the model to get to the bottom of it. Here is a minimum example from a larger model:


let space_diag = 0.2
let height = 60
let rad_ext = 2.5
let width = 30 - 2 * rad_ext
let line_spacing = 16.5
let axis_d = 0.5 // distance from axis to start of base
let line1_w = 1.6
let line2_w = 2
let grid_angle = (90 - 47.5)
let axis_o = -15.21 

//let holder = Translate([10,10,0], hold_s)
let line_2 = Rotate([1, 0, 0], 180 + grid_angle, Box(2, line2_w + space_diag, 3*width))
let line_1 = Rotate([1, 0, 0], -grid_angle, Box(2, line1_w + space_diag, 3*width))

let line = Translate([rad_ext, 0, height], Union([line_2, line_1]))
let line_grid = Union([
    Translate([0, axis_o, line_spacing * 2], line),
    Translate([0, axis_o, line_spacing], line),
    Translate([0, axis_o, 0], line),
    Translate([0, axis_o, -line_spacing], line),
    Translate([0, axis_o, -line_spacing * 2], line),
    Translate([0, axis_o, -line_spacing * 3], line),
    Translate([0, axis_o, -line_spacing * 4], line),
    Translate([0, axis_o, -line_spacing * 5], line),
    Translate([0, axis_o, -line_spacing * 6], line)
])
let b2 = Translate([rad_ext, 0, 0], Box(2, width, height, false))
let plane1 = Difference(b2, [line_grid])

When I render this (clean, InPrivate (same as incognito in chrome) on Microsoft Edge), I get:
bad_grid

After commenting out the last line (Difference(...)) , evaluating the script and removing the comment again, I now get:
good_grid

I think my problems in previous models were also related to Difference().

@zalo
Copy link
Owner

zalo commented Dec 18, 2020

For what it's worth, random model corruption is probably related to the Cache? checkbox.

The cache is a hack I'm using to store the intermediate states of the model evaluation to dramatically speed up generation. But unfortunately, sometimes the Cache gets corrupted and causes issues :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants