Loading...
Logo
Processing Forum

Line perpendicular to Spline

in General Discussion  •  Other  •  2 months ago  
Hello everyone, 

I am looking for a solution to performing these steps:
-Draw a spline
-Divide it in equal-length segments (get the division points)
-Get the angle (or vector) of perpendicularity at these points
-(So I can then) draw perpendicular Lines to this Spline, that end at these points.

So actually there are two questions:
1) Spline equal length division
2) Line perpendicular to Spline at given point

Any thoughts?


Replies(3)

Well, first, how do you draw your spline?
Have you seen the reference about bezier and curve and the associated functions?
Toxiclibs has a lot of convenience methods for the things you want to do.
For the spline I was thinking about something like this.
I think it it equivalent to a spline...

beginShape();
curveVertex(84,  91);
curveVertex(84,  91);
curveVertex(68,  19);
curveVertex(21,  17);
curveVertex(32, 100);
curveVertex(32, 100);
endShape();
I will check out toxiclibs and see What I can find...
Thanks so far!