Draw points along curve
in
Contributed Library Questions
•
1 year ago
Hi all,
Very new to processing. There is a similar discussion about 2 years back about this topic, but no conclusions were drawn on the thread, just recommendations. I am using the Igeo library because I am working between rhino and processing. What I would like to do is generate a random series of points around a curve within a certain distance from that curve. So far I have drawn all the points as well as a curve based on those points, but I can't figure out how to generate a random series of points along the curve. Below is what I have. Any help would be great, I am exhausted from trying to figure this out. Thanks!
import processing.opengl.*;
import igeo.*;
ICurve[] crvs;
void setup(){
size (700,700,IG.GL);
background (0);
ICurve[] crvs = IG.curves(); //getting curves
println(crvs.length);
}
void draw (){
new IPoint (519.72,519.72,-38.27);
new IPoint (519.72,467.75,-19.65);
new IPoint (519.72,415.77,-100.41);
new IPoint (519.72,363.80,46.96);
new IPoint (519.72,311.83,4.88);
new IPoint (519.72,259.86,-54.64);
new IPoint (519.72,207.89,-89.28);
new IPoint (519.72,155.92,47.65);
new IPoint (519.72,103.94,-2.08);
new IPoint (519.72,51.97,60.85);
new IPoint (519.72,0.00,44.26);
double[][] controlPoints5 =
{{519.72,519.72,-38.27}, {519.72,467.75,-19.65}, {519.72,415.77,-100.41}, {519.72,363.80,46.96}, {519.72,311.83,4.88},
{519.72,259.86,-54.64}, {519.72,207.89,-89.28}, {519.72,155.92,47.65}, {519.72,103.94,-2.08}, {519.72,51.97,60.85},
{519.72,51.97,60.85}, {519.72,0.00,44.26}};
new ICurve(controlPoints5,3).clr(1.,0,1.);
1