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

align() 'steps on' color() calls beneath it #23

Open
ipmcc opened this issue Jun 14, 2024 · 0 comments
Open

align() 'steps on' color() calls beneath it #23

ipmcc opened this issue Jun 14, 2024 · 0 comments

Comments

@ipmcc
Copy link

ipmcc commented Jun 14, 2024

It appears that 'color()' directives underneath an align() directive are ignored. I rely on colors to understand the resulting picture, so this is a rather serious hindrance for me. I am new to OpenSCAD, so I don't know that digging in to solve this myself is probably not a good approach.

I've tried to use colored() but the output results appear to be the same. The stumper is that the demo with the sphere and rods works. I've been trying to make slow, incremental changes to the demo, but once I get my two boxes involved, something goes wonky.

Oh yeah, and every time I use colored, I get a lot of these warnings:
Screen Shot 2024-06-14 at 8 14 42 AM

Here are some examples:


No call to align(), both colors show up:

{ // Both colors shown
    color([ 1, 0, 0, 0.3 ])
        box([ housing_botton_length, housing_bottom_width, servo_body_height ], anchor = [ -1, -1, -1 ]);
    color([ 0, 0, 1, 1 ])
        box([ housing_cutout_length, housing_cutout_width, housing_cutout_height ], anchor = [ 1, 1, -1 ]);
} // Both colors shown

Output:
Screen Shot 2024-06-14 at 7 47 09 AM


Call to color() above align() call, both boxes are the same (top) color:

{ // Both boxes red
    color([ 1, 0, 0, 0.3 ])
        box([ housing_botton_length, housing_bottom_width, servo_body_height ], anchor = [ 1, 1, -1 ])
            color([ 0, 0, 1, 1 ])
                align([ 0, 0, 1 ])
                    box([ housing_cutout_length, housing_cutout_width, housing_cutout_height ], anchor = [ 1, 1, -1 ]);
} // Both boxes red

Output:
Screen Shot 2024-06-14 at 7 49 28 AM

Call to color() below align() call, both boxes are the same (top) color:

{ // Both boxes red
    color([ 1, 0, 0, 0.3 ])
        box([ housing_botton_length, housing_bottom_width, servo_body_height ], anchor = [ 1, 1, -1 ])
            align([ 0, 0, 1 ])
                 color([ 0, 0, 1, 1 ])
                     box([ housing_cutout_length, housing_cutout_width, housing_cutout_height ], anchor = [ 1, 1, -1 ]);
} // Both boxes red

Output:
Screen Shot 2024-06-14 at 7 50 52 AM

I don't know enough about relativity.scad to know if this is my fault somehow, or not, but it's making things rather tough to suss out. If it's my fault, and anyone knows what's going on here I'd appreciate the help. Thanks!

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

1 participant