nx_supports.nx
buildroot/runtime/nx_supports.nx
about
nx_supports.nx -- overhang detection for FDM 3D printing.
v1 algorithm: for each vertex of the CURRENT layer's polygon,
check whether that vertex is supported by the PREVIOUS layer's
polygon (geometric expansion of prev by overhang_tolerance to
account for the maximum unsupported overhang angle). Unsupported
vertices need support pillars from below.
Per cardinal NISHI_3D_PRINT_ROADMAP §2.1 axis 1 (physics-aware
supports): v1 is conservative -- detects only vertex-position
overhangs. v2 will add yield-load model + tree pathfinding +
branching topology, ALL composing v1's detection output.
Overhang tolerance:
For a 45° safe overhang at layer height h, a vertex can extend
h * tan(45°) = h sideways without support. Caller passes the
tolerance directly (typically equal to layer_height_q14).
Composes nx_polygon (offset for the "supported envelope" of prev
+ point-in-polygon for membership test).
First-layer handling: if prev_polygon is NULL (a 0 pointer cast)
the layer is treated as bed-supported -- no overhang verts.
Christus-specific motivation: the outstretched arms appear in a
layer where they have no support in the layer below. Without
supports they bridge across air and sag. This primitive detects
where the arms start so v2 can generate pillars.
license_tier: ORIGINAL
dependencies 7 imports · 8 importers
imports: nx_syscalls.nxnx_polygon.nxnx_abs.nxnx_machine_graph.nxnx_material_profile.nxnx_gcode_emit.nxnx_pillar_physics.nx
imported by: nx_auto_supports_v2_target_test.nxnx_print_exceed_compose_test.nxnx_slice_auto_supports.nxnx_slice_auto_supports_test.nxnx_slice_pipeline.nxnx_supports_physics_test.nxnx_supports_test.nxnx_supports_v2_test.nx
structs
| 55 | struct NxSupportPoints |
| 181 | struct NxSupportPillar |
| 192 | struct NxSupportPlan |
consts
| 42 | const NX_SUPPORTS_OK: i64 = 0 |
| 43 | const NX_SUPPORTS_ERR_BAD_INPUT: i64 = 1 |
| 44 | const NX_SUPPORTS_ERR_CAPACITY: i64 = 2 |
| 62 | const NX_SUPPORTS_BYTES: i64 = 32 |
| 190 | const NX_SUPPORT_PILLAR_BYTES: i64 = 32 |
| 200 | const NX_SUPPORT_PLAN_BYTES: i64 = 40 |
functions
| 46 | func nx_supports_verdict_name(v: i64) -> *u8 |
| 64 | func nx_supports_new(capacity: i64) -> *NxSupportPoints |
| 73 | func nx_supports_add(sp: *NxSupportPoints, x: i64, y: i64) -> i64 called by 1: nx_supports_layer_overhang |
| 91 | func nx_supports_layer_overhang(prev: *NxPolygon, cur: *NxPolygon, |
| 135 | func nx_supports_total_overhang(polygons: *u8, n_layers: i64, |
| 202 | func nx_support_plan_new(capacity: i64, |
| 217 | func nx_support_plan_add_pillar(plan: *NxSupportPlan, |
| 277 | func nx_support_plan_add_pillar_physics(plan: *NxSupportPlan, |
| 322 | func nx_support_plan_emit_layer(plan: *NxSupportPlan, called by 5: mainmainnx_slice_pipe_run_v2mainmain calls 3: nx_gemit_cstrnx_polygon_make_squarenx_gemit_polygon |