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

[CSG]: transformations not always accurate #292

Closed
martin-henz opened this issue Mar 15, 2024 · 2 comments
Closed

[CSG]: transformations not always accurate #292

martin-henz opened this issue Mar 15, 2024 · 2 comments
Labels
Bug [Category] important [Priority] Fixing this is important, but not mission-critical

Comments

@martin-henz
Copy link
Member

Here is a program that should result in a Mosely snowflake:

https://share.sourceacademy.org/lab29

Here is the output.

Screenshot 2024-03-15 at 11 01 50 AM

The red circle indicates a possible bug: a wrongly displaced component.

@martin-henz martin-henz added Bug [Category] important [Priority] Fixing this is important, but not mission-critical labels Mar 15, 2024
@Cloud7050
Copy link
Contributor

While breaking down the program to see how the shapes change with each operation, I changed the unit cube to better visualise what the first iteration of the fractal looks like:

const c = translate(scale(cube('#88ccff'), 0.5, 0.5, 0.5), 0.25, 0.25, 0.25);

This is what I saw:

image

It would appear that the 2 circled portions of the fractal are actually 3 cubes stacked next to each other, and not a single cube. Perhaps that is causing the strangeness seen in the second iteration of the fractal.

Changing center_row to the following appears to fix the fractal (s instead of inner_row):

    const center_row = before_frac(f, 
                           s,
                           before(empty, 
                             s));

image

https://share.sourceacademy.org/lww29

@martin-henz
Copy link
Member Author

Yes, correct. I found the bug too. Here is the correct program:

https://share.sourceacademy.org/lww29

So sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug [Category] important [Priority] Fixing this is important, but not mission-critical
Projects
None yet
Development

No branches or pull requests

2 participants