Control Curve Tessellation using Curve Attributes
Sometimes curves don’t look quite right. In Visualize, curves (e.g. a circular arc) are tessellated, meaning they are drawn using a series of line segments. In HPS, you can use the CurveAttributeControl
API to control curve tessellation at the segment level.
Consider the following code, which inserts markers at the same locations used to define and insert an arc;
auto key = GetCanvas().GetFrontView().GetAttachedModel().GetSegmentKey();
Point pt1(407530, 445592, 0);
Point pt2(407669, 445636, 0);
Point pt3(407803, 445694, 0);
key.InsertCircularArc(pt1, pt2, pt3);
key.InsertMarker(pt1);
key.InsertMarker(pt2);
key.InsertMarker(pt3);
The result is rendered as shown;
The scale of the data, the default curve attributes, and the camera settings combine to show an arc rendered as a straight line. If the camera were zoomed out, this level of tessellation might be satisfactory. Assuming it’s not, let’s see what we can do to fix the problem. For more information on fixing this issue, check out our forum post.