Reduce point count of a wire with linear segments

Hi,

can anybody tell me a suitable method to reduce the point cound of a wire. the wire is a polyline with many lines as edges. I want to input this wire and define a tolerance and get a new lwire with a lower point count and thus fewer linear segments...

Thanks
Regards Simon

Pawel's picture

Hi Simon,

you can try:
- GeomAPI_Interpolate or
- GeomAPI_PointsToBSpline

Pawel

samscore's picture

Thanks, but it seems to me that this methods produce BSpline curves. I have a polyline as input and I need a polyline with reduced segment count as output. Thus I need a function with C0 continuity...

Regards
Simon

Pawel's picture

Hi Simon,

take the first point and create a line to the second-next. If the distance between the skipped point and the line is smaller than the tolerance filter the point and go to the 'new second-next' to repeat. If not go to the skipped point.

This should work
Pawel