(bind-func static envelope_segments
(lambda (points:SAMPLE* num_of_points:i64)
(let ((lines:[SAMPLE,SAMPLE]** (zalloc num_of_points))
(k 0))
(dotimes (k num_of_points)
(let* ((idx (* k 2))
(x1 (pref points (+ idx 0)))
(y1 (pref points (+ idx 1)))
(x2 (pref points (+ idx 2)))
(y2 (pref points (+ idx 3))))
(pset! lines k (line_c x1 y1 x2 y2))))
lines)))