Commit 11b1632a authored by Julian Marcon's avatar Julian Marcon
Browse files

Corrected BL ends identification

parent f3befad7
......@@ -83,6 +83,11 @@ void Generator2D::Process()
ParseUtils::GenerateSeqVector(m_config["blcurves"].as<string>().c_str(),
m_blCurves);
if (m_config["blcurves"].beenSet)
{
FindBLEnds();
}
// linear mesh all curves
for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); i++)
{
......@@ -177,6 +182,8 @@ void Generator2D::Process()
void Generator2D::FindBLEnds()
{
set<CADVertSharedPtr> cadverts;
for (vector<unsigned>::iterator it = m_blCurves.begin();
it != m_blCurves.end(); ++it)
{
......@@ -186,15 +193,43 @@ void Generator2D::FindBLEnds()
for (vector<CADVertSharedPtr>::iterator iv = vertices.begin();
iv != vertices.end(); ++iv)
{
set<CADVertSharedPtr>::iterator is = m_blends.find(*iv);
set<CADVertSharedPtr>::iterator is = cadverts.find(*iv);
if (is != cadverts.end())
{
cadverts.erase(is);
}
else
{
cadverts.insert(*iv);
}
}
}
for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); ++i)
{
if (find(m_blCurves.begin(), m_blCurves.end(), i) != m_blCurves.end())
{
continue;
}
vector<CADVertSharedPtr> vertices =
m_mesh->m_cad->GetCurve(i)->GetVertex();
for (int j = 0; j < 2; ++j)
{
if (!cadverts.count(vertices[j]))
{
continue;
}
if (is != m_blends.end())
if (m_blends.count(i))
{
m_blends.erase(is);
m_blends[i] = 2;
}
else
{
m_blends.insert(*iv);
m_blends[i] = j;
}
}
}
......
......@@ -86,7 +86,8 @@ private:
std::map<unsigned, unsigned> m_periodicPairs;
std::vector<unsigned int> m_blCurves;
std::set<CADVertSharedPtr> m_blends;
/// map of curves and Bl ends: 0, 1 or 2 (for both)
std::map<unsigned, unsigned> m_blends;
LibUtilities::AnalyticExpressionEvaluator m_thickness;
int m_thickness_ID;
std::map<NodeSharedPtr, std::vector<EdgeSharedPtr> > m_nodesToEdge;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment