//CREATE LINE WITH MULTIPLE POINTS
int pointCount = chi("Point_Count");
int points[];
resize(points, pointCount);
for (int i=0; i < pointCount; i++)
{
vector curPos = set(0,i,0);
int curPointId = addpoint(geoself(), curPos);
points[i] = curPointId;
}
for(int i=0; i<pointCount-1; i++;
{
addprim(geoself(), "polyline", points[i], points[i+1]);
}
//addprim(geoself(), "polyline", points);
===========================================================================
//RECREATING LINE NODE
float length = ch("Length");
int pointCount = chi("Points");
vector dir = chv("Division");
vector offset = chv("Offset");
dir = normalize(dir);
int points[];
resize(points, pointCount);
float stepVal = length/(float)(pointCount-1);
for(int i=0; i<pointCount; i++)
{
vector pointPos = (dir) * (stepVal*i) + offset;
int cutID = addpoint(geoself(), pointPos);
points[i] = curID;
}
addprim(geoself(), "polyline", points);
===========================================================================
No comments:
Post a Comment