Convert Polyline to Line Segments

Convert Polyline to Line Segments

WonkaPet
Advocate Advocate
3,885 Views
4 Replies
Message 1 of 5

Convert Polyline to Line Segments

WonkaPet
Advocate
Advocate

Hi there,


Does anyone know how I would go about converting a polyline to line segments.

This would be similar to when a Spline is converted to a Polyline using ToPolylineWithPrecision(false,false).

 

0 Likes
Accepted solutions (1)
3,886 Views
4 Replies
Replies (4)
Message 2 of 5

TerryDotson
Mentor
Mentor

Unless you want special consideration of arc segments, the EXPLODE command will do this.  If arcs are present and you need segments along the arc, you will need a custom lisp or add-on to remove the arcs (and substitute short approximating segments).

0 Likes
Message 3 of 5

WonkaPet
Advocate
Advocate

Thanks for the response. I am currently using explode to get Arcs and Lines but I need the Arcs to be segmented out with a specific precision. 

0 Likes
Message 4 of 5

Alexander.Rivilis
Mentor
Mentor
Accepted solution

@WonkaPet 

 

 

 

// Arc approximation
double prec = 0.00001;
Arc arc = //... initialization of your arc
Cuve3d curv = arc.GetGeCurve();
Interval intl = curv.GetInterval();
double startParam = intl.LowerBound;
double endParam = intl.UpperBound;
PointOnCurve3d[] ptCurvs =
  curv.GetSamplePoints(startParam, endParam, prec);

 

 

The same possible to do with whole polyline.

 

 
 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 5

WonkaPet
Advocate
Advocate

@Alexander.Rivilis That solution worked thank you.

0 Likes