const Standard_Real theMaxParam)
{
Standard_Integer aPriority = (thePriority == -1) ? GetStandardPriority (theShape, theType) : thePriority;
-
- if( isAutoTriangulation && !BRepTools::Triangulation (theShape, Precision::Infinite()) )
+ if (isAutoTriangulation
+ && !BRepTools::Triangulation (theShape, Precision::Infinite(), true))
{
BRepMesh_IncrementalMesh aMesher(theShape, theDeflection, Standard_False, theDeviationAngle);
}
if (!aPoints.IsNull()
&& !aPoints->IsEmpty())
{
- theSensitive = new Select3D_SensitiveCurve (theOwner, aPoints);
+ if (aPoints->Length() == 2)
+ {
+ // don't waste memory, create a segment
+ theSensitive = new Select3D_SensitiveSegment (theOwner, aPoints->First(), aPoints->Last());
+ }
+ else
+ {
+ theSensitive = new Select3D_SensitiveCurve (theOwner, aPoints);
+ }
return;
}