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

Assistance Needed: Translating openScad Code to CascadeStudio Syntax #167

Open
yumilious opened this issue Jan 13, 2025 · 1 comment
Open

Comments

@yumilious
Copy link

Hello,

I am looking for help documentation or guidance on how to write equivalent code in CascadeStudio for the following openScad script. Specifically, I want to achieve the same functionality in CascadeStudio as the openScad code provided below:

outer_length = 74.6;       
outer_width = 38;        
thickness = 17;          

corner_radius = 10;     
corner_radius2 = 19;

inner_length = 56.603;      
inner_width = 20;        

position = [0, 0, 0];    

magnetic_ring(outer_length, outer_width, thickness, inner_length, inner_width, corner_radius, position);

module magnetic_ring(outer_length, outer_width, thickness, inner_length, inner_width, corner_radius, position) {
    translate(position) {
        difference() {
            rounded_rectangle(outer_length, outer_width, thickness, corner_radius2);
            translate([0, 0, -1]) 
            rounded_rectangle(inner_length, inner_width, thickness + 2, corner_radius);
        }
    }
}

module rounded_rectangle(length, width, height, radius) {
    hull() {
        for (x = [-length / 2 + radius, length / 2 - radius])
            for (y = [-width / 2 + radius, width / 2 - radius])
                translate([x, y, 0])
        cylinder(h = height, r = radius, $fn = 50);
    }
}

Could you please provide guidance or examples on how to implement this in CascadeStudio? Any help or documentation would be greatly appreciated.

Thank you!

@raydeleu
Copy link

Have you found my manual on CascadeStudio? If you Google this you will find https://github.com/raydeleu/CascadeStudioManual.

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