I’m dividing a surface into points and extracting the normal vectors.
I calculate the angle between each normal and the global Z-axis using the Angle component.
I convert those angles to degrees and use them to drive a gradient visualization.
What I need help with:
Color Gradient Logic:
I want to assign colors based on the angle between each surface normal and the vertical (Z-axis) as follows:
0° → Blue
21.8° → Yellow
Anything above 21.8° → BlackI’m not sure how to clamp the values properly or how to assign black only to values above 21.8°. What’s the best way to do this using the Gradient component (or other logic)?
Angle Verification:
I’m using Angle with a unit Z vector and the surface normals. Could anyone confirm if this is the correct method to check surface inclination? My goal is to check printability based on slope.
Printability Check (Wall Design):
Ultimately, I want this angle visualization to tell me whether a given wall is printable (under 21.8° = YES, above = NO). Do you have suggestions on how to best filter and tag areas as “Printable” vs “Too Steep”?
Thank you so much in advance. Any help or clarification is really appreciated!
for clarity: in the example taken from your deifinition, the surface normals have angles with Z axis that ranges between 47.6° up to 135.14°: the angle is always higher than 21.8° → nothing should be printable?
As said by @inno there is surely a problem with the angle logic. With your script, 0° mean aligned to Z, 90° perpendicular to Z (XY plane), 180° -Z .Angles will stay [0° 180°].
For the color logic I am quite sure you can look at this.
So these represent the layers, and i want a quick way to determine w ether a geometry is printable or not either with a boolean false or true check or a visual que or both. Im not sure what am i doing wrong. Help would be greatly appreciated or at least point me in the right direction.
Measure Angle.gh (59.4 KB)
Managed to make it work, wanted to share it here as well!
Problem was Axis Orientation the way XYZ is handled in Rhino and a few other misplaced components!
I think it would be much interesting also to try to understand how you could sort of “correct” a wall that has bad features, in such a way to try to make it printable within the constraints of the 21.8° angle
first I Contoured a random wall shape in layers with Z=12.5mm steps
then divided those contour curves into a reasonable (equal) density of points
the most important thing I think is keeping horizontal rows of points at their initial Z coordinate (AnchorXYZ goal for those) and the ClampLength goal between points of consecutive layers to be this distance:
then you can set a row of point, and say you want that row to be the fixed meaning that row must be printed exactly like it is in the original surface, and everything else should become a “consequence” of that (Anchor Goal to that row, so those points can’t actually move anywhere)
for sure this doesn’t take into account MANY things (for instance Center of mass…) but maybe could be of inspiration for something more interesting
[I also have the feeling that Smooth modifier is not the right goal to use here… I just wanted to decrease a little bit the amount of ripples…)