Hi Guys,
I try this approach
When a circle (or curve) average segment length is greater than the target length a point is added in a random segment. The points then move to even out the spacing. This avoids the jittering and smoothing effects of an overall resample.
Any idea how to do this? In VEX use “addpoint”?
vector origin = {0,0,0};
int numpoints = npoints(0);
if (numpoints == 20){
addpoint(0,origin);
}
But how to place it on the random segment, and shift the points to even out the spacing?
Thanks.
addpoint VEX function
2963 2 0- Bretislav Kaspar
- Member
- 18 posts
- Joined: May 2014
- Offline
- Konstantin Magnus
- Member
- 670 posts
- Joined: Sept. 2013
- Online
Hi Kaspar,
I think the resample node can do all this. Anyways in VEX you would use the primuv() function for such thing.
I think the resample node can do all this. Anyways in VEX you would use the primuv() function for such thing.
// resamples curves in a prim wrangle float seg_length = chf('segment_length'); float u_length = primintrinsic(0, 'measuredperimeter', i@primnum); int steps = int( ceil(u_length / seg_length) ); for(int i = 0; i < steps; i++){ vector st = set(i / float(steps - 1), 0.0, 0.0); vector pos = primuv(0, 'P', i@primnum, st); int pt = addpoint(0, pos); } removeprim(0, i@primnum, 1);
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
- Bretislav Kaspar
- Member
- 18 posts
- Joined: May 2014
- Offline
-
- Quick Links