Polyline rendering problem

11/5/2021 9:10 AM

we have a problem with a dxf (which I attach).
The central part, that looks like an ellipse, is not rendered in CadLib as in other cads (including autocad).
In CadLib it is seen with edges, while in the others it is smoothed.
The entity is a closed polyline.
I tried with the latest version (

Thank you,

11/5/2021 11:10 AM


You can modify the spline rendering precision by setting GraphicsConfig.ShapeFlattenEpsilon, for example:

C# Code:
// Negative value means relative precision.
graphicsConfig.ShapeFlattenEpsilon = -0.01d;

- Wout

11/5/2021 3:23 PM

Thank you so much for your help, with this workaround we can move forward.

By lowering the parameter as you suggested, we get a polyline that approximates the spline a little bit better.
But as you can see in the figure, the segments of the critical part are much longer than the segments of the other curves.

Lowering the parameter further (eg -0.005) we obtain an acceptable approximation, but the other parts have very small segments.
By greatly increasing the total number of segments, the rendering becomes unnecessarily heavy.

It seems that the approximation is not relative to the curvature of the entity.
In this case the curvature changes a lot and should be considered the worst of the entity.

Thanks for the support,

11/5/2021 3:57 PM

Unfortunately it's the best the current rendering pipeline can do at the moment. The relative epsilon is with respect to the size of the entity.

- Wout

11/8/2021 9:02 AM

Wout thank you for your help.