TMiterLimitJoint has a limit parameter that prevents the miter from extending too far from the geometry. When the edges intersect in a small angle, an unlimited miter has a long point that extends some distance from the intersection. The limit parameter indicates how far from the intersection the miter can extend. Whenever the miter extends beyond the specified distance, it is truncated and a bevel is applied.
The following code defines the three miter joints shown in Figure 111. To keep the code concise the code to create the polyline is not shown.
1 TMiterLimitJoint* miter1Joint = new TMiterLimitJoint( 1.0 ); 2 polyBundle->AdoptFrameJoint( miter1Joint ); 3 aMiterPolyline->Draw( thePort ); 4 5 TMiterLimitJoint* miterDefaultJoint = new TMiterLimitJoint(); 6 polyBundle->AdoptFrameJoint( miterDefaultJoint ); 7 aMiterPolyline->Draw( thePort ); 8 9 TMiterLimitJoint* miter100Joint = new TMiterLimitJoint( 100.0 ); 10 polyBundle->AdoptFrameJoint( miter100Joint ); 11 aMiterPolyline->Draw( thePort );
Lines 5 through 7: A miter joint with a miter limit of 10 that is adopted by polyBundle.
Lines 9 through 11: A miter joint with a miter limit of 100 that is adopted by polyBundle.