Overhangs & Supports
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
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°) is automatically tagged for sacrificial support column generation.
Tree Support Topology:
1import math23class TreeNode:4 def __init__(self, pos, children=None):5 self.pos = pos # (x, y, z)6 self.children = children or []78def generate_tree_supports(overhang_points, bed_z=0.0, dz=2.0, max_branch_angle=35.0):9 """10 Generates dendritic (tree) support structure merging downward towards the build bed.11 Branches merge pairwise when their maximum overhang descent cones intersect.12 """13 tan_theta = math.tan(math.radians(max_branch_angle))14 active_nodes = [TreeNode(pt) for pt in overhang_points]15 z = max(pt[2] for pt in overhang_points)1617 while z > bed_z:18 z_next = max(bed_z, z - dz)19 max_step_r = (z - z_next) * tan_theta20 next_layer, used = [], set()21 for i, a in enumerate(active_nodes):22 if i in used:23 continue24 merged = a25 for j in range(i + 1, len(active_nodes)):26 if j in used:27 continue28 b = active_nodes[j]29 dist_xy = math.hypot(a.pos[0] - b.pos[0], a.pos[1] - b.pos[1])30 if dist_xy <= 2.0 * max_step_r:31 mx = 0.5 * (a.pos[0] + b.pos[0])32 my = 0.5 * (a.pos[1] + b.pos[1])33 merged = TreeNode((mx, my, z_next), children=[a, b])34 used.add(j)35 break36 if merged is a:37 merged = TreeNode((a.pos[0], a.pos[1], z_next), children=[a])38 next_layer.append(merged)39 active_nodes, z = next_layer, z_next40 return active_nodes
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.
Related Concepts
3D printing slicing, infill generation, and support structures.
Interactive geometrical visualization of mesh contour slicing and adaptive layer heights.
Interactive geometrical visualization of TPMS gyroid lattices and continuous space-filling toolpaths.