Samples points along a set of contiguous edges at equal arc length, equal turning, or both.
(edges:sample edges samp_opts [acis-opts=NULL])
|Argument||Scheme Data Type|
|edges||edge or (edge ...)|
This Scheme extension samples a contiguous set of edges with equal spacing, at any density. For example, the edges may come from slicing a solid model with a plane. Spacing can be measured in terms of curve arc length, or turning, or both. Density can be specified as total number of samples, or as point spacing distance.
Sampling is similar to faceting, but with two differences. First, sampling maintains a high level of accuracy compared to faceting: points will not be further apart than the specified spacing, within a tight tolerance. Second, sampling always avoids too close points, except possibly the last sample.
- edges is a list of contiguous edges.
- samp_opts is a sample-edges-options object, created with the Scheme extension sample-edges:options.
- acis-opts (optional) specifies versioning and journaling.
In this example, we specify a maximum length of 3 units between sample points. Note that the last two sampled points are closer.
(define spiral (edge:spiral (position 0 0 0) (gvector 0 0 10) (gvector 0 5 0) 2 1800)) (define ed (list-ref (entity:edges spiral) 0)) (define max_len 3.0) (define seo (sample-edges:options 'do_max_len max_len)) (define posList (edges:sample ed seo)) (define points (map point posList)) (entity:set-color points 1)
In this example we specify a maximum turning angle of π / 10 radians. Note that the last two sampled points are closer. It is instructive to compare the spiral example for sampling at equal length with sampling at equal turning.
(define spiral (edge:spiral (position 0 0 0) (gvector 0 0 10) (gvector 0 5 0) 2 1800)) (define ed (list-ref (entity:edges spiral) 0)) (define cur (curve:from-edge ed)) (define max_turn 0.31416) (define seo (sample-edges:options 'do_max_turning max_turn)) (define posList (edges:sample ed seo)) (define points (map point posList)) (entity:set-color points 1)