Hello I want to build an hda that uses the stroke node. Strokes would be drawn in screen space. When a new stroke is about to be made the hda will be able to intersect with a previous curve and set the projection center to that point.
I copied that snippet that work with the class State(object) I believe.
Well so there's a ugly answer to that question but i'm sure there's a better way.
Make a feedback loop to the draw curve itself (in a one iteration loop) and move the curves on the plane they originated from :
// Find the prim the current point belongs to, then store the point ID// of the first point in that primintpoint_prim = pointprims(0, @ptnum)[0];
intfirst_point_id = primpoints(0, point_prim)[0];
// Use projection attributes stored on the stroke primitive// to move pointsvectorp0_orig = point(0, "stroke_orig", first_point_id);
vectorp0_proj = point(0, "P", first_point_id);
floatdist_to_p0 = length(p0_orig - p0_proj);
v@P = v@stroke_orig + ( normalize(v@stroke_dir) * dist_to_p0 );