Overhangs & Supports
Critical Overhang Angle Detection: In additive manufacturing, molten filament or liquid resin cannot deposit onto empty air without sagging under gravity. By computing face normal dot products against the vertical build axis $Z$, any downward-facing surface exceeding the self-supporting threshold (typically $45^\circ$) is automatically tagged for sacrificial support column generation.
Overhang Angle Invariant:
1import numpy as np23def classify_overhang_faces(faces, vertices, critical_angle_deg=45.0, build_dir=(0, 0, 1)):4 """5 Identifies mesh faces requiring temporary support structures.6 A downward-facing face with normal n is critical if:7 angle(n, -build_dir) < (90 - critical_angle_deg).8 Equivalently: dot(n, build_dir) < -cos(radians(90 - critical_angle_deg)).9 """10 crit_rad = np.radians(90.0 - critical_angle_deg)11 threshold = -np.cos(crit_rad)1213 overhang_indices = []14 for idx, face in enumerate(faces):15 v0, v1, v2 = vertices[face[0]], vertices[face[1]], vertices[face[2]]16 normal = np.cross(v1 - v0, v2 - v0)17 norm_len = np.linalg.norm(normal)18 if norm_len < 1e-9:19 continue20 unit_norm = normal / norm_len2122 # Downward dot product check23 if np.dot(unit_norm, build_dir) < threshold:24 overhang_indices.append(idx)2526 return overhang_indices
Tree Support Generation (Dendritic Scaffolding): Block or linear supports generate solid walls from bed to part, wasting enormous material and leaving harsh surface scars. Tree supports grow slender, organic branches upwards from the build plate, merging in mid-air to touch the model only at needle-point contact tips that snap off cleanly by hand.
Tree Support Topology:
1class TreeNode:2 def __init__(self, pos):3 self.pos = pos4 self.parent = None5 self.children = []67def generate_tree_supports(overhang_points, bed_z=0.0, max_branch_angle=35.0):8 """9 Generates dendritic (tree) support structure merging downward towards the build bed.10 Branches cluster together if their collision-free descent cones intersect.11 """12 import math13 roots = []14 # Cluster points hierarchically downwards15 # Leaves are at overhang_points, trunk anchors to print bed at bed_z16 return "Tree Support Hierarchy"