Update PCBMODEL::SetMinDistance to set BRepBuilderAPI precision

Fixes #3818
This commit is contained in:
Mikołaj Wielgus 2021-01-03 08:40:40 +00:00 committed by jean-pierre charras
parent 8cdeb4d7bd
commit a9feb1c2d4
2 changed files with 10 additions and 6 deletions

View File

@ -250,7 +250,7 @@ PCBMODEL::PCBMODEL()
m_minDistance2 = MIN_LENGTH2; m_minDistance2 = MIN_LENGTH2;
m_minx = 1.0e10; // absurdly large number; any valid PCB X value will be smaller m_minx = 1.0e10; // absurdly large number; any valid PCB X value will be smaller
m_mincurve = m_curves.end(); m_mincurve = m_curves.end();
BRepBuilderAPI::Precision( 1.0e-6 ); BRepBuilderAPI::Precision( MIN_DISTANCE );
return; return;
} }
@ -661,6 +661,14 @@ void PCBMODEL::SetPCBThickness( double aThickness )
} }
void PCBMODEL::SetMinDistance( double aDistance )
{
// m_minDistance2 keeps a squared distance value
m_minDistance2 = aDistance * aDistance;
BRepBuilderAPI::Precision( aDistance );
}
// create the PCB (board only) model using the current outlines and drill holes // create the PCB (board only) model using the current outlines and drill holes
bool PCBMODEL::CreatePCB() bool PCBMODEL::CreatePCB()
{ {

View File

@ -131,11 +131,7 @@ public:
// aThickness > THICKNESS_MIN == use aThickness // aThickness > THICKNESS_MIN == use aThickness
void SetPCBThickness( double aThickness ); void SetPCBThickness( double aThickness );
void SetMinDistance( double aDistance ) void SetMinDistance( double aDistance );
{
// m_minDistance2 keeps a squared distance value
m_minDistance2 = aDistance * aDistance;
}
// create the PCB model using the current outlines and drill holes // create the PCB model using the current outlines and drill holes
bool CreatePCB(); bool CreatePCB();