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

CAD Render Colors #105

Merged
merged 10 commits into from
Dec 12, 2020
Merged

CAD Render Colors #105

merged 10 commits into from
Dec 12, 2020

Conversation

dmadison
Copy link
Contributor

@dmadison dmadison commented Dec 4, 2020

I've made a number of changes to the assembly to make it easy to adjust the colors.

First, the assembly color variations are now generated from a single base color. This means you can change the one 'assembly' color and still keep the color variation between parts. The scalars were calculated from the current values so everything should keep the same appearance as before. The etch color, similarly, has been broken out into a variable and can now be changed.

Second, I've added variables for the hardware (nuts + bolts) and flap color. This allows you to change out the steel hardware for black oxide or swap the flaps from white to black. The letter color is calculated as the inverse of the flap color, so white flaps get black letters and black flaps get white letters (and red flaps get cyan letters and so on and so forth).

There should be no functional changes to the design.

Default: MDF, white flaps, steel hardware

sf-colors-default

Demo: Matte black acrylic, black flaps, black oxide hardware

sf-colors-matte-black

Using:

assembly_color = [0.1, 0.1, 0.1];
etch_color = [0.5, 0.5, 0.5];
hardware_color = [0.2, 0.2, 0.2];
flap_color = [0, 0, 0];

Allows for transparent base colors.
Inverse of the flap color, for contrast. E.g. white on black or black on white.
".0" appended to all floating values, four spaces for indentation, no extra whitespace
OpenSCAD's 'echo' does not have enough precision for the calculated floating point colors, and the comparison with assembly_color3 fails even though the 'echo' output matches. This recursive function checks whether all channel values are "close enough" for them to be functionally equivalent.
Reads alpha channel group in the regex if it's present and will add it to the manifest.
Copy link
Owner

@scottbez1 scottbez1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@scottbez1 scottbez1 merged commit 687d8cf into scottbez1:master Dec 12, 2020
@dmadison dmadison deleted the colors branch December 12, 2020 14:38
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

Successfully merging this pull request may close these issues.

2 participants