3D viewer: ensure 0 sized circles (that crash the viewer) are skipped.

This commit is contained in:
jean-pierre charras 2018-11-05 08:30:54 +01:00
parent 78f7ba10ef
commit 922ce89643
1 changed files with 11 additions and 9 deletions

View File

@ -873,10 +873,11 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
if( Is_segment_a_circle( start3DU, end3DU ) )
{
aDstContainer->Add( new CFILLEDCIRCLE2D( start3DU,
(aZoneContainer->GetMinThickness() / 2) *
m_biuTo3Dunits,
*aZoneContainer ) );
float radius = (aZoneContainer->GetMinThickness() / 2) * m_biuTo3Dunits;
if( radius > 0.0 ) // degenerated circles crash 3D viewer
aDstContainer->Add( new CFILLEDCIRCLE2D( start3DU, radius ,
*aZoneContainer ) );
}
else
{
@ -902,11 +903,12 @@ void CINFO3D_VISU::AddSolidAreasShapesToContainer( const ZONE_CONTAINER* aZoneCo
if( Is_segment_a_circle( start3DU, end3DU ) )
{
aDstContainer->Add(
new CFILLEDCIRCLE2D( start3DU,
(aZoneContainer->GetMinThickness() / 2) *
m_biuTo3Dunits,
*aZoneContainer ) );
float radius = (aZoneContainer->GetMinThickness() / 2) * m_biuTo3Dunits;
if( radius > 0.0 ) // degenerated circles crash 3D viewer
aDstContainer->Add(
new CFILLEDCIRCLE2D( start3DU, radius,
*aZoneContainer ) );
}
else
{