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 6e9475694c
commit 830c5e7db7
1 changed files with 11 additions and 9 deletions

View File

@ -871,10 +871,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
{
@ -900,11 +901,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
{