code wiki / (root) / nx_supports.nx

nx_supports.nx

buildroot/runtime/nx_supports.nx

13809 B357 linesdepth 10pulls 25 transitivereach 39 importersview sourcekind librarytopic supports
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_polygon.nx nx_abs.nx nx_machine_graph.nx nx_material_profile.nx nx_gcode_emit.nx nx_pillar_physics.nx nx_supports.nx nx_auto_supports_v2_target_test.nx nx_print_exceed_compose_test.nx nx_slice_auto_supports.nx nx_slice_auto_supports_test.nx nx_slice_pipeline.nx nx_supports_physics_test.nx nx_supports_test.nx nx_supports_v2_test.nx

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

55struct NxSupportPoints
181struct NxSupportPillar
192struct NxSupportPlan

consts

42const NX_SUPPORTS_OK: i64 = 0
43const NX_SUPPORTS_ERR_BAD_INPUT: i64 = 1
44const NX_SUPPORTS_ERR_CAPACITY: i64 = 2
62const NX_SUPPORTS_BYTES: i64 = 32
190const NX_SUPPORT_PILLAR_BYTES: i64 = 32
200const NX_SUPPORT_PLAN_BYTES: i64 = 40

functions

46func nx_supports_verdict_name(v: i64) -> *u8
64func nx_supports_new(capacity: i64) -> *NxSupportPoints
73func nx_supports_add(sp: *NxSupportPoints, x: i64, y: i64) -> i64
91func nx_supports_layer_overhang(prev: *NxPolygon, cur: *NxPolygon,
135func nx_supports_total_overhang(polygons: *u8, n_layers: i64,
202func nx_support_plan_new(capacity: i64,
217func nx_support_plan_add_pillar(plan: *NxSupportPlan,
called by 1: main calls 1: nx_abs
277func nx_support_plan_add_pillar_physics(plan: *NxSupportPlan,
322func nx_support_plan_emit_layer(plan: *NxSupportPlan,